# Introduction

No payment integration is too complex.

Sola Payments is a complete payment platform that you can tailor to your ambition. Delivered with step-by-step support to power you forward from day one.

## How to Integrate with Sola Payments <a href="#how-to-integrate-with-sola-payments" id="how-to-integrate-with-sola-payments"></a>

### Card Not Present Payments <a href="#card-not-present-payments" id="card-not-present-payments"></a>

### [iFields](https://docs.solapayments.com/products/ifields) & [Transaction API](https://docs.solapayments.com/api/transaction) <a href="#ifields-and-transaction-api" id="ifields-and-transaction-api"></a>

This integration allows developers to build fully custom payment pages while keeping card data secure. iFields generates single-use tokens (SUT) for each transaction, which is then submitted via the Transaction API for processing.

**Key Benefits:**

* Full control over the user interface and payment experience.
* Secure handling of card data, as sensitive information never touches your servers.
* Flexible API integration that aligns with your system workflows.

### Card-on-File & Recurring Payments <a href="#card-on-file-and-recurring-payments" id="card-on-file-and-recurring-payments"></a>

#### Store [Tokens](https://docs.solapayments.com/#knowledgebase-tokenization) in Your System <a href="#store-tokens-in-your-system" id="store-tokens-in-your-system"></a>

Sola generates tokenized card representations (xToken) that can be safely stored in your database and used for card-on-file or recurring transactions.\
**Ideal for:** Platforms with existing customer records that trigger payments programmatically via API.

#### [Customer & Recurring API](https://docs.solapayments.com/api/recurring) <a href="#customer-and-recurring-api" id="customer-and-recurring-api"></a>

Create customers, payment methods, and recurring schedules directly within Sola. Sola returns identifiers for customers, payment methods, and schedules, which can be used for card on file transactions or to set up automated schedules that will run independently in the Sola gateway.\
**Ideal for:** Systems without a customer database or when you prefer Sola to run recurring billing logic.

### Card-Present Payments <a href="#card-present-payments-cloudim-api" id="card-present-payments-cloudim-api"></a>

#### [CloudIM API](https://docs.solapayments.com/products/cloudim-developer-guide) <a href="#card-present-payments-cloudim-api" id="card-present-payments-cloudim-api"></a>

CloudIM enables seamless integration with Sola devices via a cloud-based API, eliminating the need for physical connections, drivers, or local SDKs. Once the device is connected to the merchant’s network, you can process transactions using simple REST API calls.

**Key Benefits:**

* No local SDKs, drivers, or complicated setup required.
* Works over the cloud, allowing remote device management.
* Simplifies card-present transaction handling while maintaining PCI compliance.

### PayFac for Marketplaces & Platforms  <a href="#payfac-for-marketplaces-and-platforms" id="payfac-for-marketplaces-and-platforms"></a>

Sola’s PayFac solution enables marketplaces and multi-merchant platforms to onboard, manage, and monitor sub-merchants under a single master account through the Partner portal. sub-merchant onboarding can also be handled programmatically via our [PayFac onboarding API](https://docs.solapayments.com/api/account-boarding-api).

You can monetize payments by taking a portion of each transaction your sub-merchants process. This amount is transferred to your master account on a per-transaction basis and is handled automatically by our system. Fees can be configured at the account level as either a percentage or a flat amount, or passed dynamically via the [Transaction API](https://docs.solapayments.com/api/transaction) or [Customer & Recurring API](https://docs.solapayments.com/api/recurring).

**Key Benefits:**

* Scalable Sub-Merchant Onboarding
* Automated monetization

## Credentials <a href="#knowledgebase-credentials" id="knowledgebase-credentials"></a>

Across all Sola's products we use a key (`xKey`) to identify on what account to process a specific transaction. Each Sola product doc will guide you where to set the `xKey` (for example: in the body of the request along with all other parameters, in the request header as “Authorization”, in the app settings etc.). You will have a unique `xKey` for [sandbox ](https://solapayments.com/devsdk/)and production accounts.

## Best practices <a href="#best-practices" id="best-practices"></a>

* **Transaction response**\
  Transaction responses contain valuable information that you can utilize. The most important one is `xResult`; this will inform your system if the transaction was approved or declined. `xAuthAmount` will indicate how much was actually authorized by the bank, so it is a good idea to make sure that it matches the requested amount. By default, transactions will only approve for the full amount. If the full amount is not available, the transaction will be declined. Every transaction will receive a unique `xRefnum` that is used to identify this unique transaction. It is helpful during troubleshooting and is also used in case of a follow-up transaction (void refund, etc.). It is a good idea to display this `xRefNum` to the user and add it to receipts. You can find a full list of available response parameters [here](https://docs.cardknox.com/#response-parameters).
* **Logs**

  When submitting transaction requests to the Sola gateway, it is highly recommended to log the full request and response, including both the content body and headers. By logging this information, you ensure that critical details are readily available. In the event of any questions or troubleshooting needs, providing this information to the Sola support team will significantly reduce the time required to assist you or resolve the issue.
* **Declines**\
  When a payment fails, you will get a `xResult` of `D` or `E`. Typically, you would simply want to display the failure notification to the user and show them the `xError` in the response that may, at times, contain helpful information to identify the reason for the decline. You can choose to allow the user to try another card. There is no need to handle different error messages or error codes specifically.
* **Duplicates**\
  It is a good idea to pass in a unique xInvoice with each transaction that is sent for processing so Sola can try to catch unintentional duplicate payments. You can also give the user an option to intentionally process a duplicate payment by incrementing the invoice number or adding `xAllowDuplicate=true` to the transaction request. You can see more about duplicate payment handling [here](https://docs.cardknox.com/#knowledgebase-duplicatehandling).

## Vendor Settings *(optional)* <a href="#vendor-settings-optional" id="vendor-settings-optional"></a>

A Vendor ID is a unique identifier associated with your vendor account. This feature is useful when you will be processing payments across multiple Sola accounts. It allows for specific settings to be configured on your vendor account, and these settings will be applied on transactions that include your Vendor ID in the transaction request. When using this feature, It is optimal to include your vendor ID across all transactions that you process on the Sola gateway.

#### **Setup** <a href="#setup" id="setup"></a>

Our support team can enable your vendor account and provide you with the ID.

#### **Usage** <a href="#usage" id="usage"></a>

To use Vendor settings, include the `xVendorID` = {yourvendorid} in the transactions request.

#### **Features/Benefits** <a href="#features" id="features"></a>

**iFields key:** Use a single iFields key across all your accounts.

**Tokenization:** Tokens can be used across accounts.

**Licenses:** Unlimited device licenses

## Tokenization <a href="#knowledgebase-tokenization" id="knowledgebase-tokenization"></a>

Tokenization is the process of replacing sensitive payment data with a non-sensitive algorithm-generated `string` called a **token (`xToken`).** Each time you send a card or bank account number with a transaction, the response will include a token represented by `xToken`.

As a merchant’s [PCI-compliance scope](https://solapayments.com/guides/pci-compliance-the-biggest-myths-explained/) significantly increases when storing sensitive data, the best practice is to store the token in your database rather than sensitive data. You use the token for follow-up transactions.

> With this approach, **sensitive data will not be at risk** if a data breach occurs on your local system.

Sola references the payment information on our servers associated with the token sent and processes the transaction. A new token will be returned on every new transaction processed.

You can reuse the original token multiple times. However, you should use the new returned token in the following scenarios:

* If the card has a new expiration date.
* If a response flag indicates, the card was updated/modified.

A token only stores the data sent with a transaction that is necessary to process future transactions. It does not store general customer information such as billing and contact information.<br>

As an example, for a credit card transaction, only the credit card number, expiration date, street address, and zip code (which can be required for Address Verification System (AVS) validation) are stored with the token.

{% hint style="info" %}
**Note:** The 3 or 4 digit CVV number is never stored on Sola servers as per PCI regulations, and in extension, is not associated with tokens. CVV data is only used when processing initial transactions where the cardholder is generating the transaction with their physical card in hand.
{% endhint %}

{% hint style="info" %}
Tokens can be used only on the account it was generated on unless linked to another account via **cross tokenization**&#x20;

You can request **account linking for tokenization** via [Support](https://solapayments.com/support/).

The best practice is to generate tokens on one account and link all other accounts to your first account instead of generating tokens for each.
{% endhint %}

To generate a token for a payment method without processing a transaction, use the save command.

* For credit card transactions: `cc:save`.
* For check transactions: `check:save`.

## Duplicate Handling <a href="#knowledgebase-duplicatehandling" id="knowledgebase-duplicatehandling"></a>

The Sola Gateway automatically blocks a transaction considered a “duplicate” of another transaction based on certain identifying features and if the transactions are within 10 minutes (*default timeframe*) of each other.\
\
The transaction will error with a message of: `Duplicate Transaction`

Identifying Features:

* Key
* Credit Card Number
* Transaction Amount
* Invoice Number
* Check Account Number
* Check Routing Number

You can allow the transaction to go through by changing any of the above. Alternatively, you can pass through "`xAllowDuplicate` = True" in the transaction request.

You can set `xDuplicateWindow` with the number of minutes on a transaction request to override the default 10-minute timeframe of the duplicate checker.

{% hint style="info" %}
By default, you can set it up to 1440 (24 Hours) max.\
Your account can be set to allow up to 43200 (30 Days) via [Support](https://solapayments.com/support/).
{% endhint %}

## Batches <a href="#knowledgebase-batches" id="knowledgebase-batches"></a>

Each day, all captured transactions are added to a batch file. Once the batch cutoff time is reached (determined by the processing bank), Sola automatically “batches out”, which sends the related transactions to the bank for settlement. A batch report is available in the Sola portal.

## Response Parameters

Transactions that are submitted to the Sola API will return a response with one or more of the fields below. Below are the standard parameters and their values. The field names in parentheses are the fields for the reporting API.

| **Field Name**                        | **Description**                                                                                                                                                                                                                          | **Sample values**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **xResult** (xGatewayResult)          | Single character code indicating if the transaction was Approved or not. A = Approved E = Error D = Declined                                                                                                                             | <p>A<br>E<br>D</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **xStatus** (xResponseResult)         | Verbiage indicating if the transaction was approved or not.                                                                                                                                                                              | <p>Approved<br>Error<br>Declined</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **xStatusReason**                     | <p><code>xStatusReason</code> can be passed on reporting to show detailed return reason for ACHQ. <br><br><strong>\*This field is only supported for ACHQ accounts!</strong></p>                                                         | <p>Common return values:</p><ul><li><code>"R01 - Insufficient Funds"</code></li><li><code>"R03 - No Account Unable to Locate Account"</code></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **xError** (xResponseError)           | Error message, if applicable                                                                                                                                                                                                             | See error code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **xErrorCode**                        | Error code                                                                                                                                                                                                                               | <p>Most common error codes:<br>00000 = Approved<br>01332 = Duplicate Transaction<br>01334 = Declined Transaction<br>01479 = Invalid Card</p><p><a href="/pages/657vyyfAWFP1TY6pEBRz">See All Error Codes</a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **xRefNum**                           | <p>Sola transaction reference number<br>Note: xRefnum is always returned regardless of the outcome of the transaction<br><br>Note: <code>xRefnum</code> can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String</p> |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xInvoice**                          | Invoice number                                                                                                                                                                                                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xExp**                              | The card expiration number                                                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xAuthCode** (xResponseAuthCode)     | Authorization code, for approved transactions only                                                                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xBatch** (xResponseBatch)           | Batch into which the transaction will settle                                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xAvsResultCode** (xResponseAVSCode) | The Address Verification Service (AVS) response code                                                                                                                                                                                     | <p>YYY = Address: Match & 5 Digit Zip: Match<br>NYZ = Address: <strong>No Match</strong> & 5 Digit Zip: Match<br>YNA = Address: Match & 5 Digit Zip: <strong>No Match</strong><br>NNN = Address: <strong>No Match</strong> & 5 Digit Zip: <strong>No Match</strong><br>XXU = Address Information not verified for domestic transaction<br>YYX = Address: Match & 9 Digit Zip: Match<br>NYW = Address: No Match & 9 Digit Zip: Match<br>XXR = Retry / System Unavailable<br>XXS = Service Not Supported<br>XXW = Card Number Not On File<br>XXE = Address Verification Not Allowed For Card Type<br>XXG = Global Non-AVS participant<br>YYG = International Address: Match & Zip: Not Compatible<br>GGG = International Address: Match & Zip: Match<br>YGG = International Address: Not Compatible & Zip: Match</p><p>Alternative Responses</p><p>AvsResultCodexAvsResultYAddress: Match & 5 Digit Zip: MatchZNo Match & 5 Digit Zip: MatchAAddress: Match & 5 Digit Zip: No MatchNAddress: No Match & 5 Digit Zip: No MatchXAddress: Match & 9 Digit Zip: MatchWAddress: No Match & 9 Digit Zip: MatchRRetry / System UnavailableSService Not Supported</p> |
| **xAvsResult**                        | AVS verbiage                                                                                                                                                                                                                             | See AVS result code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **xCvvResultCode** (xResponseCVVCode) | Card code verification (CCV) response code                                                                                                                                                                                               | <p>M = Match<br>N = No Match<br>P = Not Processed<br>S = Should be on card, but not so indicated<br>U = Issuer Not Certified<br>X = No Response from Association</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **xCvvResult**                        | CVV verbiage                                                                                                                                                                                                                             | See CVV result code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **xAuthAmount** (xAmount)             | The total amount authorized, inclusive of tax and tip (if applicable)                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xMaskedCardNumber**                 | A masked version of the credit card used for the transaction                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **xCardType**                         | Type of credit card used for the transaction                                                                                                                                                                                             | <p>Unknown<br>EBT<br>GiftCard<br>Amex<br>Visa<br>MasterCard<br>Discover<br>Diners<br>JCB<br>DonorsFund<br>OJC<br>Pledger</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **xName**                             | Name of cardholder                                                                                                                                                                                                                       | John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **xToken**                            | Token returned for use with future transaction                                                                                                                                                                                           | gh3hpn46mp0g785915gn7h79q502976n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **xCurrency**                         | Currency that the transaction was processed in                                                                                                                                                                                           | USD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **xEntryMethod**                      | Transaction method                                                                                                                                                                                                                       | <p>Keyed<br>EMV<br>Swipe</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **xDate**                             | Date and time the transaction was processed                                                                                                                                                                                              | 1/1/2020 10:00:00 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **xRefnumCurrent**                    | Current reference number                                                                                                                                                                                                                 | **Used for troubleshooting purposes only.** Returned when using a command that modifies an existing transaction, such as cc:void, cc:capture, or cc:adjust.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **xReviewed**                         | This will be returned only if account is configured to return this response field.                                                                                                                                                       | <p>Y = Transaction was authenticated by 3ds. If authentication was submitted to the bank, the merchant will have chargeback protection. </p><p>P = Transaction was authenticated by 3ds. If authentication was submitted to the bank, the merchant may not have chargeback protection. </p><p>N =Transaction was not able to achieve 3ds authentication. If authentication was submitted to the bank, the merchant may not have chargeback protection. </p><p>F = The 3ds authentication process completed but the bank response indicated that the results were invalid. The merchant will not have fraud chargeback protection.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| x3dsSubmitted                         | This indicates if the bank request included 3ds data elements.                                                                                                                                                                           | 1 = The bank request included 3ds data elements.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| (xStatus)                             | The ACH status that you receive in webhooks                                                                                                                                                                                              | <p>0 (Pending)</p><p>20 (Rejected)</p><p>5 (Cancelled)</p><p>6 (Awaiting Response)</p><p>14 (Chargeback)</p><p>16 (Settled)</p><p>18 (Returned)</p><p>19 (Hold)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xIssuerResponseCode                   | This code received from the card association / issuer will be returned when available.                                                                                                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

## Sandbox Account Testing Info and Triggers <a href="#sandbox-account-testing-info-and-triggers" id="sandbox-account-testing-info-and-triggers"></a>

A sandbox account is used to simulate transactions as if it is in production. It is designed to act exactly like a production account. However, there can sometimes be unique account setups where the production account won't match the sandbox account exactly to a T. Therefore, we recommend that you do all your testing in the sandbox account and then doing one final test when going live and swapping out your sandbox key with your production key.

#### Test Credit Card and Account Numbers <a href="#credit-card-and-account-numbers-hardbreak" id="credit-card-and-account-numbers-hardbreak"></a>

Test credit card and account numbers are available for testing and development. You can use any valid card number to submit transactions while using a sandbox account. The card will not actually be charged as long as you are using your sandbox key. To avoid your system unintentionally going live while still configured with your sandbox credentials, transactions in the sandbox account are limited to $10. You can bypass that limit by using the below numbers.

{% tabs %}
{% tab title="Credit Card" %}

| Card Type        | Card Number         |
| ---------------- | ------------------- |
| Visa             | 4444333322221111    |
| Visa             | 4111111111111111    |
| Visa (3DS)       | 4000000000002503    |
| Mastercard       | 5454545454545454    |
| Discover         | 6011208703331119    |
| American Express | 370276000431054     |
| EBT              | 6004861944321111844 |
| Pledger          | 6599973548556861    |
| DonorsFund       | 6599993776775348    |
| OJC              | 6900664467242419    |
| {% endtab %}     |                     |

{% tab title="Check (ACH)" %}

| Account Number | Routing Number                       |
| -------------- | ------------------------------------ |
| 999999999      | 021000021 (any valid routing number) |
| {% endtab %}   |                                      |
| {% endtabs %}  |                                      |

### Triggers

{% tabs %}
{% tab title="Declined/Error Transaction" %}

| **xName** | **Response** |
| --------- | ------------ |
| Decline   | Declined     |

| xAmount      | Response      |
| ------------ | ------------- |
| **9.91**     | Declined      |
| **9.92**     | Gateway Error |
| {% endtab %} |               |

{% tab title="Partial Auth" %}

(AllowPartialAuth must be set to True)

| **xAmount**  | **AuthAmount** |
| ------------ | -------------- |
| **7.5**      | 1.5            |
| **7.23**     | 1.23           |
| {% endtab %} |                |

{% tab title="Delay/Timeout" %}

| xAmount  | Behavior                    | Response  |
| -------- | --------------------------- | --------- |
| **7.31** | Response delayed 30 seconds | Try Again |
| **7.32** | Response delayed 30 seconds | Try Again |
| **7.29** | Response delayed 30 seconds | Approved  |

| **xDescription**      | **Behavior**                 | **Response** |
| --------------------- | ---------------------------- | ------------ |
| **Delay**             | Response delayed 30 seconds  | Approved     |
| **Timeout**           | Response delayed 30 seconds  | Try Again    |
| **Timeout\_Extended** | Response delayed 120 seconds | Try Again    |
| {% endtab %}          |                              |              |

{% tab title="CVV Responses" %}

| **xCVV**      | **CVV Result** | **CVV Result Code**                     |
| ------------- | -------------- | --------------------------------------- |
|               |                |                                         |
| **123**       | M              | Match                                   |
| **1234**      | M              | Match                                   |
| **111**       | M              | Match                                   |
| **1111**      | M              | Match                                   |
| **222**       | N              | No Match                                |
| **2222**      | N              | No Match                                |
| **555**       | P              | Not Processed                           |
| **444**       | S              | Should be on card, but not so indicated |
| **8888**      | U              | Issuer Not Certified                    |
| **7777**      | X              | No Response from Association            |
| {% endtab %}  |                |                                         |
| {% endtabs %} |                |                                         |

{% tabs %}
{% tab title="AVS Responses" %}

<table data-header-hidden><thead><tr><th width="170">xStreet</th><th>xZip</th><th>AvsResultCode</th><th>xAvsResult</th></tr></thead><tbody><tr><td><strong>xStreet</strong></td><td><strong>xZip</strong></td><td><strong>AvsResultCode</strong></td><td><strong>xAvsResult</strong></td></tr><tr><td><strong>111</strong></td><td>11111</td><td>YYY</td><td>Address: Match &#x26; 5 Digit Zip: Match</td></tr><tr><td><strong>999</strong></td><td>99999</td><td>NNN</td><td>Address: No Match &#x26; 5 Digit Zip: No Match</td></tr><tr><td><strong>111</strong></td><td>111111111</td><td>YYX</td><td>Address: Match &#x26; 9 Digit Zip: Match</td></tr><tr><td><strong>111</strong></td><td>99999</td><td>YNA</td><td>Address: Match &#x26; 5 Digit Zip: No Match</td></tr><tr><td><strong>999</strong></td><td>111111111</td><td>NYW</td><td>Address: No Match &#x26; 9 Digit Zip: Match</td></tr><tr><td><strong>999</strong></td><td>11111</td><td>NYZ</td><td>Address: No Match &#x26; 5 Digit Zip: Match</td></tr><tr><td><strong>888</strong></td><td>88888</td><td>XXR</td><td>Retry / System Unavailable</td></tr><tr><td><strong>777</strong></td><td>77777</td><td>XXU</td><td>Address Information not verified for domestic transaction</td></tr><tr><td><strong>666</strong></td><td>66666</td><td>XXS</td><td>Service Not Supported</td></tr></tbody></table>
{% endtab %}

{% tab title="Alternative AVS Responses" %}

| **AvsResultCode** | **xAvsResult**                            |
| ----------------- | ----------------------------------------- |
| **Y**             | Address: Match & 5 Digit Zip: Match       |
| **Z**             | No Match & 5 Digit Zip: Match             |
| **A**             | Address: Match & 5 Digit Zip: No Match    |
| **N**             | Address: No Match & 5 Digit Zip: No Match |
| **X**             | Address: Match & 9 Digit Zip: Match       |
| **W**             | Address: No Match & 9 Digit Zip: Match    |
| **R**             | Retry / System Unavailable                |
| **S**             | Service Not Supported                     |
| {% endtab %}      |                                           |
| {% endtabs %}     |                                           |

The Sola gateway does not require developers to go through a certification process. We do provide a process to self-certify if developers choose to do so. You can download the Sola Self-certification Guide.


# Transaction API

## Overview <a href="#overview" id="overview"></a>

The Sola API enables developers to process payments using the Sola gateway. Systems integrating with the Sola API can submit API calls using various commands. The API supports many payment methods, including credit cards, ACH, EBT, and gift cards.

To begin building your API integration,[ create an account](https://solapayments.com/devsdk/) for a Sola sandbox — our secure testing environment that mimics the production environment. After signing up, you’ll be able to create user credentials for the Sola Merchant Portal. Once you log in to the Portal, you’ll be able to generate an API key from the Settings menu. [Watch our Key Management video](https://www.youtube.com/watch?v=2t0p7LYgtkA\&list=PLJOVea6Z4X_AQIcDmeAXOcQGZalOWkLxi\&index=12) or follow the instructions below to obtain a key. <br>

### How to Generate Sola Keys

1. Sign in to the Sola Merchant Portal.
2. Select "Account Settings" from the navigation bar.
3. Select "Keys" from the sub-menu.
4. Click "Create a Key" in the top-right corner.
5. Choose the desired key type (API or iFields), description (software, etc.), and permissions.
6. Click "Create and View" and copy your key.&#x20;

{% hint style="warning" %}
It is critical to copy your key and save it in a secure location, as you won’t be able to obtain the key again.
{% endhint %}

### iFields and Transaction API

We recommend using iFields in conjunction with the Transaction API for added security. Sola iFields is an iFrames solution that keeps sensitive card data away from merchant servers while granting you complete control over form layout and design. [Click here](/products/ifields) to learn more about iFields.

The Sola iFields solution utilizes iFrames in which the user enters their credit card and/or ACH information and then uses JavaScript to generate SUTs (single-use tokens) for processing. These features allow the website to remain secure and out-of-scope for PCI compliance while allowing the developer to customize the page layout and design fully.

### Cross-Origin Resource Sharing (CORS) Restrictions <a href="#cross-origin-resource-sharing-cors-restrictions" id="cross-origin-resource-sharing-cors-restrictions"></a>

\
This API has Cross-Origin Resource Sharing (CORS) restrictions in place to enhance security. Requests made directly from a web browser client (e.g., JavaScript running in the browser) will be blocked.

**Allowed Origins**\
This API only accepts requests from server-side origins. Ensure that your requests originate from a server to successfully interact with the API.

### Endpoints <a href="#endpoints" id="endpoints"></a>

The endpoint section defines the details for accessing and interacting with the Sola transaction API.

#### Health Check <a href="#health-check" id="health-check"></a>

**Method:** Always use `GET` for health checks.\
**Protocol**: Secure communication is enforced using `https://`\
**Environment**: Specifies the targeted environment for the check, such as `x1`, `x2`, or `b1.` The primary environment is `x1`, with `x2` and `b1` available as backups.

**Domain**: The base URL is always `cardknox.com`\
**Paths:** The endpoint path for health checks is `/status`

| **Method** | **Protocol** | **Environment**                                   | **Domain**   | **Path** | **Example URL**                  |
| ---------- | ------------ | ------------------------------------------------- | ------------ | -------- | -------------------------------- |
| GET        | https        | <p>x1 (primary)<br>x2 (backup)<br>b1 (backup)</p> | cardknox.com | status   | <https://x1.cardknox.com/status> |

#### Transactions <a href="#transactions" id="transactions"></a>

**Method:** Always use `POST` for transaction requests.\
**Protocol**: Secure communication is enforced using `https://`\
**Environment**: The primary environment is `x1`, with `x2` and `b1` available as backups.\
**Domain**: The base URL is always `cardknox.com`\
**Paths/Formats**: Various paths are supported based on data format requirements:

* `/gatewayform` for form data
* `/gatewayjson` for JSON data
* `/gatewayxml` for XML data

| **Method** | **Protocol** | **Environment**                                   | **Domain**   | **Path**                                        | **Example URL**                       |
| ---------- | ------------ | ------------------------------------------------- | ------------ | ----------------------------------------------- | ------------------------------------- |
| POST       | https        | <p>x1 (primary)<br>x2 (backup)<br>b1 (backup)</p> | cardknox.com | <p>gatewayform<br>gatewayjson<br>gatewayxml</p> | <https://x1.cardknox.com/gatewayjson> |

{% hint style="info" %}
**x1** is the primary environment, with **x2** and **b1** as backups. The **x2** and **b1** environments have all resources necessary to operate independently of the other primary location.
{% endhint %}

## Transaction Types <a href="#request-method" id="request-method"></a>

The endpoints can be found in the following child pages by navigating to the appropriate page:

* [Credit Card](/api/transaction/credit-card)
* [Check (ACH)](/api/transaction/check-ach)
* [EBT](/api/transaction/ebt)
* [Gift Card](/api/transaction/gift-card)
* [Fraud](/api/transaction/fraud)

**Transactions**

| Transaction Type                                            | Transaction (Link)                                      | xCommand         |
| ----------------------------------------------------------- | ------------------------------------------------------- | ---------------- |
| [Credit Card](/api/transaction/credit-card)                 | [Sale](/api/transaction/credit-card#sale)               | cc:sale          |
|                                                             | [AuthOnly](/api/transaction/credit-card#authonly)       | cc:authonly      |
|                                                             | [Capture](/api/transaction/credit-card#capture)         | cc:capture       |
|                                                             | [Adjust](/api/transaction/credit-card#adjust)           | cc:adjust        |
|                                                             | [Save](/api/transaction/credit-card#save)               | cc:save          |
|                                                             | [AVS Only](/api/transaction/credit-card#avsonly)        | cc:avsonly       |
|                                                             | [PostAuth](/api/transaction/credit-card#postauth)       | cc:postauth      |
|                                                             | [Credit](/api/transaction/credit-card#credit)           | cc:credit        |
|                                                             | [Refund](/api/transaction/credit-card#refund)           | cc:refund        |
|                                                             | [VoidRefund](/api/transaction/credit-card#voidrefund)   | cc:voidrefund    |
|                                                             | [VoidRelease](/api/transaction/credit-card#voidrelease) | cc:voidrelease   |
|                                                             | [Void](/api/transaction/credit-card#void)               | cc:void          |
| [Check (ACH)](/api/transaction/check-ach)                   | [Sale](/api/transaction/check-ach#sale)                 | check:sale       |
|                                                             | [Credit](/api/transaction/check-ach#credit)             | check:credit     |
|                                                             | [Save](/api/transaction/check-ach#save)                 | check:save       |
|                                                             | [Void](/api/transaction/check-ach#void)                 | check:void       |
|                                                             | [Refund](/api/transaction/check-ach#refund)             | check:refund     |
| [Check (ACH-Q)](/api/transaction/check-ach#achq)            | [VoidRefund](/api/transaction/check-ach#voidrefund)     | check:voidrefund |
| [EBT Food Stamp](/api/transaction/ebt#ebt-food-stamp)       | [Sale](/api/transaction/ebt#sale)                       | ebtfs:sale       |
|                                                             | [Credit](/api/transaction/ebt#credit)                   | ebtfs:credit     |
|                                                             | [Balance](/api/transaction/ebt#balance)                 | ebtfs:balance    |
|                                                             | [Voucher](/api/transaction/ebt#voucher)                 | ebtfs:voucher    |
| [EBT Cash Benefits](/api/transaction/ebt#ebt-cash-benefits) | [Sale](/api/transaction/ebt#sale-1)                     | ebtcb:sale       |
|                                                             | [Cash](/api/transaction/ebt#cash)                       | ebtcb:cash       |
|                                                             | [Balance](/api/transaction/ebt#balance-1)               | ebtcb:balance    |
| [EBT Wic (eWic)](/api/transaction/ebt#ebt-wic-ewic)         | [Sale](/api/transaction/ebt#sale-2)                     | ebtw:sale        |
|                                                             | [Balance](/api/transaction/ebt#balance-2)               | ebtw:balance     |
|                                                             | [Void](/api/transaction/ebt#void)                       | ebtw:void        |
| [Gift Card](/api/transaction/gift-card#issue)               | [Issue](/api/transaction/gift-card#issue)               | gift:issue       |
|                                                             | [Redeem](/api/transaction/gift-card#redeem)             | gift:redeem      |
|                                                             | [Balance](/api/transaction/gift-card#balance)           | gift:balance     |
|                                                             | [Activate](/api/transaction/gift-card#activate)         | gift:activate    |
|                                                             | [Deactivate](/api/transaction/gift-card#deactivate)     | gift:deactivate  |
| [Fraud](/api/transaction/fraud)                             | [Fraud Submit](/api/transaction/fraud#fraud-submit)     | fraud:submit     |

## Questions <a href="#credit-card" id="credit-card"></a>

Can't find what you're looking for? Please contact <support@solapayments.com>.


# Credit Card

## Overview

This page contains all API documentation for Credit Card (CC) transactions. For more information regarding account access, navigate to the [Transaction API](/api/transaction) parent page.

## Transactions

### Sale

<mark style="color:green;">`POST`</mark> `cc:sale`

`xCommand` = `cc:Sale`

\
The Sale command is a combination of the authorization and capture transactions. it is intended for use when fulfilling an order right away. For transactions that are not fulfilled right away, use the [authonly](#authonly) command initially and then use the [capture](#capture) command to complete the sale.

The card to be charged can be communicated with 4 different approaches: `xCardNum` + `xExp` OR `xMagstripe` OR `xToken` OR `SUT`. Only one of these combinations can be used. Depending on the software or website’s security settings, `cc:sale` may also require `xCVV`, `xStreet`, or `xZip` and their related values.

#### Request Body

| Name                                               | Type                                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xExp<mark style="color:red;">\*</mark>             | String                                    | The card expiration number. Format: MMYY. For sandbox test transactions, use any date in the future. \*xExp is required when sending in xCardnum and cannot be used with xMagstripe.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xKey<mark style="color:red;">\*</mark>             | String                                    | Your Sola API key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xVersion<mark style="color:red;">\*</mark>         | String                                    | Gateway API Version. The current version is 5.0.0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xSoftwareName<mark style="color:red;">\*</mark>    | String                                    | Name of your software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String                                    | Version number of your software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xCommand<mark style="color:red;">\*</mark>         | String                                    | Sola transaction type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xAmount<mark style="color:red;">\*</mark>          | String                                    | The total amount of the transaction, inclusive of tax and tip if applicable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xCardNum<mark style="color:red;">\*</mark>         | String                                    | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xToken                                             | String                                    | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xCustom01                                          | String                                    | 20 custom fields are available for custom data such as customer comments, etc. Use `xCustom01` through `xCustom20`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xCVV                                               | String                                    | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xStreet                                            | String                                    | The billing street address of the cardholder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xZip                                               | String                                    | The billing zip code of the cardholder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xMagstripe                                         | String                                    | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xName                                              | String                                    | The cardholder’s name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xDUKPT                                             | String                                    | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xTax                                               | String                                    | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xTip                                               | String                                    | The tip portion that is included in the total transaction amount (xAmount).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xInvoice                                           | String                                    | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xPONum                                             | String                                    | The merchant’s purchase order number for the transaction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xComments                                          | String                                    | Additional data that is optionally passed along to the receipt.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xDescription                                       | String                                    | Additional data that is optionally passed along for reporting                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xIP                                                | String                                    | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| xEmail\*                                           | String                                    | <p>The customer’s email address<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xFax                                               | String                                    | The customer’s fax number                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xBillFirstName\*                                   | String                                    | <p>The customer’s first name for their billing profile<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xBillMiddleName                                    | String                                    | The customer’s middle name or initial for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xBillLastName\*                                    | String                                    | <p>The customer’s last/family name for their billing profile<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xBillCompany                                       | String                                    | The customer’s company name for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xBillStreet\*                                      | String                                    | <p>The customer’s street address for their billing profile<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xBillStreet2                                       | String                                    | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xBillCity\*                                        | String                                    | <p>The customer’s city for their billing profile.<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xBillState\*                                       | String                                    | <p>The customer’s state for their billing profile<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xBillZip\*                                         | String                                    | <p>The customer’s zip code for their billing profile<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| xBillCountry                                       | String                                    | The customer’s country for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xBillPhone                                         | String                                    | The customer’s phone number for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xBillMobile\*                                      | String                                    | <p>The customer’s mobile number for their billing profile<br><br>\*Required when 3ds is enabled</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xShipFirstName                                     | String                                    | The customer’s first name for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xShipMiddleName                                    | String                                    | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xShipLastName                                      | String                                    | The customer’s last/family name for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xShipCompany                                       | String                                    | The customer’s company name for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xShipStreet                                        | String                                    | The customer’s street address for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xShipStreet2                                       | String                                    | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xShipCity                                          | String                                    | The customer’s city for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| xShipState                                         | String                                    | The customer’s state for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xShipZip                                           | String                                    | The customer’s zip code for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xShipCountry                                       | String                                    | The customer’s country for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xShipPhone                                         | String                                    | The customer’s phone number for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xShipMobile                                        | String                                    | The customer’s mobile number for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| x1Description                                      | String                                    | Line Item product description. Increment the “1“ for additional items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| x1Sku                                              | String                                    | Line Item product sku. Increment the “1“ for additional items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| x1Qty                                              | String                                    | Line Item product quantity. Increment the “1“ for additional items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| x1UnitPrice                                        | String                                    | Line Item product price. Increment the “1“ for additional items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xHotelCheckInDate                                  | String                                    | The customer’s date of hotel check-in                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xHotelCheckOutDate                                 | String                                    | The customer's date of hotel check-out                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xAllowPartialAuth                                  | String                                    | True/false value indicating if an authorization amount is less than the initial request when full initial amount is unavailable. This variable is platform-dependent. Default is false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| xAllowNonAuthenticated                             | String                                    | True/False value, enabling a customer to complete a purchase without needing to verify their identity through a separate authentication step. Defaults to false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xRxAmount                                          | String                                    | Specifies qualifying prescription amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| xDentalAmount                                      | String                                    | Specifies qualifying dental amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xVisionAmount                                      | String                                    | Specifies qualifying vision amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xTransitAmount                                     | String                                    | Specifies qualifying transit amount for commuter card transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xCopayAmount                                       | String                                    | Specifies Co-pay amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xClinicalAmount                                    | String                                    | Specifies qualifying clinical amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xOrderId                                           | String                                    | Unique order number for FraudWatch verification                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xExistingCustomer                                  | String                                    | Yes/No value indicating if customer is a repeat customer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xAllowDuplicate                                    | String                                    | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xCustReceipt                                       | String                                    | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xCurrency                                          | String                                    | <p>Used to specify an alternate currency. Only applicable for accounts that are using Multi-Currency Conversion (MCC). For accounts that are natively in a foreign currency, the currency does not need to be specified (<a href="/pages/9Hnn7S07BcgCYhLvJocK">see list of all supported currencies</a>).<br></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xReturnPaymentID                                   | Boolean                                   | True/False value indicating if the user would like to receive xPaymentId in the transaction response. Unless specified, the value is “False”. Unlike an xToken which will return a new value on transactions of the same card, xPaymentId will return the same value for transactions using the same card.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xTimeoutSeconds                                    | String                                    | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xVendorId                                          | String                                    | The parameter that tells the gateway which developer is performing the transaction. If the value matches the account of the iFields key, the gateway will allow the transaction to work even though the API and iFields keys are from different accounts. See more [here](https://docs.cardknox.com/cardknox-products/ifields#global-ifields-key)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xDigitalWalletType                                 | String                                    | This field should indicate the wallet type in a case where the card number is a digital wallet token (Ex: "Google Pay")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| xRecurringIndicator\*                              | String                                    | <p>Indicates the type of transaction based on its recurrence. This field helps classify whether a transaction is part of a recurring series, an installment plan, a one-time charge, or a deferred payment.<br><br>*Required for Merchant-initiated transactions</p><p><br><strong>Note:</strong> Use of this flag on a transaction does NOT set up a recurring schedule for the transaction. Recurring schedules must be set up separately.</p><p><br>Allowed Values:</p><p><code>Recurring</code>- a transaction that is part of a regularly scheduled series (e.g., subscriptions). Usually initiated by the merchant after the first payment.<br><br><code>Installment</code>- one in a series of transactions where the total amount is divided into multiple payments with a fixed schedule (e.g., 3 monthly payments).<br><br>*<code>xInstallments</code> is required when xRecurringIndicator = <code>Installment</code><br><br><code>Single</code>- a one-time transaction, not part of a recurring or installment plan.<br><br><code>Deferred</code>- indicates that the transaction authorization was delayed and submitted later due to temporary issues like connectivity problems or offline environments.</p> |
| xInstallments                                      | Only when xRecurringIndicator=Installment | Specifies the number of payment installments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xSplitInstruction                                  | Object                                    | <p>Array of objects containing split<br>funding instructions. Each object<br>must include xMid (merchant ID)<br>and xAmount (amount to direct to<br>that merchant). The sum of all split<br>amounts must equal the total<br>transaction amount.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tabs %}
{% tab title="200: OK " %}
For a full list of response codes, see the [table](https://docs.solapayments.com/#triggers) in the Introduction page.

```json
{
"xResult":"A",
"xStatus":"Approved",
"xError":"",
"xErrorCode":"00000",
"xRefNum":"601518451",
"xInvoice":"123456",
"xExp":"1030",
"xAuthCode":"11295A",
"xBatch":"11948741",
"xAvsResultCode":"NNN",
"xAvsResult":"Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode":"M",
"xCvvResult":"Match",
"xAuthAmount":"35.00",
"xMaskedCardNumber":"4xxxxxxxxxxx1111",
"xCardType":"Visa",
"xToken":"8n21126mq0hn253p9m7964p5qn60000g",
"xMID":"xxxxxxxxxx9999",
"xTID":"xxxxx6789",
"xCurrency":"USD",
"xDate":"3/3/2022 7:36:34 AM",
"xEntryMethod":"Keyed",
"xReviewed":"N"
}
```

{% endtab %}
{% endtabs %}

{% code title="Sale - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xExp": "1030",
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:sale",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xCVV": "123",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xDUKPT": "Example",
    "xDigitalWalletType": "Google Pay",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111",
    "x1Description": "Wireless Bluetooth Speaker",
    "x1Sku": "12345",
    "x1Qty": "5",
    "x1UnitPrice": "49.99",
    "xHotelCheckInDate": "7/1/2024",
    "xHotelCheckOutDate": "7/10/2024",
    "xHotelChargeType": "Direct",
    "xHotelRoomRate": "159.99",
    "xHotelNoShow": "TRUE",
    "xAllowPartialAuth": "TRUE",
    "xAllowNonAuthenticated": "FALSE",
    "xRxAmount": "1.50",
    "xDentalAmount": "1.50",
    "xVisionAmount": "1.50",
    "xTransitAmount": "1.50",
    "xCopayAmount": "1.50",
    "xClinicalAmount": "1.50",
    "xOrderId": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE",
    "xCurrency": "USD",
    "xTimeoutSeconds": "10",
    "xVendorId": "12345",
    "xInstallments": "5",
    "xSplitInstruction": [
		{
			xAmount:1.1,
			xMid: "123"
		},
		{
			xAmount:.4,
			xMid: "456"
		}
	]
}
```

{% endcode %}

### AuthOnly

<mark style="color:green;">`POST`</mark> `cc:authonly`

`xCommand` = `cc:AuthOnly`

\
The AuthOnly command authorizes an amount on a cardholder’s account and places a hold on the available credit for that amount, but does not submit the charge for settlement. AuthOnly is used to reserve funds from a cardholder’s credit limit for a sale that is not ready to be processed. AuthOnly is commonly used when an order is placed on a website prior to the order being shipped, or when a customer makes a hotel or car rental reservation. If the authorization amount exceeds the cardholder’s available credit, a rejected response will be returned. When successful, the authorization number is returned as RefNum and can be used to reference the authorization for a follow-up transaction. The funds will remain held until the authorization is either captured, voided, or expires. To settle an AuthOnly transaction and complete the sale, use the [capture](https://kb.cardknox.com/api/#CREDIT_CARD_Capture) command. If an AuthOnly transaction is captured after 24 hours, it may be subject to a higher processing rate by the acquiring bank.

An AuthOnly hold only reduces the cardholder’s credit limit; it will not appear as a charge on their account. If the authorization will not be converted to a charge, [Void Release](https://kb.cardknox.com/api/#CREDIT_CARD_Void_Release) can be used to release the hold prior to the expiration. The expiration timeframe varies by the issuer, but is typically 7-30 days for credit cards and 3-5 days for debit cards.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xExp<mark style="color:red;">\*</mark>             | String | The card expiration number. Format: MMYY. For sandbox test transactions, use any date in the future. \*xExp is required when sending in `xCardnum` and cannot be used with `xMagstripe.`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| xCustom01                                          | String | 20 custom fields are available for custom data such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xCVV                                               | String | 3-digit code from the back of the card (4-digit code from the front of the card for Amex)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.`                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xDUKPT                                             | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xRequireSplitCapturable                            | String | Indicate if you want to ensure that the authorization will allow split capture. When this is set to true and split capture is not supported, an error will be returned “Split capture not supported“.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xComments                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xBillCompany                                       | String | The customer’s company name for their billing profile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xBillStreet                                        | String | The customer’s street address for their billing profile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xShipCountry                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xShipCountry                                       | String | The customer’s country for their shipping profile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xHotelCheckInDate                                  | String | The customer’s date of hotel check-in.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xHotelCheckOutDate                                 | String | The customer’s date of hotel check-out.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xHotelChargeType                                   | String | The charge type for the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| xHotelRoomRate                                     | String | The nightly room rate for the hotel.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| xHotelNoShow                                       | String | True/False indicating whether customer was a no-show.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xAllowPartialAuth                                  | String | True/False value indicating if an authorization amount is less than the initial request when the full initial amount is unavailable. This variable is platform-dependent. Default is false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| xAutoRentalPickupDate                              | String | <p>Specific date for customer to pick up vehicle.</p><p><strong>\*Note</strong>: This field is required only for the auto rental industry.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xAutoRentalPickupTime                              | String | <p>Specific time for customer to pick up vehicle.</p><p><strong>\*Note</strong>: This field is required only for the auto rental industry.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| xAutoRentalReturnDate                              | String | <p>Specific date for customer to return vehicle.</p><p><strong>\*Note</strong>: This field is required only for the auto rental industry.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xAutoRentalReturnTime                              | String | <p>Specific time for customer to return vehicle.</p><p><strong>\*Note</strong>: This field is required only for the auto rental industry.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xRxAmount                                          | String | <p>Specifies qualifying prescription amount for FSA transactions. <code>xAllowPartialAuth</code> must be set to True.<br></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xDentalAmount                                      | String | Specifies qualifying dental amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xVisionAmount                                      | String | Specifies qualifying vision amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xTransitAmount                                     | String | Specifies qualifying transit amount for commuter card transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xCopayAmount                                       | String | Specifies Co-pay amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| xClinicalAmount                                    | String | Specifies qualifying clinical amount for FSA transactions. `xAllowPartialAuth` must be set to True.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| xOrderId                                           | String | Unique order number for FraudWatch verification.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| xCustReceipt                                       | String | True/False value indicating if the email address specificied in `xemail` should receive a receipt containing the transaction details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xCurrency                                          | String | <p>Used to specify an alternate currency. Only applicable for accounts that are using Multi-Currency Conversion (MCC). For accounts that are natively in a foreign currency, the currency does not need to be specified. (<a href="/pages/9Hnn7S07BcgCYhLvJocK">see list of all supported currencies</a>).<br></p>                                                                                                                                                                                                                                                                                                                                                                        |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| xRecurringIndicator\*                              | String | <p><code>Recurring</code>- a transaction that is part of a regularly scheduled series (e.g., subscriptions). Usually initiated by the merchant after the first payment.<br><code>Installment</code>- one in a series of transactions where the total amount is divided into multiple payments with a fixed schedule (e.g., 3 monthly payments).<br><code>Single</code>- a one-time transaction, not part of a recurring or installment plan.<br><code>Deferred</code>- indicates that the transaction authorization was delayed and submitted later due to temporary issues like connectivity problems or offline environments.<br><br>\*Required for Merchant-initiated transactions</p> |

{% tabs %}
{% tab title="200: OK " %}
For a full list of response codes, see the [table](https://docs.solapayments.com/#triggers) in the Introduction page.

```javascript
{
"xResult":"A",
"xStatus":"Approved",
"xError":"",
"xErrorCode":"00000",
"xRefNum":"601519890",
"xInvoice":"123456",
"xExp":"1030",
"xAuthCode":"47436A",
"xAvsResultCode":"NNN",
"xAvsResult":"Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode":"M",
"xCvvResult":"Match",
"xAuthAmount":"35.00",
"xMaskedCardNumber":"4xxxxxxxxxxx1111",
"xCardType":"Visa",
"xName":"John Doe",
"xToken":"q3nq31h6n8n24623n9qg695hhgh24g61",
"xMID":"xxxxxxxxxx9999",
"xTID":"xxxxx6789",
"xCurrency":"USD",
"xDate":"3/3/2022 7:43:21 AM",
"xIsSplitCapturable":"1",
"xEntryMethod":"Keyed",
"xReviewed":"N"
}
```

{% endtab %}
{% endtabs %}

{% code title="AuthOnly - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xExp": "1030",
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:authonly",
    "xAmount": "35.00",
    "token": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xCVV": "123",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xDUKPT": "0123456789ABCDEFFEDCBA9876543210",
    "xTax": "2.00",
    "xTip": "2.00",
    "xRequireSplitCapturable": "TRUE",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111",
    "xHotelCheckInDate": "7/1/2024",
    "xHotelCheckOutDate": "7/10/2024",
    "xAllowPartialAuth": "TRUE",
    "xAutoRentalPickupDate": "2020-08-21",
    "xAutoRentalPickupTime": "11:15:00",
    "xAutoRentalReturnDate": "2020-08-21",
    "xAutoRentalReturnTime": "11:15:00",
    "xRxAmount": "1.50",
    "xDentalAmount": "1.50",
    "xVisionAmount": "1.50",
    "xTransitAmount": "1.50",
    "xCopayAmount": "1.50",
    "xClinicalAmount": "1.50",
    "xOrderId": "12356",
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE",
    "xCurrency": "USD",
    "xTimeoutSeconds": "10"
}
```

{% endcode %}

### Capture

<mark style="color:green;">`POST`</mark> `cc:capture`

`xCommand` = `cc:Capture`\
\
The Capture command is used to settle funds from a previous authorization and withdraw the funds from the cardholder’s account. The RefNumber from the associated authorization is required when submitting a Capture request. To perform an authorization and capture in the same command, use the **Sale** command.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API Version. The current version is 5.0.0                                                                                                                                                                  |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                              |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when doing a follow-up transaction, typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String). |
| xAmount                                            | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                             |
| xCustom01                                          | String | 20 custom fields are available for custom data such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                |
| xStreet                                            | String | The billing street address of the cardholder.                                                                                                                                                                      |
| xZip                                               | String | The billing zip code of the cardholder.                                                                                                                                                                            |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                           |
| xComments                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                             |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                     |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name for their billing profile                                                                                                                                                               |
| xBillLastName                                      | String | The customer’s last name for their billing profile                                                                                                                                                                 |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name for their shipping profile                                                                                                                                                              |
| xShipLastName                                      | String | The customer’s last name for their shipping profile                                                                                                                                                                |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                          |
| xCustReceipt                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details.                                                                                |

{% tabs %}
{% tab title="200: OK " %}
For a full list of response codes, see the [table](https://docs.solapayments.com/#triggers) in the Introduction page.

```javascript
{
"xResult":"E",
"xStatus":"Error",
"xError":"Invalid xRefNum",
"xErrorCode":"01463",
"xRefNum":"601523283",
"xInvoice":"123456",
"xDate":"3/3/2022 7:57:59 AM"
}
```

{% endtab %}
{% endtabs %}

{% code title="Capture - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:capture",
    "xAmount": "35.00",
    "xCustom01": "Register01",
    "xCVV": "123",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xRefNum": "81234568",
    "xName": "John Doe",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE"
}
```

{% endcode %}

### SplitCapture

<mark style="color:green;">`POST`</mark> `cc:splitcapture`

`xCommand` = `cc:splitcapture`

The SplitCapture command is used to capture funds in multiple stages from a single authorization. This is useful for scenarios where the total transaction amount is not settled all at once, such as partial shipments or staged payments. Each SplitCapture request requires the xRefNum of the authorization and allows capturing different amounts up until the authorized amount. See [split capture documentation](https://docs.solapayments.com/products/split-capture) for more information.

| **xKey**<mark style="color:red;">\*</mark>             | String | Your Sola API key                                                                                                                                                                                                  |
| ------------------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **xVersion**<mark style="color:red;">\*</mark>         | String | Gateway API Version. The current version is 5.0.0.                                                                                                                                                                 |
| **xCommand**<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                              |
| **xSoftwareName**<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                              |
| **xSoftwareVersion**<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                    |
| **xRefNum**<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when doing a follow-up transaction, typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String). |
| **xAmount**<mark style="color:red;">\*</mark>          | String | The portion of the authorized funds to capture in the current SplitCapture request.                                                                                                                                |
| **xCustom01**                                          | String | 20 custom fields are available for custom data such as customer comments, etc. Use `xCustom01` through `xCustom20`.                                                                                                |
| **xStreet**                                            | String | The billing street address of the cardholder.                                                                                                                                                                      |
| **xZip**                                               | String | The billing zip code of the cardholder.                                                                                                                                                                            |
| **xName**                                              | String | The cardholder’s name                                                                                                                                                                                              |
| **xTax**                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                         |
| **xTip**                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                         |
| **xInvoice**                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                       |
| **xPONum**                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                           |
| **xComments**                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                             |
| **xDescription**                                       | String | Additional data optionally passed along for reporting                                                                                                                                                              |
| **xIP**                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                     |
| **xEmail**                                             | String | The customer’s email address                                                                                                                                                                                       |
| **xFax**                                               | String | The customer’s fax number                                                                                                                                                                                          |
| **xBillFirstName**                                     | String | The customer’s first name for their billing profile                                                                                                                                                                |
| **xBillMiddleName**                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                    |
| **xBillLastName**                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                          |
| **xBillCompany**                                       | String | The customer’s company name for their billing profile                                                                                                                                                              |
| **xBillStreet**                                        | String | The customer’s street address for their billing profile                                                                                                                                                            |
| **xBillStreet2**                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                   |
| **xBillCity**                                          | String | The customer’s city for their billing profile                                                                                                                                                                      |
| **xBillState**                                         | String | The customer’s state for their billing profile                                                                                                                                                                     |
| **xBillZip**                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                  |
| **xBillCountry**                                       | String | The customer’s country for their billing profile                                                                                                                                                                   |
| **xBillPhone**                                         | String | The customer’s phone number for their billing profile                                                                                                                                                              |
| **xBillMobile**                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                             |
| **xShipFirstName**                                     | String | The customer’s first name for their shipping profile                                                                                                                                                               |
| **xShipMiddleName**                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                   |
| **xShipLastName**                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                         |
| **xShipCompany**                                       | String | The customer’s company name for their shipping profile                                                                                                                                                             |
| **xShipStreet**                                        | String | The customer’s street address for their shipping profile                                                                                                                                                           |
| **xShipStreet2**                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                  |
| **xShipCity**                                          | String | The customer’s city for their shipping profile                                                                                                                                                                     |
| **xShipState**                                         | String | The customer’s state for their shipping profile                                                                                                                                                                    |
| **xShipZip**                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                 |
| **xShipCountry**                                       | String | The customer’s country for their shipping profile                                                                                                                                                                  |
| **xShipPhone**                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                             |
| **xShipMobile**                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                            |
| **xAllowDuplicate**                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                          |
| **xCustReceipt**                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details.                                                                                |

{% code title="Capture - Response Payload" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:splitcapture",
    "xRefNum": "81234568",
    "xAmount": "9.99",
    "xCustom01": "Register01",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xName": "John Doe",
    "xTax": ".05",
    "xTip": ".05",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE"
}
```

{% endcode %}

{% code title="SplitCapture - Response Payload" %}

```json
{
"xResult":"A",
"xStatus":"Approved",
"xError":"",
"xErrorCode":"00000",
"xRefNum":"10230508134",
"xInvoice":"123456",
"xExp":"1030",
"xAuthCode":"74119A",
"xBatch":"5128394",
"xAvsResultCode":"NNN",
"xAvsResult":"Address:No Match & 5 Digit Zip: No Match",
"xCvvResultCode":"",
"xCvvResult":"No CVV data available",
"xAuthAmount":"10.00",
"xMaskedCardNumber":"4xxxxxxxxxxx1111",
"xCardType":"Visa",
"xToken":"h0n6m0gn70m99598hp282802h60q2911",
"xMID":"xxxxxxxxxx9999",
"xTID":"xxxxx6789",
"xCurrency":"USD",
"xDate":"1/29/2025 10:58:54 AM",
"xEntryMethod":"Unknown"
}
```

{% endcode %}

### Adjust

<mark style="color:green;">`POST`</mark> `cc:adjust`

`xCommand` = `cc:Adjust`

The Adjust command updates specific fields on an existing transaction.\
It can be used to:

* Update transaction details (such as xInvoice, xName or custom fields) before the transaction is captured, when the original transaction was either a cc:sale or a cc:authonly.
* Modify the authorized amount (xAmount) before the transaction is captured, when the original transaction was a cc:authonly. These situations occur when the final transaction amount is not known at the time of authorization and must be increased prior to settlement.
* Common Use Cases:
  * **Restaurant**: $85 → $105 (tip added)
  * **Hotel**: $500 → $575 (incidental charges)
  * **Grocery Delivery**: $120 → $134 (weighted items)
  * **Car Rental**: $1,050 (rental extension)
  * **Fuel Station**: $100 → $128 (final pump total)

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API Version. The current version is 5.0.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xAmount<mark style="color:red;">\*</mark>          | String | <p>The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.<br><br>If the amount in the <code>cc:Adjust</code> transaction differs from the original authorization amount, the request should include <code>"xIncremental": "true"</code>.<br>If <code>xIncremental</code> is not set to <code>true</code> when adjusting to a different amount, the transaction may be treated as a forced transaction, which could increase chargeback risk and liability.</p> |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when doing a follow-up transaction; typically a refund, void, or capture. (**Note**: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String).                                                                                                                                                                                                                                                                                                         |
| Custom01                                           | String | Custom fields available for custom data such as customer comments, etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Custom02                                           | String | Custom fields available for custom data such as customer comments, etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Custom03                                           | String | Custom fields available for custom data such as customer comments, etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xOrderId                                           | String | Unique Order Number for FraudWatch verification                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| xSignature                                         | String | The Base 64 encoded customer signature                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling                                                                                                                                                                                                                                                                                                                                                                                                    |
| xIncremental                                       | String | Incremental authorizations enable increase the authorized amount on a captured transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                    |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016879",
"xInvoice": "1234567",
"xRefNumCurrent": "10000016886",
"xDate": "7/11/2022 4:06:11 PM"
}
```

{% endtab %}
{% endtabs %}

{% code title="Adjust - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:adjust",
    "xAmount": "35.00",
    "xCustom01": "Register01",
    "xCustom02": "Register01",
    "xCustom03": "Register01",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xRefNum": "81234568",
    "xName": "John Doe",
    "xDescription": "This is a description",
    "OrderID": "123456",
    "xTip": "1.05",
    "xTax": "1.05",
    "xSignature": "aGVsbG8gaG93IGFyZSB5b3UK",
    "xInvoice": "123456A",
    "xIncremental": "TRUE"
}
```

{% endcode %}

### Save

<mark style="color:green;">`POST`</mark> `cc:save`

`xCommand` = `cc:Save`\
The Save command is used to send account information and to request a token from Sola. It does not submit the transaction for processing. The response returns a token that references the account information. A token at minimum references the credit card number, but if other data is sent—such as a billing address—it will be associated with the token as well.

**AvsOnly**\
When **AvsOnly** is enabled for `cc:Save`, in addition to just generating a token, the transaction will be submitted to the bank for AVS and CVV verification. This setting can be turned on in the Sola backend settings.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                            |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                 |
| xExp<mark style="color:red;">\*</mark>             | String | The card expiration number. Format: MMYY. For sandbox test transactions, use any date in the future. \*xExp is required when sending in `xCardnum` and cannot be used with `xMagstripe`                                                |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                     |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                     |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                  |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                  |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                        |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                   |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                           |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                 |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.` |
| xName                                              | String | The cardholder’s name.                                                                                                                                                                                                                 |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                         |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card)                                                                                                                                             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016898",
"xExp": "1030",
"xDate": "7/11/2022 4:15:15 PM",
"xToken": "38gn292893h0nq72m0qn69892q9mg56g",
"xMaskedCardNumber": "4xxxxxxxxxxx1111",
"xCardType": "Visa"
}
```

{% endtab %}
{% endtabs %}

{% code title="Save - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xExp": "1249",
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:save",
    "xCustom01": "Register01",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xIP": "1.1.1.1"
}
```

{% endcode %}

### AvsOnly ($0 Auth)

<mark style="color:green;">`POST`</mark> `cc:avsonly`

`xCommand` = `cc:AvsOnly`\
\
An AVS Only transaction allows you to verify the accuracy of a customer's billing address without processing the payment. This type of transaction is useful for validating the authenticity of the billing address before completing a purchase. It can also be use to verify the card CVV

To perform an AVS Only transaction, you need to send the customer's billing address details along with the request. The bank will then compare the provided address against the billing address on file with the card issuer and return a response indicating whether the address matches or not.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                            |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                     |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                                      |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                  |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                        |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                  |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                 |
| xExp<mark style="color:red;">\*</mark>             | String | The card expiration number. Format: MMYY. For sandbox test transactions, use any date in the future. \*xExp is required when sending in `xCardnum` and cannot be used with `xMagstripe`                                                |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                   |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card).                                                                                                                                            |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                           |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                 |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.` |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                  |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                         |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card)                                                                                                                                             |

### Credit

<mark style="color:green;">`POST`</mark> `cc:credit`

`xCommand` = `cc:Credit`

To issue a credit (refund) through our API without referring to a previous sale, you can use the following command: `cc:credit`

\
Please note that our system blocks credits on cards that do not have a prior sale by default. To allow such credits to go through, you must send a request to <gatewaysupport@solapayments.com>.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                                                                                             |
| xExp<mark style="color:red;">\*</mark>             | String | The card expiration number. Format: MMYY. For sandbox test transactions, use any date in the future. \*xExp is required when sending in xCardnum and cannot be used with xMagstripe.                                                                                                                               |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                                                                                             |
| xCustom01<mark style="color:red;">\*</mark>        | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                                                                                               |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                                                                                        |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card)                                                                                                                                                                                                                         |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                                                                                                       |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                                                                                             |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe`                                                                              |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                                                                                              |
| xDUKPT                                             | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter.                                                                 |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                                                                                           |
| xComments                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                                                                                                                             |
| xDescription                                       | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                                                                                      |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                                                                                     |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                                                                                            |
| xOrderId                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                                                                                       |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                                                                                          |
| xCustReceipt                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details.                                                                                                                                                                                |
| xCurrency                                          | String | <p>Used to specify an alternate currency. Only applicable for accounts that are using Multi-Currency Conversion (MCC). For accounts that are natively in a foreign currency, the currency does not need to be specified. (<a href="/pages/9Hnn7S07BcgCYhLvJocK">see list of all supported currencies</a>).<br></p> |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016908",
"xInvoice": "123456",
"xExp": "1030",
"xAuthCode": "78685A",
"xBatch": "14594556",
"xAvsResultCode": "NNN",
"xAvsResult": "Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode": "M",
"xCvvResult": "Match",
"xAuthAmount": "35.00",
"xMaskedCardNumber": "4xxxxxxxxxxx1111",
"xCardType": "Visa",
"xToken": "n701mmg5qm3969673q92hm0p652h2n9g",
"xMID": "xxxxxxxxxx9999",
"xTID": "xxxxx6789",
"xCurrency": "USD",
"xDate": "7/11/2022 4:21:17 PM",
"xEntryMethod": "Keyed"
}
```

{% endtab %}
{% endtabs %}

{% code title="Credit - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xExp": "1030",
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:credit",
    "xAmount": "35.00",
    "token": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xCVV": "123",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xDUKPT": "0123456789ABCDEFFEDCBA9876543210",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xAllowPartialAuth": "TRUE",
    "xRxAmount": "1.50",
    "xDentalAmount": "1.50",
    "xVisionAmount": "1.50",
    "xTransitAmount": "1.50",
    "xCopayAmount": "1.50",
    "xClinicalAmount": "1.50",
    "xOrderId": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE",
    "xCurrency": "USD",
    "xTimeoutSeconds": "10"
}
```

{% endcode %}

### Refund

<mark style="color:green;">`POST`</mark> `cc:refund`

`xCommand` = `cc:Refund`\
\
The Refund command is used to refund a full or partial amount of a previous transaction using `xRefNum`. Partial check refunds are only supported for ACHQ.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                      |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                               |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                               |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                            |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                  |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                            |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction; typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String).                          |
| xAmount                                            | String | Refund amount. Can be equal or less than the original transaction.                                                                                                                                                                               |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                        |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                            |
| xCustReceipt                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details                                                                                                               |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                    |
| xSplitInstruction                                  | Object | <p>Array of objects containing split funding instructions for the refund.<br>Each object must include xMid (merchant ID) and xAmount (amount to refund from that merchant). The sum of all split amounts must equal the total refund amount.</p> |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016913",
"xInvoice": "123456",
"xExp": "1030",
"xAuthCode": "41174A",
"xBatch": "14594556",
"xAvsResultCode": "NNN",
"xAvsResult": "Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode": "N",
"xCvvResult": "No Match",
"xAuthAmount": "35.00",
"xMaskedCardNumber": "4xxxxxxxxxxx1111",
"xCardType": "Visa",
"xMID": "xxxxxxxxxx9999",
"xTID": "xxxxx6789",
"xCurrency": "USD",
"xDate": "7/11/2022 4:27:32 PM",
"xEntryMethod": "Unknown"
}


```

{% endtab %}
{% endtabs %}

{% code title="Refund - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:refund",
    "xAmount": "35.00",
    "xRefNum": "93827163", 
    "xDescription": "This is a description",
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "FALSE",
    "xCurrency": "USD",
    "xTimeoutSeconds": "10",
    "xSplitInstruction": [
		{
			xAmount:1.1,
			xMid: "123"
		},
		{
			xAmount:.4,
			xMid: "456"
		}
	]
}
```

{% endcode %}

### VoidRefund

<mark style="color:green;">`POST`</mark> `cc:voidrefund`

`xCommand` = `cc:voidrefund`<br>

The VoidRefund command will either void the pending transaction if it has not settled yet, or it will fully refund the transaction if it has already settled.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                             |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                      |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                       |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                   |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                         |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                   |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction; typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String). |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                    |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016915",
"xInvoice": "123456",
"xRefNumCurrent": "10000016916",
"xExp": "1030",
"xAvsResultCode": "NNN",
"xAvsResult": "Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode": "N",
"xCvvResult": "No Match",
"xAuthAmount": "35.00",
"xMaskedCardNumber": "4xxxxxxxxxxx1111",
"xCardType": "Visa",
"xToken": "h9n16qg990p99157640h6m823942934p",
"xMID": "xxxxxxxxxx9999",
"xTID": "xxxxx6789",
"xCurrency": "USD",
"xDate": "7/11/2022 4:30:38 PM",
"xEntryMethod": "Unknown"
}
```

{% endtab %}
{% endtabs %}

{% code title="VoidRefund - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:voidrefund",
    "xCustom01": "Register01",
    "xRefNum": "93827163"
}
```

{% endcode %}

### VoidRelease

<mark style="color:green;">`POST`</mark> `cc:voidrelease`

`xCommand` = `cc:voidrelease`\
\
The VoidRelease command releases a pending authorization amount back to the cardholder’s credit limit without waiting for the standard authorization time frame to expire.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                             |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                      |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                       |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                   |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                         |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                   |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction, typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String). |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                    |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016917",
"xInvoice": "123456",
"xRefNumCurrent": "10000016919",
"xExp": "1030",
"xAvsResultCode": "NNN",
"xAvsResult": "Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode": "N",
"xCvvResult": "No Match",
"xAuthAmount": "35.00",
"xMaskedCardNumber": "4xxxxxxxxxxx1111",
"xCardType": "Visa",
"xMID": "xxxxxxxxxx9999",
"xTID": "xxxxx6789",
"xCurrency": "USD",
"xDate": "7/11/2022 4:33:02 PM",
"xEntryMethod": "Unknown"
}


```

{% endtab %}
{% endtabs %}

{% code title="VoidRelease - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:voidrelease",
    "xCustom01": "Register01",
    "xRefNum": "93827163"
}
```

{% endcode %}

### Void

<mark style="color:green;">`POST`</mark> `cc:void`

`xCommand` = `cc:Void`\
\
The Void command voids a transaction that has not yet settled using `xRefNum`.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                             |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                      |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                       |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                   |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                         |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                   |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction; typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String). |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                    |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016875",
"xInvoice": "123456",
"xRefNumCurrent": "10000016882",
"xExp": "1030",
"xAvsResultCode": "NNN",
"xAvsResult": "Address: No Match & 5 Digit Zip: No Match",
"xCvvResultCode": "N",
"xCvvResult": "No Match",
"xAuthAmount": "35.00",
"xMaskedCardNumber": "4xxxxxxxxxxx1111",
"xCardType": "Visa",
"xMID": "xxxxxxxxxx9999",
"xTID": "xxxxx6789",
"xCurrency": "USD",
"xDate": "7/11/2022 4:03:04 PM",
"xEntryMethod": "Unknown"
}
```

{% endtab %}
{% endtabs %}

{% code title="Void - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "5.0.0f",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:void",
    "xCustom01": "Register01",
    "xRefNum": "93827163"
}
```

{% endcode %}


# Check (ACH)

## Overview

This page contains all API documentation for Check (ACH), and ACH-Q transactions. For more information regarding account access, navigate to the [Transaction API](/api/transaction) parent page.&#x20;

## Transactions

Sola provides ACH and ACHQ processing for the transactions listed below (with exception of VoidRefund, which there is only ACHQ processing for). For more information regarding ACHQ, refer to the ACHQ [Developer Page](https://achq.com/developers/) or contact Sola support.

{% hint style="warning" %}
**Note:** The use of check/ACH transactions requires compliance with Nacha regulations, including the requirement to capture a physical or electronic signature from the customer. Please ensure your integration meets these compliance standards.
{% endhint %}

### Sale

<mark style="color:green;">`POST`</mark> `check:sale`

`xCommand` = `check:Sale`\
\
The Check Sale command debits funds from a customer’s checking or savings account using one of the following options:

The merchant must have a supported Check/ACH processing account to use either of these options.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                                                                     |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                                                              |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                                                                                               |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                                                                           |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                                                                 |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                                                                           |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable.                                                                                                                                                                                                                    |
| xRouting<mark style="color:red;">\*</mark>         | String | The check ABA routing number                                                                                                                                                                                                                                                                    |
| xAccount<mark style="color:red;">\*</mark>         | String | The check account number                                                                                                                                                                                                                                                                        |
| xName<mark style="color:red;">\*</mark>            | String | Name on account                                                                                                                                                                                                                                                                                 |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                                                                     |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                                                                            |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                      |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                      |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                                                                    |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                                                                        |
| xComments                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                                                                                                          |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                                                                           |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection                                                                                                                                                                                                                                   |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                                                                    |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                                                                       |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                                                             |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                                                                 |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                                                                       |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                                                                           |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                                                                         |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                                                                |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                                                                   |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                                                                  |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                                                               |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                                                                |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                                                                           |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                                                                            |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                                                                |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                                                                      |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                                                                          |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                                                                        |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                                                               |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                                                                  |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                                                                 |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                                                              |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                                                               |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                                                                          |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                                                                         |
| xMICR                                              | String | The routing, account and check number data from the bottom of a check in MICR (Magnetic Ink Character Recognition) format, typically generated by a check scanner                                                                                                                               |
| xCheckNum                                          | String | The check number                                                                                                                                                                                                                                                                                |
| xCheckImageFront                                   | String | The front image of the check, in Base 64 encoded image format.                                                                                                                                                                                                                                  |
| xCheckImageRear                                    | String | The back image of the check, in Base 64 encoded image format.                                                                                                                                                                                                                                   |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                                                                 |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                                                                    |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                                                                       |
| xCustReceipt                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details                                                                                                                                                              |
| xCurrency                                          | String | Used to specify an alternate currency. Only applicable for accounts that are using Multi-Currency Conversion (MCC). For accounts that are natively in a foreign currency, the currency does not need to be specified. ([see list of all supported currencies](/articles/supported-currencies)). |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                                                                          |
| xAccountType                                       | String | Type of account: Checking or Savings                                                                                                                                                                                                                                                            |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                                                                   |
| xPaymentOrigin                                     | String | <p>Origin of payment. </p><p></p><p>Possible values: </p><ul><li>"Internet" (denoting web transactions)</li><li>"SignatureOriginal" (denoting transactions with physical signature)</li></ul>                                                                                                   |

{% code title="Sale - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "check:sale",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xRouting": "123456789",
    "xAccount": "123456789",
    "xAccountType": "Checking",
    "xName": "John Doe",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xMICR": "t021000021t 123456789o _2542",
    "xCheckNum": "999",
    "xCheckImageFront": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHCAgICAgICAgICD/2wBDAQcHBw0MDRgQEBgaFREVGiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICD/w",
    "xCheckImageRear": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHCAgICAgICAgICD/2wBDAQcHBw0MDRgQEBgaFREVGiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICD/w",
    "xOrderID": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE",
    "xCurrency": "USD",
    "xTimeoutSeconds": "10",
    "xPaymentOrigin": "Internet"
}
```

{% endcode %}

### Save

<mark style="color:green;">`POST`</mark> `check:save`

`xCommand` = `check:Save`\
\
The Save command is used to send account information and request a token from Sola but does not submit the transaction for processing. The response returns a token that references the account information. A token at minimum references the account and routing number, but if other data is sent—such as billing address—that will be associated with the token as well.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                        |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                              |
| xRouting<mark style="color:red;">\*</mark>         | String | The check ABA routing number                                                                                                                                       |
| xName<mark style="color:red;">\*</mark>            | String | The cardholder’s name                                                                                                                                              |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                    |
| xAccount<mark style="color:red;">\*</mark>         | String | The check account number                                                                                                                                           |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                  |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                 |
| xCustom01                                          | String | <p>20 custom fields are available for custom data, such as customer comments, etc. Use <code>xCustom01</code> through <code>xCustom20.</code><br></p>              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                     |
| xMICR                                              | String | The routing, account, and check number data from the bottom of a check in MICR (Magnetic Ink Character Recognition) format, typically generated by a check scanner |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.          |

{% code title="Save - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "check.save",
    "xCustom01": "Register01",
    "xRouting": "123456789",
    "xAccount": "123456789",
    "xName": "John Doe",
    "xIP": "1.2.3.4",
    "xMICR": "t021000021t 123456789o _2542",
    "xAllowDuplicate": "TRUE"
}
```

{% endcode %}

### Adjust

<mark style="color:green;">`POST`</mark> `check:adjust`

You can use the Adjust command to update certain fields on a transaction, such as `xOrderID`. This action will not reprocess the transaction; it will only update the information. Any non-required field can be adjusted.

#### Request Body

| **xKey**<mark style="color:red;">\*</mark>             | String | Your Sola API key                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **xVersion**<mark style="color:red;">\*</mark>         | String | Gateway API Version. The current version is 5.0.0.                                                                                                                                                                                                                                                                                              |
| **xCommand**<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                                                                                                                           |
| **xSoftwareName**<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                                                                                                                           |
| **xSoftwareVersion**<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                                                                                                                 |
| **xAmount**<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                                                                                                                          |
| **xRefNum**<mark style="color:red;">\*</mark>          | String | <p>Used to reference a previous transaction when doing a follow-up transaction; typically a refund, void, or capture. (<strong>Note</strong>: xRefnum can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String).<br><br>\*The xRefNum from the related authorization is required when submitting an Adjust transaction.</p> |
| **xCustom01 – xCustom03**                              | String | Custom fields available for custom data, such as customer comments, etc.                                                                                                                                                                                                                                                                        |
| **xStreet**                                            | String | The billing street address of the cardholder                                                                                                                                                                                                                                                                                                    |
| **xZip**                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                                                                                                                          |
| **xName**                                              | String | The cardholder’s name                                                                                                                                                                                                                                                                                                                           |
| **xDescription**                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                                                                                                                           |
| **xOrderID**                                           | String | Unique Order Number for FraudWatch verification                                                                                                                                                                                                                                                                                                 |
| **xTip**                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                      |
| **xTax**                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                                                                                                                      |
| **xSignature**                                         | String | The Base 64 encoded customer signature                                                                                                                                                                                                                                                                                                          |
| **xInvoice**                                           | String | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling                                                                                                                                                                                                                       |

{% code title="Adjust - Request Payload" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:adjust",
    "xAmount": "35.00",
    "xCustom01": "Register01",
    "xCustom02": "Register01",
    "xCustom03": "Register01",
    "xStreet": "123 Main Street",
    "xZip": "12345",
    "xRefNum": "81234568",
    "xName": "John Doe",
    "xDescription": "This is a description",
    "OrderID": "123456",
    "xTip": "1.05",
    "xTax": "1.05",
    "xSignature": "aGVsbG8gaG93IGFyZSB5b3UK",
    "xInvoice": "123456A"
}
```

{% endcode %}

{% code title="200 - Response" %}

```json
{
"xResult": "A",
"xStatus": "Approved",
"xError": "",
"xErrorCode": "00000",
"xRefNum": "10000016879",
"xInvoice": "1234567",
"xRefNumCurrent": "10000016886",
"xDate": "7/11/2022 4:06:11 PM"
}
```

{% endcode %}

### Void

<mark style="color:green;">`POST`</mark> `check:void`

`xCommand` = `check:Void`\
\
The Void command voids a check transaction that is pending being sent to the bank, typically at the end of each day.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                             |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                      |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                       |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                   |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                         |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                   |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction; typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String). |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                    |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                          |

{% code title="Void - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "check.void",
    "xCustom01": "Register01",
    "xRefNum": "81726356",
    "xIP": "1.1.1.1"
}
```

{% endcode %}

### Refund

<mark style="color:green;">`POST`</mark> `check:refund`

`xCommand` = `check:Refund`\
\
The Refund command is used to refund the full amount of a previously settled check transaction, using `xRefNum`. Partial check refund isn’t supported.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                            |
| -------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                     |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                                                                      |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                  |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                        |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                  |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction; typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String) |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                 |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                   |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                         |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                              |
| xCustReceipt                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details.                                                                                    |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                          |

{% code title="Refund - Request Payload Example" %}

```json
{
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "check.refund",
    "xAmount": "9.99",
    "xCustom01": "Register01",
    "xRefNum": "81726356",
    "xIP": "1.1.1.1",
    "xAllowDuplicate": "TRUE",
    "xCustReceipt": "FALSE",
    "xTimeoutSeconds": "10"
}
```

{% endcode %}

### VoidRefund

<mark style="color:green;">`POST`</mark> `check:VoidRefund`

`xCommand` = `check:VoidRefund`\
\
The VoidRefund within the ACHQ tooling is used void a check transaction that is pending being sent to the bank, typically at the end of each day. It also issues a refund. Partial refunds are also supported.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                        |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                              |
| xRouting<mark style="color:red;">\*</mark>         | String | The check ABA routing number                                                                                                                                       |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                    |
| xAccount<mark style="color:red;">\*</mark>         | String | The check account number                                                                                                                                           |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0                                                                                                                  |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                 |
| xBillState<mark style="color:red;">\*</mark>       | String | Company Billing State                                                                                                                                              |
| xBillCity<mark style="color:red;">\*</mark>        | String | Company Billing City                                                                                                                                               |
| xBillStreet<mark style="color:red;">\*</mark>      | String | Company Street Address                                                                                                                                             |
| xBillCompany<mark style="color:red;">\*</mark>     | String | Required if xCheckType = Business                                                                                                                                  |
| xBillZip<mark style="color:red;">\*</mark>         | String | Company Billing Zip                                                                                                                                                |
| xBillPhone<mark style="color:red;">\*</mark>       | String | Company Phone Number                                                                                                                                               |
| xEmail<mark style="color:red;">\*</mark>           | String | Company Email                                                                                                                                                      |
| xCheckType<mark style="color:red;">\*</mark>       | String | Check Type (Business, Personal)                                                                                                                                    |
| xName                                              | String | The cardholder’s name. One of xName, xBillFirstName, or xBillLastName are required.                                                                                |
| xCustom01                                          | String | <p>20 custom fields are available for custom data, such as customer comments, etc. Use <code>xCustom01</code> through <code>xCustom20.</code><br></p>              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                     |
| xMICR                                              | String | The routing, account, and check number data from the bottom of a check in MICR (Magnetic Ink Character Recognition) format, typically generated by a check scanner |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.          |

### Check (ACH) FAQ

#### **Q: How many days does it take to get the ACH status?**

A: It typically takes 2-3 days.

#### **Q: How can I get the ACH status?**

A: There are a few ways to get the status. Via email, webhook, the Sola Portal, or by pulling a report using our reporting API.

#### **Q: What verbiage comes back from the ACH Status?**

A: You should get back the following status codes (`xStatus`) from Sola:

* 0 (Pending)
* 20 (Rejected)
* 5 (Cancelled)
* 6 (Awaiting Response)
* 14 (Chargeback)
* 16 (Settled)
* 18 (Returned)
* 19 (Hold)

The daily emails may contain more information.

#### **Q: Can we get back a token when using the check MICR?**

A: Sola only returns tokens on check transactions that contain the routing and account number. In the event only check images and MICR were submitted, the token is not returned since it can’t be reused on subsequent transactions.


# EBT

## Overview

This page contains all API documentation for Electronic Benefit Transfer (EBT) transactions. For more information regarding account access, navigate to the [Transaction API](/api/transaction) parent page.

{% hint style="info" %}
The transactions below are not valid for EBT Online. To reference EBT Online, navigate to this [page](https://docs.solapayments.com/products/ebt-online).&#x20;
{% endhint %}

{% hint style="info" %}
EBT transactions below are available through the [SDK](/sdk/payment-engine-sdk) and Browser-Based POS systems ([BBPOS](/products/bbpos)). EBT Wic is only available through the SDK.
{% endhint %}

## Transactions

## EBT Food Stamp

### Sale

<mark style="color:green;">`POST`</mark> `ebtfs:sale`

`xCommand` = `ebtfs:sale`<br>

The Sale command is used to make a purchase on an EBT cardholder’s food stamp account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable.                                                                                                                                                                       |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                        |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe`              |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling                                                                                                                        |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                                                             |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection                                                                                                                                                                                      |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xCustReceipt                                       | String | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details                                                                                                                 |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |

```json
{
    "xCardNum": "4444333322221111",
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "ebtfs:sale",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE", 
    "xCustReceipt": "TRUE"
}
```

### Credit

<mark style="color:green;">`POST`</mark> `ebtfs:credit`

`xCommand` = `ebtfs:credit`\
\
The Credit command is used to credit an EBT cardholder’s food stamp account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                        |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted Card data can also be sent using `xMagstripe.`             |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data optionally passed along to the receipt                                                                                                                                                                                             |
| xDescription                                       | String | Additional data optionally passed along for reporting                                                                                                                                                                                              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection                                                                                                                                                                                      |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |

{% code title="Credit - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "ebtfs:credit",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE"
}
```

{% endcode %}

### Balance

<mark style="color:green;">`POST`</mark> `ebtfs:balance`

`xCommand` = `ebtfs:Balance`

The Balance command is used to check the balance on an EBT cash benefit account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.`             |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |

{% code title="Balance - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "ebtfs:balance",
    "xDUKPT": "3748276384717382:2dh2298h28dhf982f298g",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xIP": "1.1.1.1"
}
```

{% endcode %}

### Voucher

<mark style="color:green;">`POST`</mark> `ebtfs:voucher`

`xCommand` = `ebtfs:voucher`\
\
The Voucher command is used to process a manual EBT food stamp voucher.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | <p></p><p>The customer card number. \*Alternatively, <code>xToken</code> <code>xMagStripe</code> or <code>SUT</code> can be used.</p>                                                                                                              |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN Pad serial number and transaction counter. |
| xVoucherApproval<mark style="color:red;">\*</mark> | String | The EBT voucher approval code                                                                                                                                                                                                                      |
| xVoucherSerial<mark style="color:red;">\*</mark>   | String | The EBT voucher serial number                                                                                                                                                                                                                      |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                        |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted Card data can also be sent using `xMagstripe.`             |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data that is optionally passed along to the receipt                                                                                                                                                                                     |
| xDescription                                       | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                      |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |

{% code title="Voucher - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "ebtfs:voucher",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xVoucherApproval": "123df1248f",
    "xVoucherSerial": "123",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE"
}
```

{% endcode %}

## EBT Cash Benefits

### Sale

<mark style="color:green;">`POST`</mark> `ebtcb:sale`

`xCommand` = `ebtcb:sale`\
\
The Sale command is used to make a purchase on an EBT cardholder’s cash benefit account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                        |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted Card data can also be sent using `xMagstripe.`             |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount).                                                                                                                                                                        |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling                                                                                                                        |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data that is optionally passed along to the receipt                                                                                                                                                                                     |
| xDescription                                       | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                      |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s Country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |

{% code title="Sale - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "ebtcb:sale"
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?",
    "xName": "John Doe",
    "xTax": "2.00",
    "xTip": "2.00",
    "xInvoice": "123456A",
    "xPONum": "123456B",
    "xComments": "This is a comment",
    "xDescription": "This is a description",
    "xIP": "1.2.3.4",
    "xEmail": "text@example.com",
    "xFax": "1234567890",
    "xBillFirstName": "John",
    "xBillMiddleName": "Max",
    "xBillLastName": "Doe",
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356",
    "xExistingCustomer": "TRUE",
    "xAllowDuplicate": "TRUE"
}
```

{% endcode %}

### Cash

<mark style="color:green;">`POST`</mark> `ebtcb:cash`

`xCommand` = `ebtcb:Cash`\
\
The Cash command enables a cash withdrawal from an EBT cardholder’s cash benefit account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| xCommand                                           | String | Sola transaction type                                                                                                                                                                                                                              |
| xDUKPT                                             | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted Card data can also be sent using `xMagstripe.`             |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                        |
| xCustom01                                          | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                       |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |

{% code title="Cash - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "ebtcb:cash",
    "xAmount": "35.00", 
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",
    "xCustom01": "Register01",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xName": "John Doe", 
    "xInvoice": "123456A", 
    "xIP": "1.2.3.4", 
    "xAllowDuplicate": "TRUE" 
}
```

{% endcode %}

### Balance

<mark style="color:green;">`POST`</mark> `ebtcb:balance`

`xCommand` = `ebtcb:Balance`

The Balance command is used to check the balance on an EBT cash benefit account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.`             |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |

{% code title="Balance - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "ebtcb:balance",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",   
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xIP": "1.2.3.4" 
}
```

{% endcode %}

## EBT Wic (eWic) <a href="#ebt-wic-ewic" id="ebt-wic-ewic"></a>

{% hint style="info" %}
EBT Wic Transactions are only available through the [SDK](/sdk/payment-engine-sdk).&#x20;
{% endhint %}

### Sale

<mark style="color:green;">`POST`</mark> `ebtw:sale`

`xCommand` = `ebtw:sale`\
\
The Sale command is used to make a purchase on an EBTW cardholder’s cash benefit account.

#### Request Body

| Name                                                | Type   | Description                                                                                                                                                                                                                                        |
| --------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>          | String | The customer card number. \*Alternatively, xToken, xMagStripe or `SUT` can be used.                                                                                                                                                                |
| xKey<mark style="color:red;">\*</mark>              | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>          | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>     | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark>  | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>          | String | Sola transaction type                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>           | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| x1UnitPrice<mark style="color:red;">\*</mark>       | String | Unit price for item specified in xUPC. Additional items can be specified by incrementing (i.e., x2UnitPrice, x3UnitPrice, etc.).                                                                                                                   |
| x1Qty<mark style="color:red;">\*</mark>             | String | Quantity of item specified in xUPC. Additional items can be specified by incrementing (i.e., x2Qty, x3Qty, etc.).                                                                                                                                  |
| x1Upc<mark style="color:red;">\*</mark>             | String | Universal Product Code. Additional items can be specified by incrementing (i.e., x2Upc, x3Upc, etc.).                                                                                                                                              |
| xDUKPT<mark style="color:red;">\*</mark>            | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xAllowPartialAuth<mark style="color:red;">\*</mark> | String | Allows for partial authorization. Must be set to "TRUE".                                                                                                                                                                                           |
| xToken                                              | String | The Sola token that references a previously used payment method. When using a token, xCardNum and xMagstripe should not be used.                                                                                                                   |
| xCustom01                                           | String | 20 custom fields are available for custom data, such as customer comments, etc. Use xCustom01 through xCustom20.                                                                                                                                   |
| xMagstripe                                          | String | The magstripe data of an eWIC card. When using xMagstripe, xCardNum and xToken should not be used. Encrypted card data can also be sent using xMagstripe.                                                                                          |
| xName                                               | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                                | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                                | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                            | String | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling.                                                                                                                         |
| xPONum                                              | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                           | String | Additional data that is optionally passed along to the receipt                                                                                                                                                                                     |
| xDescription                                        | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                      |
| xIP                                                 | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |
| xEmail                                              | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                                | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                      | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                     | String | The customer’s middle name for their billing profile                                                                                                                                                                                               |
| xBillLastName                                       | String | The customer’s last name for their billing profile                                                                                                                                                                                                 |
| xBillCompany                                        | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                         | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                        | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                           | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                          | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                            | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                        | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                          | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                         | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                      | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                     | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                       | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                        | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                         | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                        | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                           | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                          | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                            | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                        | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                          | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                         | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xOrderID                                            | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                   | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |
| xAllowDuplicate                                     | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |

{% code title="Sale - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "ebtw:sale" 
    "xAmount": "35.00", 
    "x1UnitPrice": "3.50", 
    "x1Qty": "10", 
    "1Upc": "075457026002", 
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84",  
    "xCustom01": "Register01", 
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xAllowPartialAuth": "TRUE",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xName": "John Doe", 
    "xTax": "2.00", 
    "xTip": "2.00", 
    "xInvoice": "123456A", 
    "xPONum": "123456B", 
    "xComments": "This is a comment", 
    "xDescription": "This is a description", 
    "xIP": "1.2.3.4", 
    "xEmail": "text@example.com", 
    "xFax": "1234567890", 
    "xBillFirstName": "John", 
    "xBillMiddleName": "Max", 
    "xBillLastName": "Doe", 
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "11111", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356", 
    "xExistingCustomer": "TRUE", 
    "xAllowDuplicate": "TRUE" 
}
```

{% endcode %}

### Balance

<mark style="color:green;">`POST`</mark> `ebtw:balance`

`xCommand` = `ebtw:Balance`\
\
The Balance command is used to check the balance on an EBTW cash benefit account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe`              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |

{% code title="Balance - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "ebtw:balance",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xIP": "1.2.3.4" 
}
```

{% endcode %}

### Void

<mark style="color:green;">`POST`</mark> `ebtw:void`

`xCommand` = `ebtw:Void`\
\
The Void command voids a purchase made with an EBTW cardholder’s cash benefit account.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xDUKPT<mark style="color:red;">\*</mark>           | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xRefNum<mark style="color:red;">\*</mark>          | String | Used to reference a previous transaction when processing a follow-up transaction; typically a refund, void, or capture. (Note: xRefnum can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String).                              |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe`              |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |

{% code title="Void - Request Payload Example" %}

```json
{
    "xCardNum": "4444333322221111",
    "xKey": "[xkeycredentials]",
    "xVersion": "4.5.9",
    "xSoftwareName": "YourSoftwareName",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "ebtw.void",
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433",
    "xRefNum": "81726356",
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xIP": "1.1.1.1"
}
```

{% endcode %}


# Gift Card

## Overview

This page contains all API documentation for Gift Card transactions. For more information regarding account access, navigate to the [Transaction API](/api/transaction) parent page.&#x20;

## Transactions

### Issue

<mark style="color:green;">`POST`</mark> `gift:issue`

`xCommand` = `gift:issue`\
\
The Issue command is used to issue funds to a Sola gift card.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xCustom01<mark style="color:red;">\*</mark>        | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| xToken                                             | String | The Sola token that references a previously used payment card. When using this variable, `xCardNumand xMagstripe` should not be used maximum 50 alphanumeric characters).                                                                          |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encryptedcard data can also be sent using `xMagstripe`               |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data that is optionally passed along to the receipt                                                                                                                                                                                     |
| xDescription                                       | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                      |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |
| xExp                                               | String | Gift card expiration number. Format: MMYY. For sandbox accounts, use any date in the future. \*Required and available only when `xCardNum` is used.                                                                                                |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card)                                                                                                                                                         |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                                       |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                             |
| xDUKPT                                             | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                      |

{% code title="Issue - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "gift:issue",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84", 
    "xCustom01": "Register01", 
    "xExp": "12/25", 
    "xCVV": "945", 
    "xStreet": "123 Any Street Apt 4b Anytown, NY", 
    "xZip": "12345", 
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xName": "John Doe", 
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433", 
    "xTax": "2.00", 
    "xTip": "2.00", 
    "xInvoice": "123456A", 
    "xPONum": "123456B", 
    "xComments": "This is a comment", 
    "xDescription": "This is a description", 
    "xIP": "1.2.3.4", 
    "xEmail": "text@example.com", 
    "xFax": "1234567890", 
    "xBillFirstName": "John", 
    "xBillMiddleName": "Max", 
    "xBillLastName": "Doe", 
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY",
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "12345", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356", 
    "xExistingCustomer": "TRUE", 
    "xAllowDuplicate": "TRUE",
    "xTimeoutSeconds": "10"
}
```

{% endcode %}

### Redeem

<mark style="color:green;">`POST`</mark> `gift:redeem`

`xCommand` = `gift:redeem`

The Redeem command is used to debit funds from a Sola gift card.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xAmount<mark style="color:red;">\*</mark>          | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction.                                                                                                                             |
| xCustom01<mark style="color:red;">\*</mark>        | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xToken                                             | String | The Sola token that references a previously used card. When using a variable, `xCardNumand xMagstripe` should no be used (maximum 50 alphanumeric characters).                                                                                     |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted Card data can also be sent using `xMagstripe.`             |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data that is optionally passed along to the receipt                                                                                                                                                                                     |
| xDescription                                       | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                      |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection.                                                                                                                                                                                     |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |
| xExp                                               | String | Gift card expiration number. Format: MMYY. For sandbox accounts, use any date in the future. \*Required and available only when `xCardNum` is used.                                                                                                |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card).                                                                                                                                                        |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                                       |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                             |
| xDUKPT                                             | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| xTimeoutSeconds                                    | String | Configurable amount of seconds in which the request will wait for a response.                                                                                                                                                                      |

{% code title="Redeem - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "gift:redeem",
    "xAmount": "35.00",
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84", 
    "xCustom01": "Register01", 
    "xExp": "12/25", 
    "xCVV": "945", 
    "xStreet": "123 Any Street Apt 4b Anytown, NY", 
    "xZip": "12345", 
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xName": "John Doe", 
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433", 
    "xTax": "2.00", 
    "xTip": "2.00", 
    "xInvoice": "123456A", 
    "xPONum": "123456B", 
    "xComments": "This is a comment", 
    "xDescription": "This is a description", 
    "xIP": "1.2.3.4", 
    "xEmail": "text@example.com", 
    "xFax": "1234567890", 
    "xBillFirstName": "John", 
    "xBillMiddleName": "Max", 
    "xBillLastName": "Doe", 
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY",
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "12345", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xOrderID": "12356", 
    "xExistingCustomer": "TRUE", 
    "xAllowDuplicate": "TRUE",
    "xTimeoutSeconds": "10"
}
```

{% endcode %}

### Balance

<mark style="color:green;">`POST`</mark> `gift:balance`

`xCommand` = `gift:balance`\
\
The Balance command is used to check the available balance on a Sola gift card.

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, `xToken` `xMagStripe` or `SUT` can be used.                                                                                                                                                             |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                                                                                                                                                                                 |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                                                                                                                                                                                 |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                                                                                                                                                                                              |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                                                                                                                                                                                    |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                                                                                                                                                                                              |
| xToken                                             | String | The Sola token that references a previously used payment method. When using a token, `xCardNum` `xExp` and `xMagstripe` should not be used.                                                                                                        |
| xMagstripe                                         | String | The magstripe data of a credit card. Magstripe data includes the card number and expiration date. When using this command, `xCardNum` `xExp` and `xToken` should not be used. Encrypted card data can also be sent using `xMagstripe.`             |
| xName                                              | String | The cardholder’s name                                                                                                                                                                                                                              |
| xTax                                               | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xTip                                               | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                                                                                                         |
| xInvoice                                           | String | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                                                                       |
| xPONum                                             | String | The merchant’s purchase order number for the transaction                                                                                                                                                                                           |
| xComments                                          | String | Additional data that is optionally passed along to the receipt                                                                                                                                                                                     |
| xDescription                                       | String | Additional data that is optionally passed along for reporting                                                                                                                                                                                      |
| xIP                                                | String | The customer’s IP address. Typically used for fraud detection                                                                                                                                                                                      |
| xEmail                                             | String | The customer’s email address                                                                                                                                                                                                                       |
| xFax                                               | String | The customer’s fax number                                                                                                                                                                                                                          |
| xBillFirstName                                     | String | The customer’s first name for their billing profile                                                                                                                                                                                                |
| xBillMiddleName                                    | String | The customer’s middle name or initial for their billing profile                                                                                                                                                                                    |
| xBillLastName                                      | String | The customer’s last/family name for their billing profile                                                                                                                                                                                          |
| xBillCompany                                       | String | The customer’s company name for their billing profile                                                                                                                                                                                              |
| xBillStreet                                        | String | The customer’s street address for their billing profile                                                                                                                                                                                            |
| xBillStreet2                                       | String | The customer’s street address 2nd line for their billing profile                                                                                                                                                                                   |
| xBillCity                                          | String | The customer’s city for their billing profile                                                                                                                                                                                                      |
| xBillState                                         | String | The customer’s state for their billing profile                                                                                                                                                                                                     |
| xBillZip                                           | String | The customer’s zip code for their billing profile                                                                                                                                                                                                  |
| xBillCountry                                       | String | The customer’s country for their billing profile                                                                                                                                                                                                   |
| xBillPhone                                         | String | The customer’s phone number for their billing profile                                                                                                                                                                                              |
| xBillMobile                                        | String | The customer’s mobile number for their billing profile                                                                                                                                                                                             |
| xShipFirstName                                     | String | The customer’s first name for their shipping profile                                                                                                                                                                                               |
| xShipMiddleName                                    | String | The customer’s middle name or initial for their shipping profile                                                                                                                                                                                   |
| xShipLastName                                      | String | The customer’s last/family name for their shipping profile                                                                                                                                                                                         |
| xShipCompany                                       | String | The customer’s company name for their shipping profile                                                                                                                                                                                             |
| xShipStreet                                        | String | The customer’s street address for their shipping profile                                                                                                                                                                                           |
| xShipStreet2                                       | String | The customer’s street address 2nd line for their shipping profile                                                                                                                                                                                  |
| xShipCity                                          | String | The customer’s city for their shipping profile                                                                                                                                                                                                     |
| xShipState                                         | String | The customer’s state for their shipping profile                                                                                                                                                                                                    |
| xShipZip                                           | String | The customer’s zip code for their shipping profile                                                                                                                                                                                                 |
| xShipCountry                                       | String | The customer’s country for their shipping profile                                                                                                                                                                                                  |
| xShipPhone                                         | String | The customer’s phone number for their shipping profile                                                                                                                                                                                             |
| xShipMobile                                        | String | The customer’s mobile number for their shipping profile                                                                                                                                                                                            |
| xAllowDuplicate                                    | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                          |
| xOrderID                                           | String | Unique order number for FraudWatch verification                                                                                                                                                                                                    |
| xExistingCustomer                                  | String | Yes/No value indicating if the customer is a repeat customer                                                                                                                                                                                       |
| xExp                                               | String | The card expiration number. Format: MMYY. For sandbox test transactions, use any date in the future. `*xExp` is required when sending in `xCardnum` and cannot be used with `xMagstripe.`                                                          |
| xCVV                                               | String | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card).                                                                                                                                                        |
| xStreet                                            | String | The billing street address of the cardholder                                                                                                                                                                                                       |
| xZip                                               | String | The billing zip code of the cardholder                                                                                                                                                                                                             |
| xDUKPT                                             | String | The DUK/PT key for PIN debit and EBT transactions.The first 16 characters are the encrypted PIN block, followed by the 6 character long Key Set Identifier (KSID). The remaining characters are the PIN pad serial number and transaction counter. |
| Custom01                                           | String | 20 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom20.`                                                                                                                               |
| xAuthCode                                          | String | `xAuthCode` is a verification number provided by the issuing bank to be used with the cc:postauth command                                                                                                                                          |
| xRefNum                                            | String | Used to reference a previous transaction when processing a follow-up transaction, typically a refund, void, or capture. (Note: `xRefnum` can be a 64-bit number and should be stored as BIGINT, Long, Int64 or String).                            |
| xMICR                                              | String | The routing, account, and check number data from the bottom of a check in MICR (Magnetic Ink Character Recognition) format, typically generated by a check scanner                                                                                 |
| xRouting                                           | String | The check ABA routing number                                                                                                                                                                                                                       |
| xGatewayRefNum                                     | String | Transaction RefNum received from gateway for FraudWatch verification                                                                                                                                                                               |
| xGatewayResult                                     | String | Transaction status received from gateway for FraudWatch verification (Approved/Declined/Error)                                                                                                                                                     |
| xGatewayError                                      | String | Transaction RefNum received from gateway for FraudWatch verification.                                                                                                                                                                              |
| xGatewayCVV                                        | String | CVV for for FraudWatch verification.                                                                                                                                                                                                               |
| xOrderType                                         | String | Specifies if the order origin is internet OR phone for FraudWatch verification                                                                                                                                                                     |
| xGatewayAVS                                        | String | Street address for FraudWatch verification                                                                                                                                                                                                         |
| xOrderItems                                        | String | Summary of products ordered                                                                                                                                                                                                                        |
| xCustomerComments                                  | String | Comments submitted by thecustomer along with the order                                                                                                                                                                                             |
| xShipMethod                                        | String | The shipping carrier/service used                                                                                                                                                                                                                  |
| xShipAmount                                        | String | The total cost of shipping charges                                                                                                                                                                                                                 |
| xShipEmail                                         | String | The ShipTo email address                                                                                                                                                                                                                           |

{% code title="Balance - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "gift:balance", 
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84", 
    "xCustom01": "Register01", 
    "xExp": "12/25", 
    "xCVV": "945", 
    "xStreet": "123 Any Street Apt 4b Anytown, NY", 
    "xZip": "12345", 
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xName": "John Doe", 
    "xAuthCode": "T4321A", 
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433", 
    "xTax": "2.00", 
    "xTip": "2.00", 
    "xRefNum": "81234568", 
    "xInvoice": "123456A", 
    "xPONum": "123456B", 
    "xComments": "This is a comment", 
    "xDescription": "This is a description", 
    "xIP": "1.2.3.4", 
    "xEmail": "text@example.com", 
    "xFax": "1234567890", 
    "xBillFirstName": "John", 
    "xBillMiddleName": "Max", 
    "xBillLastName": "Doe", 
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "12345", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xMICR": "t021000021t 123456789o _2542", 
    "xRouting": "021202337", 
    "xGatewayRefNum": "852585258", 
    "xGatewayResult": "Approved", 
    "xGatewayError": "845455484", 
    "xGatewayCVV": "M", 
    "xGatewayAVS": "YYY", 
    "xOrderType": "Internet", 
    "xOrderID": "12356", 
    "xExistingCustomer": "TRUE", 
    "xOrderItems": "Sony Digital Camera", 
    "xCustomerComments": "Please ship as soon as possible", 
    "xShipMethod": "UPS Ground", 
    "xShipAmount": "29.99", 
    "xShipEmail": "text@example.com", 
    "xAllowDuplicate": "TRUE" 
}
```

{% endcode %}

### Activate

<mark style="color:green;">`POST`</mark> `gift:activate`

`xCommand` = `gift:activate`\
The Activate command is used to activate a Sola gift card.

#### Request Body

| Name                                               | Type   | Description                                                                         |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, xToken, xMagStripe or `SUT` can be used. |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                  |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                  |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                               |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                     |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                               |

{% code title="Activate - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "gift:activate"
}
```

{% endcode %}

### Deactivate

<mark style="color:green;">`POST`</mark> `gift:deactivate`

`xCommand` = `gift:deactivate`\
The Deactivate command is used to deactivate a Sola gift card.(note: you can still check the balance of the gift card even after it has been deactivated).

#### Request Body

| Name                                               | Type   | Description                                                                         |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>         | String | The customer card number. \*Alternatively, xToken, xMagStripe or `SUT` can be used. |
| xKey<mark style="color:red;">\*</mark>             | String | Your Sola API key.                                                                  |
| xVersion<mark style="color:red;">\*</mark>         | String | Gateway API version. The current version is 5.0.0.                                  |
| xSoftwareName<mark style="color:red;">\*</mark>    | String | Name of your software                                                               |
| xSoftwareVersion<mark style="color:red;">\*</mark> | String | Version number of your software                                                     |
| xCommand<mark style="color:red;">\*</mark>         | String | Sola transaction type                                                               |

{% code title="Deactivate - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "gift:deactivate"
}
```

{% endcode %}


# Donor-Advised Funds (DAF)

### Donor-Advised Funds (DAF) <a href="#donor-advised-funds-daf" id="donor-advised-funds-daf"></a>

Sola’s payment gateway supports Donor-Advised Fund (DAF) cards, enabling secure and compliant charitable transactions through various DAF programs, including DonorsFund, OJC, Pledger, and others. Donors can use their DAF-linked cards to initiate charitable contributions, while organizations integrating with Sola can benefit from automated routing and handling based on card type. This streamlines the donation process while ensuring alignment with each DAF provider’s policies.

***

#### Recommendation <a href="#recommendation" id="recommendation"></a>

`xCommand` = `grant:Recommendation`

The `Grant:Recommendation` API call is used to initiate a grant request from a donor’s DAF account to a specific charitable organization. Once submitted, Sola automatically determines the appropriate DAF provider based on the card used and forwards the grant recommendation accordingly.

***

#### Void <a href="#void.3" id="void.3"></a>

`xCommand` = `grant:Void`

The `Grant:Void` API call is used to cancel a previously submitted grant recommendation. This function is essential for handling donor corrections, duplicate submissions, or other administrative scenarios. Upon invocation, the request is routed to the appropriate DAF program to halt the grant in accordance with that provider's cancellation policies.


# 3DS

## Transactions <a href="#id-3ds-verify" id="id-3ds-verify"></a>

### 3DS Verify <a href="#id-3ds-verify" id="id-3ds-verify"></a>

**Paths/Formats**:

* `/verify` for form data
* `/verifyjson` for JSON data

The Verify path is used after a 3DS Step-Up Authentication. See [iFields](/products/ifields) how to implement 3ds on the client side.

#### Request Body

| **Variable**                        | **Required** | **Description**                                    | **Sample Data**              |
| ----------------------------------- | ------------ | -------------------------------------------------- | ---------------------------- |
| **xKey**                            | Yes          | Your Cardknox API key                              | \[xkeycredentials]           |
| **xVersion**                        | Yes          | Gateway API Version. The current version is 5.0.0. | 5.0.0                        |
| **xSoftwareName**                   | Yes          | Name of your software                              | \[xsoftwarecredentials]      |
| **xSoftwareVersion**                | Yes          | Version number of your software                    | \[xversioncredentials]       |
| **x3dsActionCode**                  | Yes          | This is retrieved from the 3ds Verify Handler      | SUCCESS                      |
| **xCavv**                           | Yes          | This is retrieved from the 3ds Verify Handler      | AAIBBYNoEwAAACcKhAJkdQAAAAA= |
| **xEci**                            | Yes          | This is retrieved from the 3ds Verify Handler      | 05                           |
| **xRefNum**                         | Yes          | This is retrieved from the 3ds Verify Handler      | 10583643601                  |
| **x3dsAuthenticationStatus**        | Yes          | This is retrieved from the 3ds Verify Handler      | Y                            |
| **x3dsSignatureVerificationStatus** | Yes          | This is retrieved from the 3ds Verify Handler      | Y                            |

#### Response Example

```json
{
  "xResult": "A",
  "xStatus": "Approved",
  "xError": "",
  "xErrorCode": "00000",
  "xRefNum": "10583643601",
  "xRefNumCurrent": "10583264625",
  "xExp": "1234",
  "xAuthCode": "75294A",
  "xBatch": "5128394",
  "xAvsResultCode": "NNN",
  "xAvsResult": "Address: No Match & 5 Digit Zip: No Match",
  "xCvvResultCode": "M",
  "xCvvResult": "Match",
  "xAuthAmount": "7.00",
  "xMaskedCardNumber": "4xxxxxxxxxxx2503",
  "xCardType": "Visa",
  "xName": "John Doe",
  "xToken": "q712m7h271g035n799pn1605q16757m8",
  "xMID": "xxxxxxxxxx9999",
  "xTID": "xxxxx6789",
  "xCurrency": "USD",
  "xDate": "7/11/2025 9:59:11 AM",
  "xEntryMethod": "Keyed",
  "xEnrolled": "Y",
  "xCAVV": "AAIBBYNoEwAAACcKhAJkdQAAAAA=",
  "xEciFlag": "05",
  "x3DSID": "8ebb5b87-4d74-4b56-a0d0-075c6a37ab85",
  "xReviewed": "Y"
}
```


# Fraud

## Overview

This page contains the API documentation for Fraud Submit transactions, in conjunction with FraudWatch. For more information regarding account access, navigate to the [Transaction API](/api/transaction) parent page.&#x20;

## Transactions

### Fraud Submit

<mark style="color:green;">`POST`</mark> `fraud:submit`

`xCommand` = `fraud:submit`

The Submit command is used in conjunction with a valid FraudWatch account to submit e-commerce transactions for a fraud verification check.

#### Request Body

| Name                                                | Type   | Description                                                                                                                                               |
| --------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xCardNum<mark style="color:red;">\*</mark>          | String | Masked Card number with BIN and last 4 digits exposed                                                                                                     |
| xKey<mark style="color:red;">\*</mark>              | String | Your Sola API key.                                                                                                                                        |
| xVersion<mark style="color:red;">\*</mark>          | String | Gateway API version. The current version is 5.0.0.                                                                                                        |
| xSoftwareName<mark style="color:red;">\*</mark>     | String | Name of your software                                                                                                                                     |
| xSoftwareVersion<mark style="color:red;">\*</mark>  | String | Version number of your software                                                                                                                           |
| xCommand<mark style="color:red;">\*</mark>          | String | Sola transaction type                                                                                                                                     |
| xAmount<mark style="color:red;">\*</mark>           | String | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction                                     |
| xCustom01                                           | String | 20 custom fields are available for custom data such as customer comments, etc. Use xCustom01 through xCustom20                                            |
| xInvoice<mark style="color:red;">\*</mark>          | String | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling                                 |
| xIP<mark style="color:red;">\*</mark>               | String | The customer’s IP address. Typically used for fraud detection                                                                                             |
| xEmail<mark style="color:red;">\*</mark>            | String | The customer’s email address                                                                                                                              |
| xBillFirstName<mark style="color:red;">\*</mark>    | String | The customer’s first name for their billing profile                                                                                                       |
| xBillLastName<mark style="color:red;">\*</mark>     | String | The customer’s last name for their billing profile                                                                                                        |
| xBillStreet<mark style="color:red;">\*</mark>       | String | The customer’s street address for their billing profile                                                                                                   |
| xBillCity<mark style="color:red;">\*</mark>         | String | The customer’s city for their billing profile                                                                                                             |
| xBillState<mark style="color:red;">\*</mark>        | String | The customer’s state for their billing profile                                                                                                            |
| xBillZip<mark style="color:red;">\*</mark>          | String | The customer’s zip code for their billing profile                                                                                                         |
| xBillPhone<mark style="color:red;">\*</mark>        | String | The customer’s phone number for their billing profile                                                                                                     |
| xShipFirstName<mark style="color:red;">\*</mark>    | String | The customer’s first name for their shipping profile                                                                                                      |
| xShipLastName<mark style="color:red;">\*</mark>     | String | The customer’s last/family name for their shipping profile                                                                                                |
| xShipStreet<mark style="color:red;">\*</mark>       | String | The customer’s street address for their shipping profile                                                                                                  |
| xShipCity<mark style="color:red;">\*</mark>         | String | The customer’s city for their shipping profile                                                                                                            |
| xShipState<mark style="color:red;">\*</mark>        | String | The customer’s state for their shipping profile                                                                                                           |
| xShipZip<mark style="color:red;">\*</mark>          | String | The customer’s zip code for their shipping profile                                                                                                        |
| xShipPhone<mark style="color:red;">\*</mark>        | String | The customer’s phone number for their shipping profile                                                                                                    |
| xGatewayRefNum<mark style="color:red;">\*</mark>    | String | Transaction RefNum received from gateway for FraudWatch verification                                                                                      |
| xGatewayResult<mark style="color:red;">\*</mark>    | String | Transaction status received from gateway for FraudWatch verification (Approved/Declined/Error)                                                            |
| xGatewayCVV<mark style="color:red;">\*</mark>       | String | CVV for FraudWatch verification                                                                                                                           |
| xGatewayAVS<mark style="color:red;">\*</mark>       | String | Street address for FraudWatch verification                                                                                                                |
| xOrderType<mark style="color:red;">\*</mark>        | String | Specifies if the order origin is internet OR phone for FraudWatch verification                                                                            |
| xExistingCustomer<mark style="color:red;">\*</mark> | String | Yes/No value indicating if the customer is a repeat customer                                                                                              |
| xShipEmail<mark style="color:red;">\*</mark>        | String | The ShipTo email address                                                                                                                                  |
| xOrderID                                            | String | Unique order number for FraudWatch verification                                                                                                           |
| xExistingCustomer                                   | String | Yes/No value indicating if customer is a repeat customer                                                                                                  |
| xAllowDuplicate                                     | String | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed. |
| xName                                               | String | The cardholder’s name                                                                                                                                     |
| xTax                                                | String | The tax portion that is included in the total transaction amount (xAmount)                                                                                |
| xTip                                                | String | The tip portion that is included in the total transaction amount (xAmount)                                                                                |
| xPONum                                              | String | The merchant’s purchase order number for the transaction                                                                                                  |
| xDescription                                        | String | Additional data that is optionally passed along for reporting                                                                                             |
| xShipMiddleName                                     | String | The customer’s middle name for their shipping profile                                                                                                     |
| xBillMiddleName                                     | String | The customer’s middle name for their billing profile                                                                                                      |
| xBillStreet2                                        | String | The customer’s second line street address for their billing profile                                                                                       |
| xShipStreet2                                        | String | The customer’s second line street address for their shipping profile                                                                                      |
| xShipCountry                                        | String | The customer's country code for their shipping profile                                                                                                    |
| xBillCountry                                        | String | The custom's country code for their billing profile                                                                                                       |
| xBillMobile                                         | String | The customer’s mobile phone number for their billing profile                                                                                              |
| xGatewayError                                       | String | Transaction RefNum received from gateway for FraudWatch verification                                                                                      |
| xComments                                           | String | Additional data that is optionally passed along to the receipt                                                                                            |
| xFax                                                | String | The customer’s fax number.                                                                                                                                |
| xOrderItems                                         | String | Summary of products ordered                                                                                                                               |
| xCustomerComments                                   | String | Comments submitted by customer along with order                                                                                                           |
| xShipMethod                                         | String | The shipping carrier/service used                                                                                                                         |
| xShipAmount                                         | String | The total cost of shipping charges                                                                                                                        |

{% code title="Fraud Submit - Request Payload Example" %}

```json
{ 
    "xCardNum": "4444333322221111", 
    "xKey": "[xkeycredentials]", 
    "xVersion": "4.5.9", 
    "xSoftwareName": "YourSoftwareName", 
    "xSoftwareVersion": "1.0.0", 
    "xCommand": "fraud:submit", 
    "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84", 
    "xCustom01": "Register01", 
    "xExp": "12/25", 
    "xCVV": "945", 
    "xStreet": "123 Any Street Apt 4b Anytown, NY", 
    "xZip": "12345", 
    "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", 
    "xName": "John Doe", 
    "xAuthCode": "T4321A", 
    "xDUKPT": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;444433", 
    "xTax": "2.00", 
    "xTip": "2.00", 
    "xRefNum": "81234568", 
    "xInvoice": "123456A", 
    "xPONum": "123456B", 
    "xComments": "This is a comment", 
    "xDescription": "This is a description", 
    "xIP": "1.2.3.4", 
    "xEmail": "text@example.com", 
    "xFax": "1234567890", 
    "xBillFirstName": "John", 
    "xBillMiddleName": "Max", 
    "xBillLastName": "Doe", 
    "xBillCompany": "Acme", 
    "xBillStreet": "123 Any Street", 
    "xBillStreet2": "Apt 4b", 
    "xBillCity": "Anytown", 
    "xBillState": "NY", 
    "xBillZip": "12345", 
    "xBillCountry": "USA", 
    "xBillPhone": "8005551212", 
    "xBillMobile": "8005551111", 
    "xShipFirstName": "John", 
    "xShipMiddleName": "Max", 
    "xShipLastName": "Doe", 
    "xShipCompany": "Acme", 
    "xShipStreet": "123 Any Street", 
    "xShipStreet2": "Apt 4b", 
    "xShipCity": "Anytown", 
    "xShipState": "NY", 
    "xShipZip": "12345", 
    "xShipCountry": "USA", 
    "xShipPhone": "8005551212", 
    "xShipMobile": "8005551111", 
    "xMICR": "t021000021t 123456789o _2542", 
    "xRouting": "021202337", 
    "xGatewayRefNum": "852585258", 
    "xGatewayResult": "Approved", 
    "xGatewayError": "845455484", 
    "xGatewayCVV": "M", 
    "xGatewayAVS": "YYY", 
    "xOrderType": "Internet", 
    "xOrderID": "12356", 
    "xExistingCustomer": "TRUE", 
    "xOrderItems": "Sony Digital Camera", 
    "xCustomerComments": "Please ship as soon as possible", 
    "xShipMethod": "UPS Ground", 
    "xShipAmount": "29.99", 
    "xShipEmail": "text@example.com", 
    "xAllowDuplicate": "TRUE" 
}
```

{% endcode %}


# Customer and Recurring API

## Overview&#x20;

The Sola Recurring API, designed in the RESTful architectural style, lets you process recurring transactions through the Sola gateway based on customized schedules. You can create recurring schedules along with customers and payment methods. Additionally, you can process single transactions for a customer and change a merchant's settings for recurring schedule reports.

### Authorization

Include your Sola API key in the `Authorization` header for all requests. You can generate an API key in the [Key Management section](https://portal.solapayments.com/settings/gateway-settings/key-management) of the Sola Portal.

### Versioning

Customer and Recurring API V2 is versioned to allow stability for integrators and flexibility for Sola to continue making improvements.

#### **Major Version**

The URL contains the major version number parameter. This version number would only be changed if there has been a major change that overhauls the entire API.

*Example:* <https://api.cardknox.com/v2>

#### **Minor Version**

This version number is incremented when a breaking change to the existing API is implemented (for example, a change to how requests are processed or how responses are sent back).&#x20;

The minor version is passed in the X-Recurring-Api-Version header: `X-Recurring-Api-Version = 2.1`

### Request Method

Method: ![](https://cardknox.atlassian.net/wiki/plugins/servlet/status-macro/placeholder?title=POST\&colour=Green)

The Sola gateway requires the POST method to be used for enhanced security.

We do not support the GET method.

### Base URL

The base URL for all requests is [**https://api.cardknox.com/v2**](https://api.cardknox.com/v2)

## Customer Endpoints

### /CreateCustomer

Add a new customer record, which can then be linked to payment methods and schedules.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="200.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>CustomerNumber</td><td>No</td><td>string</td><td>Merchant's internal customer identifier.</td></tr><tr><td>CustomerNotes</td><td>No</td><td>string</td><td>Notes pertaining to the customer.</td></tr><tr><td>Email</td><td>No</td><td>string</td><td>Customer's email address.</td></tr><tr><td>Fax</td><td>No</td><td>string</td><td>Customer's fax number.</td></tr><tr><td>BillFirstName</td><td>Yes*</td><td>string</td><td><p>Customer's first name for their billing profile.</p><p>*Required if <code>BillLastName</code> and <code>BillCompany</code> are not passed in.</p></td></tr><tr><td>BillMiddleName</td><td>No</td><td>string</td><td>Customer's middle name or middle initial for their billing profile.</td></tr><tr><td>BillLastName</td><td>Yes*</td><td>string</td><td><p>Customer's last name or family name for their billing profile.</p><p>*Required if <code>BillFirstName</code> and <code>BillCompany</code> are not passed in.</p></td></tr><tr><td>BillCompany</td><td>Yes*</td><td>string</td><td><p>Customer's company name for their billing profile.</p><p>*Required if <code>BillFirstName</code> and <code>BillLastName</code> are not passed in.</p></td></tr><tr><td>BillStreet</td><td>No</td><td>string</td><td>Customer's street address for their billing profile.</td></tr><tr><td>BillStreet2</td><td>No</td><td>string</td><td>Customer's street address second line for their billing profile.</td></tr><tr><td>BillCity</td><td>No</td><td>string</td><td>Customer's city for their billing profile.</td></tr><tr><td>BillState</td><td>No</td><td>string</td><td>Customer's state for their billing profile.</td></tr><tr><td>BillZip</td><td>No</td><td>string</td><td>Customer's ZIP code or postal code for their billing profile.</td></tr><tr><td>BillCountry</td><td>No</td><td>string</td><td>Customer's country for their billing profile.</td></tr><tr><td>BillPhone</td><td>No</td><td>string</td><td>Customer's phone number for their billing profile.</td></tr><tr><td>BillMobile</td><td>No</td><td>string</td><td>Customer's mobile number for their billing profile.</td></tr><tr><td>ShipFirstName</td><td>No</td><td>string</td><td>Customer’s first name for their shipping profile.</td></tr><tr><td>ShipMiddleName</td><td>No</td><td>string</td><td>Customer’s middle name or initial for their shipping profile.</td></tr><tr><td>ShipLastName</td><td>No</td><td>string</td><td>Customer’s last/family name for their shipping profile.</td></tr><tr><td>ShipCompany</td><td>No</td><td>string</td><td>Customer’s company name for their shipping profile.</td></tr><tr><td>ShipStreet</td><td>No</td><td>string</td><td>Customer’s street address for their shipping profile.</td></tr><tr><td>ShipStreet2</td><td>No</td><td>string</td><td>Customer’s street address second line for their shipping profile.</td></tr><tr><td>ShipCity</td><td>No</td><td>string</td><td>Customer’s city for their shipping profile.</td></tr><tr><td>ShipState</td><td>No</td><td>string</td><td>Customer’s state for their shipping profile.</td></tr><tr><td>ShipZip</td><td>No</td><td>string</td><td>Customer’s ZIP code for their shipping profile.</td></tr><tr><td>ShipCountry</td><td>No</td><td>string</td><td>Customer’s country for their shipping profile.</td></tr><tr><td>ShipPhone</td><td>No</td><td>string</td><td>Customer’s phone number for their shipping profile.</td></tr><tr><td>ShipMobile</td><td>No</td><td>string</td><td>Customer’s mobile number for their shipping profile.</td></tr><tr><td>ShipEmail</td><td>No</td><td>string</td><td>Customer’s shipping email address for their shipping profile.</td></tr><tr><td>CustomerCustomXX</td><td>No</td><td>string</td><td>Custom fields (20 available) used for custom data such as customer comments and so forth. Use <code>CustomerCustom01</code> through <code>CustomerCustom20</code>.</td></tr></tbody></table>

#### **Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "CustomerNumber" : "123456",
    "CustomerNotes" : "Vip Customer",
    "Email" : "sample@example.com",
    "Fax" : "",
    "BillFirstName" : "John",
    "BillMiddleName" : "G",
    "BillLastName" : "Doe",
    "BillCompany" : "ACME Inc.",
    "BillStreet" : "123 Main Street",
    "BillStreet2" : "STE 1",
    "BillCity" : "AnyTown",
    "BillState" : "NY",
    "BillCountry" : "USA",
    "BillZip" : "11218",
    "BillPhone" : "",
    "BillMobile" : "",
    "ShipFirstName" : "John",
    "ShipMiddleName" : "G",
    "ShipLastName" : "Doe",
    "ShipCompany" : "ACME Inc.",
    "ShipStreet" : "123 Main Street",
    "ShipStreet2" : "STE 1",
    "ShipCity" : "AnyTown",
    "ShipState" : "NY",
    "ShipCountry" : "USA",
    "ShipZip" : "11218",
    "ShipPhone" : "",
    "ShipMobile" : "",
    "ShipEmail" : "sample@example.com",
    "CustomerCustom01" : "MyCustomValue",
    "CustomerCustom02" : "MyCustomValue2",
    "CustomerCustom03" : "MyCustomValue3"
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="181">Parameter</th><th width="150">Type</th><th width="214.6511627906977">Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>CustomerId</td><td>integer</td><td>The created customer ID.</td><td></td></tr></tbody></table>

**Sample Response**

```json
{ 
"RefNum": "r1234567890",
"Result": "S",
"Error": "",
"CustomerId": "c1234567890"
}
```

### /UpdateCustomer

Update existing customer information.

**Note:** All fields with values must be passed in (even fields that are not being updated). Any fields not passed in are treated as being set to blank.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>Revision</td><td>Yes</td><td>integer</td><td>The revision number of the record to update. If this does not match the current revision number of the record, the update will fail.</td></tr><tr><td>CustomerId</td><td>Yes</td><td>string</td><td>The ID of the customer to update.</td></tr><tr><td>CustomerNumber</td><td>No</td><td>string</td><td>Merchant's internal customer identifier.</td></tr><tr><td>CustomerNotes</td><td>No</td><td>string</td><td>Notes pertaining to the customer.</td></tr><tr><td>DefaultPaymentMethodId</td><td>Yes</td><td>string</td><td>The ID of the created payment method.</td></tr><tr><td>Email</td><td>No</td><td>string</td><td>Customer's email address.</td></tr><tr><td>Fax</td><td>No</td><td>string</td><td>Customer's fax number.</td></tr><tr><td>BillFirstName</td><td>Yes*</td><td>string</td><td><p>Customer's first name for their billing profile.</p><p>*Required if <code>BillLastName</code> and <code>BillCompany</code> are not passed in.</p></td></tr><tr><td>BillMiddleName</td><td>No</td><td>string</td><td>Customer's middle name or middle initial for their billing profile.</td></tr><tr><td>BillLastName</td><td>Yes*</td><td>string</td><td><p>Customer's last/family name for their billing profile.</p><p>*Required if <code>BillFirstName</code> and <code>BillCompany</code> are not passed in.</p></td></tr><tr><td>BillCompany</td><td>Yes*</td><td>string</td><td><p>Customer's company name for their billing profile.</p><p>*Required if <code>BillFirstName</code> and <code>BillLastName</code> are not passed in.</p></td></tr><tr><td>BillStreet</td><td>No</td><td>string</td><td>Customer's street address for their billing profile.</td></tr><tr><td>BillStreet2</td><td>No</td><td>string</td><td>Customer's street address second line for their billing profile.</td></tr><tr><td>BillCity</td><td>No</td><td>string</td><td>Customer's city for their billing profile.</td></tr><tr><td>BillState</td><td>No</td><td>string</td><td>Customer's state for their billing profile.</td></tr><tr><td>BillZip</td><td>No</td><td>string</td><td>Customer's ZIP code or postal code for their billing profile.</td></tr><tr><td>BillCountry</td><td>No</td><td>string</td><td>Customer's country for their billing profile.</td></tr><tr><td>BillPhone</td><td>No</td><td>string</td><td>Customer's phone number for their billing profile.</td></tr><tr><td>BillMobile</td><td>No</td><td>string</td><td>Customer's mobile number for their billing profile.</td></tr><tr><td>ShipFirstName</td><td>No</td><td>string</td><td>Customer’s first name for their shipping profile.</td></tr><tr><td>ShipMiddleName</td><td>No</td><td>string</td><td>Customer’s middle name or initial for their shipping profile.</td></tr><tr><td>ShipLastName</td><td>No</td><td>string</td><td>Customer’s last/family name for their shipping profile.</td></tr><tr><td>ShipCompany</td><td>No</td><td>string</td><td>Customer’s company name for their shipping profile.</td></tr><tr><td>ShipStreet</td><td>No</td><td>string</td><td>Customer’s street address for their shipping profile.</td></tr><tr><td>ShipStreet2</td><td>No</td><td>string</td><td>Customer’s street address second line for their shipping profile.</td></tr><tr><td>ShipCity</td><td>No</td><td>string</td><td>Customer’s city for their shipping profile.</td></tr><tr><td>ShipState</td><td>No</td><td>string</td><td>Customer’s state for their shipping profile.</td></tr><tr><td>ShipZip</td><td>No</td><td>string</td><td>Customer’s ZIP code for their shipping profile.</td></tr><tr><td>ShipCountry</td><td>No</td><td>string</td><td>Customer’s country for their shipping profile.</td></tr><tr><td>ShipPhone</td><td>No</td><td>string</td><td>Customer’s phone number for their shipping profile.</td></tr><tr><td>ShipMobile</td><td>No</td><td>string</td><td>Customer’s mobile number for their shipping profile.</td></tr><tr><td>ShipEmail</td><td>No</td><td>string</td><td>Customer’s shipping email address for their shipping profile.</td></tr><tr><td>CustomerCustomXX</td><td>No</td><td>string</td><td>Custom fields (20 available) used for custom data such as customer comments and so forth. Use <code>CustomerCustom01</code> through <code>CustomerCustom20</code>.</td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
	"Revision" : 1,
    "CustomerId" : "c123456",
    "CustomerNumber" : "123456",
    "CustomerNotes" : "Vip Customer",
    "Email" : "sample@example.com",
    "Fax" : "",
    "BillFirstName" : "John",
    "BillMiddleName" : "G",
    "BillLastName" : "Doe",
    "BillCompany" : "ACME Inc.",
    "BillStreet" : "123 Main Street",
    "BillStreet2" : "STE 1",
    "BillCity" : "AnyTown",
    "BillState" : "NY",
    "BillCountry" : "USA",
    "BillZip" : "11218",
    "BillPhone" : "",
    "BillMobile" : "",
    "ShipFirstName" : "John",
    "ShipMiddleName" : "G",
    "ShipLastName" : "Doe",
    "ShipCompany" : "ACME Inc.",
    "ShipStreet" : "123 Main Street",
    "ShipStreet2" : "STE 1",
    "ShipCity" : "AnyTown",
    "ShipState" : "NY",
    "ShipCountry" : "USA",
    "ShipZip" : "11218",
    "ShipPhone" : "",
    "ShipMobile" : "",
    "ShipEmail" : "sample@example.com",
    "CustomerCustom01" : "MyCustomValue",
    "CustomerCustom02" : "MyCustomValue2",
    "CustomerCustom03" : "MyCustomValue3"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Type</th><th width="232">Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. S represents success, E represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /GetCustomer

Retrieves the details of a specific customer.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>CustomerId</td><td>Yes</td><td>string</td><td>The ID of the customer to retrieve.</td></tr><tr><td>ShowDeleted</td><td>No</td><td>boolean</td><td>A flag that can be set to retrieve deleted items. If set to <strong>true</strong>, only deleted items can be retrieved (i.e. customers that are not deleted will not be returned).</td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "CustomerId" : "c1234567890",
    "ShowDeleted" : false
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="186">Parameter</th><th width="150">Type</th><th width="220.26086956521738">Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>Revision</td><td>integer</td><td>The revision number of the customer record.</td><td></td></tr><tr><td>CreatedDate</td><td>string</td><td>The date and time the customer was created, returned in ISO 8601 format (yyyy-MM-dd HH:mm:ss.fff).</td><td></td></tr><tr><td>CustomerId</td><td>string</td><td>The ID of the customer to update.</td><td></td></tr><tr><td>CustomerNumber</td><td>string</td><td>Merchant's internal customer identifier.</td><td></td></tr><tr><td>CustomerNotes</td><td>string</td><td>Notes pertaining to the customer.</td><td></td></tr><tr><td>Email</td><td>string</td><td>Customer's email address.</td><td></td></tr><tr><td>Fax</td><td>string</td><td>Customer's fax number.</td><td></td></tr><tr><td>BillFirstName</td><td>string</td><td>Customer's first name for their billing profile.</td><td></td></tr><tr><td>BillMiddleName</td><td>string</td><td>Customer's middle name or initial for their billing profile.</td><td></td></tr><tr><td>BillLastName</td><td>string</td><td>Customer's last/family name for their billing profile.</td><td></td></tr><tr><td>BillCompany</td><td>string</td><td>Customer's company name for their billing profile.</td><td></td></tr><tr><td>BillStreet</td><td>string</td><td>Customer's street address for their billing profile.</td><td></td></tr><tr><td>BillStreet2</td><td>string</td><td>Customer's street address second line for their billing profile.</td><td></td></tr><tr><td>BillCity</td><td>string</td><td>Customer's city for their billing profile.</td><td></td></tr><tr><td>BillState</td><td>string</td><td>Customer's state for their billing profile.</td><td></td></tr><tr><td>BillZip</td><td>string</td><td>Customer's ZIP code or postal code for their billing profile.</td><td></td></tr><tr><td>BillCountry</td><td>string</td><td>Customer's country for their billing profile.</td><td></td></tr><tr><td>BillPhone</td><td>string</td><td>Customer's phone number for their billing profile.</td><td></td></tr><tr><td>BillMobile</td><td>string</td><td>Customer's mobile number for their billing profile.</td><td></td></tr><tr><td>ShipFirstName</td><td>string</td><td>Customer’s first name for their shipping profile.</td><td></td></tr><tr><td>ShipMiddleName</td><td>string</td><td>Customer’s middle name or initial for their shipping profile.</td><td></td></tr><tr><td>ShipLastName</td><td>string</td><td>Customer’s last/family name for their shipping profile.</td><td></td></tr><tr><td>ShipCompany</td><td>string</td><td>Customer’s company name for their shipping profile.</td><td></td></tr><tr><td>ShipStreet</td><td>string</td><td>Customer’s street address for their shipping profile.</td><td></td></tr><tr><td>ShipStreet2</td><td>string</td><td>Customer’s street address second line for their shipping profile.</td><td></td></tr><tr><td>ShipCity</td><td>string</td><td>Customer’s city for their shipping profile.</td><td></td></tr><tr><td>ShipState</td><td>string</td><td>Customer’s state for their shipping profile.</td><td></td></tr><tr><td>ShipZip</td><td>string</td><td>Customer’s ZIP code for their shipping profile.</td><td></td></tr><tr><td>ShipCountry</td><td>string</td><td>Customer’s country for their shipping profile.</td><td></td></tr><tr><td>ShipPhone</td><td>string</td><td>Customer’s phone number for their shipping profile.</td><td></td></tr><tr><td>ShipMobile</td><td>string</td><td>Customer’s mobile number for their shipping profile.</td><td></td></tr><tr><td>ShipEmail</td><td>string</td><td>Customer’s shipping email address for their shipping profile.</td><td></td></tr><tr><td>CustomerCustomXX</td><td>string</td><td>Custom fields (20 available) used for custom data such as customer comments and so forth. Use <code>CustomerCustom01</code> through <code>CustomerCustom20</code>.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
    "CustomerId": "c123456",
    "Revision": 1,
    "CustomerNotes": "Vip Customer",
    "CustomerNumber": "123456",
    "DefaultPaymentMethodId": "",
    "CreatedDate": "2019-08-20 14:30:57.578",
    "Email": "sample@example.com",
    "BillFirstName": "John",
    "BillMiddleName": "G",
    "BillLastName": "Doe",
    "BillCompany": "ACME Inc.",
    "BillStreet": "123 Main Street",
    "BillStreet2": "STE 1",
    "BillCity": "AnyTown",
    "BillState": "NY",
    "BillZip": "11218",
    "BillCountry": "USA",
    "ShipFirstName": "John",
    "ShipMiddleName": "G",
    "ShipLastName": "Doe",
    "ShipCompany": "ACME Inc.",
    "ShipStreet": "123 Main Street",
    "ShipStreet2": "STE 1",
    "ShipCity": "AnyTown",
    "ShipState": "NY",
    "ShipZip": "11218",
    "ShipCountry": "USA",
    "ShipEmail": "sample@example.com",
    "CustomerCustom01": "MyCustomValue",
    "CustomerCustom02": "MyCustomValue2",
    "CustomerCustom03": "MyCustomValue3"
}
```

### /DeleteCustomer

Deletes a customer record. You cannot delete a customer who has an active recurring schedule.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>CustomerId</td><td>Yes</td><td>string</td><td>The ID of the customer to update.</td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "CustomerId" : "c123456"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="150">Parameter</th><th width="150">Type</th><th width="242.7142857142857">Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents  error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /ListCustomers

Lists customers created by a merchant.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="185">Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>PageSize</td><td>No</td><td>integer</td><td>100</td><td>The maximum number of items to retrieve for this request.</td><td></td></tr><tr><td>NextToken</td><td>No</td><td>string</td><td></td><td>A token that can be sent in to the following request to get the next set of customers.</td><td></td></tr><tr><td>SortOrder</td><td>No</td><td>string</td><td>Ascending</td><td>The list order. Order is determined by customer creation date.</td><td>Ascending, Descending</td></tr><tr><td>Filters</td><td>No</td><td>object</td><td><p>{</p><p>    "IsDeleted" : false</p><p>}</p></td><td><p>Filters that can be applied to limit the result set.</p><p>Filters will remove any items that do not contain the string for that filter value. If there are multiple filters applied, the item must match all of them.</p><p>Available filters:</p><ul><li>CustomerId</li><li>CustomerNumber</li><li>IsDeleted</li><li>Email</li><li>BillName</li><li>BillFirstName</li><li>BillLastName</li><li>BillMiddleName</li><li>BillCompany</li><li>BillStreet</li><li>BillStreet2</li><li>BillCity</li><li>BillState</li><li>BillZip</li><li>BillCountry</li><li>BillPhoneNumber</li><li>BillPhone</li><li>BillMobile</li><li>BillFax</li></ul></td><td></td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"NextToken" : "",
	"PageSize" : 500,
	"Filters" : {
		"BillFirstName" : "John",
		"BillState" : "NY"
	}
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="154">Parameter</th><th width="150">Type</th><th width="230.5">Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>Customers</td><td>object[]</td><td><p>An array of customer objects.</p><p>Refer to the <a href="#getcustomer">/GetCustomer</a> endpoint for the values that are returned for each customer.</p></td><td></td></tr><tr><td>NextToken</td><td>string</td><td>A token to include in the next request to get the next set of results.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
	"Customers" : [
        {
            "CustomerId" : "c123456",
            "Revision" : 1,
            "BillFirstName" : "John",
            "BillLastName" : "Doe",
            "BillState" : "NY"
        },
        {
            "CustomerId" : "c123457",
            "Revision" : 1,
            "BillFirstName" : "Johnathan",
            "BillLastName" : "Doe",
            "BillState" : "NY"
        }
    ]
}
```

## Payment Method Endpoints

### /CreatePaymentMethod

Adds a new payment method to a customer’s account profile.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="204.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>CustomerId</td><td>Yes</td><td>string</td><td>The ID of the customer to update with the new payment method.</td></tr><tr><td>Token</td><td>Yes</td><td>string</td><td><p>Sola token that represents a payment method.</p><p>*Raw card information cannot be passed in the request.</p></td></tr><tr><td>TokenType</td><td>Yes</td><td>string</td><td>The <code>Token</code> payment type.</td></tr><tr><td>TokenAlias</td><td>No</td><td>string</td><td>Custom name for the <code>Token</code>.</td></tr><tr><td>Exp</td><td>Yes*</td><td>string</td><td><p>Credit card expiration date.</p><p>*Required if <code>Token</code> is an iFields token and <code>TokenType</code> is <strong>cc</strong>.</p></td></tr><tr><td>Routing</td><td>Yes*</td><td>string</td><td><p>ACH payment routing number.</p><p>*Required if <code>Token</code> is an iFields token and <code>TokenType</code> is <strong>ach</strong>.</p></td></tr><tr><td>AccountType</td><td>No</td><td>string</td><td><p>The account type - checking / savings.</p><p>*Allowed if the <code>TokenType</code> is <strong>check</strong>.</p></td></tr><tr><td>Name</td><td>No</td><td>string</td><td><p>Name on the customer's account.</p><p>*Required for ACH (check) transactions.</p></td></tr><tr><td>Street</td><td>No</td><td>string</td><td>Customer's street address for their billing profile.</td></tr><tr><td>Zip</td><td>No</td><td>string</td><td>Customer's ZIP code or postal code for their billing profile.</td></tr><tr><td>SetAsDefault</td><td>No</td><td>boolean</td><td><p>Sets this payment method as the default payment method.</p><p><strong>Note</strong>: If there are no other payment methods, this method is automatically set as the default.</p></td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "CustomerId" : "c123456",
	"Token" : "pm4408q3327hq551h5h51058qh6n87mn",
	"TokenType" : "cc",
	"TokenAlias" : "",
	"Exp" : "1220",
	"Routing" : "",
	"AccountType" : "",
	"Name" : "",
	"Street" : "",
	"Zip" : "",
	"SetAsDefault" : false
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="161">Parameter</th><th width="150">Type</th><th width="237.40787623066106">Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>PaymentMethodId</td><td>string</td><td>The ID of the created payment method.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
    "PaymentMethodId": "c123456_pm123456
}
```

### /UpdatePaymentMethod

Updates an existing payment method.

**Note:** All fields with values must be passed in (even fields that are not being updated). Any fields not passed in are treated as being set to blank.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>Revision</td><td>Yes</td><td>integer</td><td>The revision number of the record to update. If this does not match the current revision number of the record, the update will fail.</td></tr><tr><td>PaymentMethodId</td><td>Yes</td><td>string</td><td>The ID of the payment method to update.</td></tr><tr><td>TokenAlias</td><td>No</td><td>string</td><td>Custom name for the <code>Token</code>.</td></tr><tr><td>Exp</td><td>No</td><td>string</td><td>Credit card expiration date.</td></tr><tr><td>AccountType</td><td>No</td><td>string</td><td><p>The account type - checking / savings</p><p>*Allowed if <code>TokenType</code> is <strong>check</strong>.</p></td></tr><tr><td>Routing</td><td>Yes*</td><td>string</td><td><p>ACH payment routing number.</p><p>*Required if <code>Token</code> is an iFields token and <code>TokenType</code> is <strong>ach</strong>.</p></td></tr><tr><td>Name</td><td>No*</td><td>string</td><td><p>Name on the customer's account.</p><p>*Required for ACH (check) transactions.</p></td></tr><tr><td>Street</td><td>No</td><td>string</td><td>Customer's street address for their billing profile.</td></tr><tr><td>Zip</td><td>No</td><td>string</td><td>Customer's ZIP code or postal code for their billing profile.</td></tr><tr><td>SetAsDefault</td><td>No</td><td>boolean</td><td><p>Sets this payment method as the default payment method.</p><p><strong>Note</strong>: If there are no other payment methods, this method is automatically set as the default.</p></td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "Revision" : 1,
    "PaymentMethodId" : "c123456",
    "TokenAlias" : "",
    "Exp" : "1220",
    "AccountType": "",
    "Routing" : "",
    "Name" : "",
    "Street" : "",
    "Zip" : "",
    "SetAsDefault" : false
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="164">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents an error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /GetPaymentMethod

Retrieves an existing payment method.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="200.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>PaymentMethodId</td><td>Yes</td><td>string</td><td>The ID of the payment method to retrieve.</td></tr><tr><td>ShowDeleted</td><td>No</td><td>boolean</td><td>A flag that can be set to retrieve deleted items. If set to <strong>true</strong>, only deleted items can be retrieved (i.e., payment methods that are not deleted will not be returned).</td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "PaymentMethodId" : "c123456_pm123456",
	"ShowDeleted" : false
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>PaymentMethodId</td><td>string</td><td>The ID of the payment method.</td><td></td></tr><tr><td>Revision</td><td>number</td><td>The revision number of the record to update. If this does not match the current revision number of the record the update will fail.</td><td></td></tr><tr><td>Token</td><td>string</td><td>Sola token that references a previously used payment method to use for the charge.</td><td></td></tr><tr><td>TokenType</td><td>string</td><td>The <code>Token</code> payment type.</td><td>CC, Check</td></tr><tr><td>TokenAlias</td><td>string</td><td>Custom name for the <code>Token</code>.</td><td></td></tr><tr><td>Exp</td><td>string</td><td>Credit card expiration date (in <code>MMYY</code> format).</td><td></td></tr><tr><td>AccountType</td><td>string</td><td><p>The account type - checking / savings</p><p><strong>Note:</strong> This field is only populated when <code>TokenType</code> is <strong>Check</strong>.</p></td><td></td></tr><tr><td>Issuer</td><td>string</td><td><p>The credit card issuer.</p><p><strong>Note:</strong> This field is only populated when <code>TokenType</code> is <strong>CC</strong>.</p></td><td></td></tr><tr><td>MaskedCardNumber</td><td>string</td><td><p>The masked credit card number.</p><p><strong>Note:</strong> This field is only populated when <code>TokenType</code> is <strong>CC</strong>.</p></td><td></td></tr><tr><td>Name</td><td>string</td><td><p>The name on the check.</p><p><strong>Note:</strong> This field is only populated when <code>TokenType</code> is <strong>Check</strong>.</p></td><td></td></tr><tr><td>Street</td><td>string</td><td>The building number and street name of the customer being billed.</td><td></td></tr><tr><td>Zip</td><td>string</td><td>The zip code of the customer being billed.</td><td></td></tr><tr><td>CreatedDate</td><td>string</td><td>The date and time the payment method was created, returned in ISO 8601 format (yyyy-MM-dd HH:mm:ss.fff).</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
    "PaymentMethodId": "c12345678_pm12345678",
    "Revision": 1,
    "Token": "qfjjf12m4iimkldfvoijv9012frljl0a",
    "TokenType": "cc",
    "TokenAlias": "",
    "Exp": "1220",
    "AccountType": "checking",
    "Issuer": "Visa",
    "MaskedCardNumber": "4xxxxxxxxxxx1111",
    "Name": "",
    "Street": "",
    "Zip": "",
    "CreatedDate": "2019-01-01 00:00:00.000"
}
```

### /DeletePaymentMethod

Removes a payment method from the customer’s record. This will fail if the payment method is the customer's only payment method and there are active schedules.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>PaymentMethodId</td><td>Yes</td><td>string</td><td>The ID of the payment method to retrieve.</td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.",
    "SoftwareVersion" : "1.0",
    "PaymentMethodId" : "c123456_pm123456"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="157">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /ListPaymentMethods

Return payment methods based on specific search parameters.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="188">Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>PageSize</td><td>No</td><td>integer</td><td>100</td><td>The maximum number of items to retrieve for this request.</td><td></td></tr><tr><td>NextToken</td><td>No</td><td>string</td><td></td><td>A token that can be sent in to the following request to get the next set of payment methods.</td><td></td></tr><tr><td>SortOrder</td><td>No</td><td>string</td><td>Ascending</td><td>The list order. Order is determined by payment method creation date.</td><td>Ascending, Descending</td></tr><tr><td>Filters</td><td>No</td><td>object</td><td><p>{</p><p>    "IsDeleted" : false</p><p>}</p></td><td><p>Filters that can be applied to limit the result set.</p><p>Filters will remove any items that do not contain the string for that filter value. If there are multiple filters applied, the item must match all of them.</p><p>Available filters:</p><ul><li>IsDeleted</li><li>CustomerId</li><li>PaymentMethodId</li><li>Token</li><li>TokenType</li><li>TokenAlias</li></ul></td><td></td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"NextToken" : "",
	"PageSize" : 500,
	"Filters" : {
		"IsDeleted" : false
	}
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="172">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>PaymentMethods</td><td>object[]</td><td><p>An array of payment method objects.</p><p>Refer to the <a href="#getpaymentmethod">/GetPaymentMethod</a><a href="https://docs.cardknox.com/api/recurring#getpaymentmethod"> </a>endpoint for the values that are returned for each payment method.</p></td><td></td></tr><tr><td>NextToken</td><td>string</td><td>A token to include in the next request to get the next set of results.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
  	"PaymentMethods": [
    	{
      		"PaymentMethodId": "c123456_pm123456",
      		"Token": "ervb24g45fcr2gsdbsgbwxbtrgxt314",
 		    "TokenType": "check",
		    "Street": "123",
		    "Zip": "08701",
		    "CreatedDate": "0001-01-01 12:00:AM",
		    "Revision": 1
	    },
    	{
    		"PaymentMethodId": "c123456_pm123457",
		    "Token": "mpq93n8519hq6pm29312m1n7mm3n7204",
		    "TokenType": "cc",
		    "CreatedDate": "0001-01-01 12:00:AM",
		    "Revision": 1
    	}
    ]
}
```

## Schedule Endpoints

### /CreateSchedule

Create a recurring payment schedule. Schedules have two main parameters: `IntervalType` and `IntervalCount`. You can set `IntervalType` to day, week, month, or year. The `IntervalCount` parameter determines the number of times the `IntervalType` should pass before the next payment schedule is triggered.

*Example 1:* To process a charge every two weeks, set `IntervalType` to week and set `IntervalCount` to 2. This specifies that two weeks should pass before initiating a new charge.

*Example 2:* To process a charge every 10 days, set `IntervalType` to day and set `IntervalCount` to 10. This specifies that 10 days should pass before initiating a new charge.

**Unsuccessful Payments:** If an attempted payment is unsuccessful (e.g., the card is declined), the system reschedules the charge for the following day. This can be done up to five times, provided that the rescheduled payment doesn’t overlap into the next payment cycle. After five unsuccessful attempts, or if rescheduling the payment as above will overlap into the next payment cycle, this individual payment will be canceled. The entire schedule remains in effect.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="190">Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>CustomerId</td><td>Yes*</td><td>string</td><td></td><td><p>Customer's unique ID number.</p><p>*Required if linking the schedule to an existing customer.</p></td><td></td></tr><tr><td>PaymentMethodId</td><td>No</td><td>string</td><td></td><td><p>The unique ID number of the payment method the schedule should use to process the transactions. If none is set, the default payment method on the customer will be used. </p><p>*Allowed if linking the schedule to an existing customer</p></td><td></td></tr><tr><td>NewCustomer</td><td>Yes*</td><td>object</td><td></td><td><p>The customer details. Refer to the <a href="/pages/-MbdYOaSwRkpUnOWYgE-#createcustomer">/CreateCustomer</a> endpoint for fields that can be set for this object.</p><p>*Required if <strong>not</strong> linking the schedule to an existing customer. This cannot be set if linking to an existing customer.<br></p></td><td></td></tr><tr><td>NewPaymentMethod</td><td>Yes*</td><td>object</td><td></td><td><p>The payment method details. Refer to the <a href="/pages/-MbdYOaSwRkpUnOWYgE-#createpaymentmethod">/CreatePaymentMethod</a> endpoint for fields that can be set for this object.</p><p>*Required if <strong>not</strong> linking the schedule to an existing customer. This cannot be set if linking to an existing customer.</p></td><td></td></tr><tr><td>IntervalType</td><td>Yes</td><td>string</td><td></td><td>Type of time interval.</td><td>day, week, month, year</td></tr><tr><td>Amount</td><td>Yes</td><td>decimal</td><td></td><td>Total amount of each transaction.</td><td>Must be a number with up to 2 decimal places</td></tr><tr><td>Currency</td><td>No</td><td>string</td><td></td><td><p>Currency code to be used when processing transactions</p><p><strong>Note:</strong> If the currency code used is not supported for the merchant and it does not run a transaction on schedule creation, the schedule will not error until the first transaction is processed.</p></td><td></td></tr><tr><td>TotalPayments</td><td>No</td><td>integer</td><td>infinite</td><td><p>Total count of scheduled payment occurrences, including the initial payment.</p><p><strong>Note:</strong> If left blank, the count is indefinite. This field cannot be set together with <code>EndDate</code>.</p></td><td></td></tr><tr><td>Cvv</td><td>No</td><td>string</td><td></td><td>The CVV value for the first transaction that is run if a transaction is run immediately. This value will not be applied to a future transaction run by the created schedule.</td><td></td></tr><tr><td>Description</td><td>No</td><td>string</td><td></td><td>Additional data sent with the transaction.</td><td></td></tr><tr><td>Invoice</td><td>No</td><td>string</td><td></td><td><p>Customer's invoice number for the transaction. </p><p>Use <code>Invoice</code> when available for improved duplicate handling (recommended).</p></td><td></td></tr><tr><td>PONumber</td><td>No</td><td>string</td><td></td><td>Customer's purchase order number for the transaction.</td><td></td></tr><tr><td>ScheduleName</td><td>No</td><td>string</td><td></td><td>Merchant's internal schedule identifier.</td><td></td></tr><tr><td>IntervalCount</td><td>No</td><td>integer</td><td>1</td><td><p>Number of time periods to elapse before the payment schedule is re-triggered. </p><p><em>Examples:</em></p><p>For every 28 days, set <code>IntervalType</code> to day and set <code>IntervalCount</code> to 28.</p><p>For every other month, set <code>IntervalType</code> to month and set <code>IntervalCount</code> to 2.</p></td><td></td></tr><tr><td>FailedTransactionRetryTimes</td><td>No</td><td>integer</td><td>5</td><td>Maximum number of times to retry before rescheduling to the next run time if the transaction fails. Retries are run on each subsequent day. If it’s set to 0, it will try one time total.</td><td></td></tr><tr><td>DaysBetweenRetriesnew</td><td>No</td><td>integer</td><td>1</td><td>Number of days between retries after a declined transaction.</td><td>Any natural number greater than 0.</td></tr><tr><td>SkipSaturdayAndHolidays</td><td>No</td><td>boolean</td><td>false</td><td>Indicates whether to process payments on the Sabbath and Jewish holidays.</td><td></td></tr><tr><td>CustReceipt</td><td>No</td><td>boolean</td><td>false</td><td>A flag that can be set to send the receipts to the email set in <code>Email</code> for the customer.</td><td></td></tr><tr><td>CalendarCulture</td><td>No</td><td>string</td><td>Gregorian</td><td>Type of calendar to use when executing month and year interval types.</td><td>Gregorian, Hebrew</td></tr><tr><td>UseDefaultPaymentMethodOnly</td><td>No</td><td>boolean</td><td>false</td><td>Indicates that the system should not try another card if the default card fails.</td><td></td></tr><tr><td>ScheduleRule</td><td>No</td><td>object</td><td></td><td><p>The schedule rule used to determine the next run time after each processed payment.</p><p>See <a href="https://docs.cardknox.com/api/recurring#appendix-a-schedule-rules">Appendix A</a> for more information on the <code>ScheduleRule</code> object.</p></td><td></td></tr><tr><td>StartDate</td><td>No</td><td>string</td><td>current date</td><td><p>Schedule start date in YYYY-MM-DD format. The start date must be within one year.</p><p>Unless the <code>StartDate</code> parameter is included to specify a future start date for the schedule, the first charge takes place immediately by default.</p></td><td></td></tr><tr><td>EndDate</td><td>No</td><td>string</td><td></td><td><p>Schedule expiration date in YYYY-MM-DD format.</p><p><strong>Note:</strong> This field cannot be set together with <code>TotalPayments</code>.</p></td><td></td></tr><tr><td>AfterMaxRetriesAction</td><td>No</td><td>string</td><td>ContinueNextInterval</td><td><p>The action to perform after a schedule hits the maximum number of failed attempts in a single interval.</p><ul><li><strong>Disable:</strong> Disables the schedule.</li><li><strong>ContinueNextInterval:</strong> Skips the current interval and continues at the next interval.</li></ul></td><td>Disable, ContinueNextInterval</td></tr><tr><td>AllowInitialTransactionToDecline</td><td>No</td><td>Boolean</td><td>False</td><td><p>Create the schedule even if the initial payment fails.</p><p><strong>Note:</strong> Can be used only if the <code>StartDate</code> is set to today's date (or left empty).</p></td><td></td></tr><tr><td>SplitInstruction</td><td>No</td><td>Object</td><td>False</td><td>On Instructional Funding accounts, add split instructions for each scheduled transaction. Format is an array of json objects, each having a mid and the amount for that mid.</td><td></td></tr><tr><td>CustomXX</td><td>No</td><td>String</td><td></td><td><p>Custom fields (19 available) used for custom data, such as customer comments and so forth.</p><p><code>Custom01</code> is reserved. Use <code>Custom02</code> - <code>Custom20</code>.</p></td><td></td></tr><tr><td>InitialAmount</td><td>No</td><td>String or Integer</td><td></td><td>Overrides Amount on initial transaction</td><td>5.99</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"CustomerId" : "c123456",
	"PaymentMethodId" : "c123456_pm654321",
	"Amount" : "1.23",
	"IntervalType" : "month",
	"IntervalCount" : 1,
	"ScheduleName" : "Sample Schedule",
	"TotalPayments" : 5,
	"SkipSaturdayAndHolidays" : false,
	"AllowInitialTransactionToDecline" : false,
	"CustReceipt" : false,
	"Custom01" : "customValue1",
	"Custom02" : "customValue2",
	"Custom03" : "customValue3"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="168">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>ScheduleId</td><td>string</td><td>The ID of the schedule that was created.</td><td></td></tr><tr><td>CustomerId</td><td>string</td><td>The ID of the customer that was created if the schedule was not linked to an existing customer.</td><td></td></tr><tr><td>PaymentMethodId</td><td>string</td><td>The ID of the payment method that was created if the schedule was not linked to an existing customer.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
    "ScheduleId" : "c123456_s123456"
}
```

### /UpdateSchedule

This command allows you to update some details of a schedule. You can only update information that does not change the actual schedule. For example, the `CustomerId` field cannot be updated (and it is not listed in the parameter table below). Also, you cannot update inactive schedules.

The following fields can be updated at any point:

* AfterMaxRetriesAction
* Amount
* CustomXX
* CustReceipt
* DaysBetweenRetries
* Description
* Invoice
* PaymentMethodId
* PONumber
* RetryAmount
* ScheduleName
* SkipSaturdayAndHolidays
* UseDefaultPaymentMethodOnly
* SplitInstruction

Any fields that are not set will use the default values (or if no default is indicated, they will be removed).

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="183">Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>Revision</td><td>Yes</td><td>integer</td><td></td><td>The revision number of the record to update. If this does not match the current revision number of the record, the update will fail.</td><td></td></tr><tr><td>ScheduleId</td><td>Yes</td><td>string</td><td></td><td>The ID of the schedule to update.</td><td></td></tr><tr><td>Amount</td><td>No</td><td>decimal</td><td></td><td>Transaction amount</td><td></td></tr><tr><td>Currency</td><td>No</td><td>string</td><td></td><td><p>Currency code to be used when processing transactions.</p><p><strong>Note:</strong> If the currency code used is not supported for the merchant and it does not run a transaction on schedule creation, the schedule will not error until the first transaction is processed.</p></td><td></td></tr><tr><td>TotalPayments</td><td>No</td><td>integer</td><td>infinite</td><td><p>Total count of scheduled payment occurrences, including the initial payment.</p><p>You can only change this field before a schedule has been completed. Additionally, you cannot set the value to be lower than the number of payments already processed.</p><p><strong>Note:</strong> This can be updated to at least the number of payments processed or higher.</p></td><td></td></tr><tr><td>Description</td><td>No</td><td>string</td><td></td><td>Additional data sent with the transaction.</td><td></td></tr><tr><td>Invoice</td><td>No</td><td>string</td><td></td><td><p>Customer's invoice number for the transaction </p><p>Use <code>Invoice</code> when available for improved duplicate handling (recommended).</p></td><td></td></tr><tr><td>PONumber</td><td>No</td><td>string</td><td></td><td>Customer's purchase order number for the transaction.</td><td></td></tr><tr><td>ScheduleName</td><td>No</td><td>string</td><td></td><td>Merchant's internal schedule identifier.</td><td></td></tr><tr><td>FailedTransactionRetryTimes</td><td>No</td><td>integer</td><td>5</td><td><p>Maximum number of times to retry before rescheduling to the next run time if the transaction fails. Retries are run on each subsequent day. If it’s set to 0, it will try one time.</p><p>You can only change this field before a schedule has been completed.</p></td><td></td></tr><tr><td>DaysBetweenRetries</td><td>No</td><td>integer</td><td></td><td>Number of days between retries after a declined transaction.</td><td>Any natural number greater than 0</td></tr><tr><td>SkipSaturdayAndHolidays</td><td>No</td><td>boolean</td><td>false</td><td>Indicates whether to process payments on the Sabbath and Jewish holidays.</td><td></td></tr><tr><td>CustReceipt</td><td>No</td><td>boolean</td><td>false</td><td>A flag that can be set to send the receipts to the email set in <code>Email</code> for the customer.</td><td></td></tr><tr><td>CalendarCulture</td><td>Yes</td><td>string</td><td>Gregorian</td><td><p>Type of calendar to use when executing month and year interval types.</p><p><strong>Note:</strong> You cannot change this once the schedule has begun.</p></td><td>Gregorian, Hebrew</td></tr><tr><td>UseDefaultPaymentMethodOnly</td><td>No</td><td>boolean</td><td>false</td><td>Indicates that the system should not try another card if the default card fails.</td><td></td></tr><tr><td>PaymentMethodId</td><td>No</td><td>string</td><td></td><td>The unique ID of the payment method the schedule should use to process the transactions</td><td></td></tr><tr><td>ScheduleRule</td><td>No</td><td>object</td><td></td><td><p>The schedule rule used to determine the next run time after each processed payment.</p><p>See <a href="#appendix-a-schedule-rules">Appendix A</a> for more information on the <code>ScheduleRule</code> object.</p></td><td></td></tr><tr><td>StartDate</td><td>Yes</td><td>string</td><td></td><td><p>Schedule start date in YYYY-MM-DD format. The start date must be within one year.</p><p><strong>Note:</strong> This cannot be changed once the schedule has begun.</p></td><td></td></tr><tr><td>EndDate</td><td>No</td><td>string</td><td></td><td><p>Schedule expiration date in YYYY-MM-DD format.</p><p><strong>Note:</strong> This field cannot be set together with <code>TotalPayments</code>. This cannot be changed once the schedule has completed.</p></td><td></td></tr><tr><td>AfterMaxRetriesAction</td><td>No</td><td>String</td><td>ContinueNextInterval</td><td><p>The action to perform after a schedule hits the maximum number of failed attempts in a single interval.</p><ul><li><strong>Disable:</strong> Disables the schedule.</li><li><strong>ContinueNextInterval:</strong> Skips the current interval and continues at the next interval.</li></ul></td><td>Disable, ContinueNextInterval</td></tr><tr><td>SplitInstruction</td><td>No</td><td>Object</td><td></td><td>On Instructional Funding accounts, update the split instructions for each scheduled transaction. Format is an array of json objects, each having a mid and the amount for that mid.</td><td></td></tr><tr><td>CustomXX</td><td>No</td><td>String</td><td></td><td><p>Custom fields (19 available) used for custom data, such as customer comments and so forth.</p><p><code>Custom01</code> is reserved. Use <code>Custom02</code> - <code>Custom20</code>.</p></td><td></td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"ScheduleId" : "c123456_s123456",
	"Amount" : "1.23",
	"ScheduleName" : "Sample Schedule",
	"PaymentMethodId" : "c123456_pm654321",
	"TotalPayments" : 5,
	"SkipSaturdayAndHolidays" : false,
	"CustReceipts" : false,
	"Custom01" : "customValue1",
	"Custom02" : "customValue2",
	"Custom03" : "customValue3"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="162">Parameter</th><th>Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /EnableSchedule

Restart a schedule that was previously disabled.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="186.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>ScheduleId</td><td>Yes</td><td>string</td><td>The ID of the schedule to enable.</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"ScheduleId" : "c123456_s123456"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="168">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>,this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /DisableSchedule

Stop, pause, cancel, or inactivate an active schedule.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="191.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>ScheduleId</td><td>Yes</td><td>string</td><td>The ID of the schedule to disable.</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"ScheduleId" : "c123456_s123456"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="171">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /DeleteSchedule

Removes a schedule. You can only delete a schedule that is not active.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="194.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>ScheduleId</td><td>Yes</td><td>string</td><td>The ID of the schedule to delete.</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"ScheduleId" : "c123456_s123456"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="154">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": ""
}
```

### /GetSchedule

Retrieves the details for a schedule.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="189.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>ScheduleId</td><td>Yes</td><td>string</td><td>The ID of the schedule to retrieve.</td></tr><tr><td>ShowDeleted</td><td>No</td><td>boolean</td><td>A flag that can be set to retrieve deleted items. If set to <strong>true</strong>, only deleted items can be retrieved (i.e., schedules that are not deleted will not be returned).</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"ScheduleId" : "c123456_s123456",
    "ShowDeleted" : false
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="168">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>Revision</td><td>integer</td><td>The revision number of the record to update. If this does not match the current revision number of the record, the update will fail.</td><td></td></tr><tr><td>ScheduleId</td><td>string</td><td>Schedule reference number.</td><td></td></tr><tr><td>ScheduleName</td><td>string</td><td>Schedule name.</td><td></td></tr><tr><td>CustomerId</td><td>string</td><td>Customer's unique ID number.</td><td></td></tr><tr><td>PaymentMethodId</td><td>string</td><td><p>The unique ID number of the payment method the schedule uses to process the transactions</p><p><strong>Note:</strong> Only populated when a specific PaymentMethodId was sent in on creating/updating schedule</p></td><td></td></tr><tr><td>IsDeleted</td><td>boolean</td><td>A  flag indicating whether the record is deleted.</td><td></td></tr><tr><td>UseDefaultCardOnly</td><td>boolean</td><td>Indicates that the system should not try another card if the default card fails.</td><td></td></tr><tr><td>FailedTransactionRetryTimes</td><td>integer</td><td>Maximum number of times to retry before rescheduling to the next run time if the transaction fails. The tries are spaced apart into 1-day intervals.</td><td></td></tr><tr><td>FailedAttemptsInCurrentInterval</td><td>integer</td><td>The number of unsuccessful transactions that were processed for the current interval. This value will reset to 0 at the start of the next interval.</td><td></td></tr><tr><td>DaysBetweenRetries</td><td>integer</td><td>Number of days between retries after a declined transaction.</td><td></td></tr><tr><td>ScheduleRule</td><td>object</td><td><p>The schedule rule used to determine the next run time after each processed payment.</p><p>See <a href="#appendix-a-schedule-rules">Appendix A</a> for more information on the <code>ScheduleRule</code> object.</p></td><td></td></tr><tr><td>StartDate</td><td>string</td><td>Schedule start date in YYYY-MM-DD format.</td><td></td></tr><tr><td>EndDate</td><td>string</td><td>Schedule end date in YYYY-MM-DD format.</td><td></td></tr><tr><td>AllowInitialTransactionToDecline</td><td>boolean</td><td>Indicates whether the schedule was set up to allow the first transaction to be declined.</td><td></td></tr><tr><td>Description</td><td>string</td><td>Additional data sent with the transaction (optional).</td><td></td></tr><tr><td>Amount</td><td>decimal</td><td>Transaction amount.</td><td></td></tr><tr><td>Currency</td><td>string</td><td>Currency code to be used when processing transactions.</td><td></td></tr><tr><td>TotalPayments</td><td>integer</td><td>Total count of scheduled payment occurrences, including the initial payment.</td><td></td></tr><tr><td>PaymentsProcessed</td><td>integer</td><td>The number of payments processed by the schedule.</td><td></td></tr><tr><td>SkipSaturdayAndHolidays</td><td>boolean</td><td>Indicates whether to process payments on the Sabbath and Jewish holidays.</td><td></td></tr><tr><td>IntervalType</td><td>string</td><td>Type of time interval.</td><td></td></tr><tr><td>IntervalCount</td><td>integer</td><td><p>Number of time periods to elapse before the payment schedule is re-triggered. </p><p><strong>Note:</strong> Refer to the <a href="/pages/-MbdYOaSwRkpUnOWYgE-#createschedule">/CreateSchedule</a> endpoint for more details.</p></td><td></td></tr><tr><td>LastTransactionStatus</td><td>string</td><td>The status of the last transaction run by the schedule.</td><td></td></tr><tr><td>LastTransactionError</td><td>string</td><td>The error message of the last transaction if the status was <strong>Error</strong>.</td><td></td></tr><tr><td>LastProjectedPaymentDate</td><td>string</td><td><p>The projected payment date of the last transaction that the schedule will run.</p><p><strong>Note:</strong> This may not be 100% accurate if that last date falls on a Saturday or Holiday and <code>SkipSaturdayAndHolidays</code> is set.</p></td><td></td></tr><tr><td>Invoice</td><td>string</td><td>Customer's invoice number for the transaction.</td><td></td></tr><tr><td>PONumber</td><td>string</td><td>Customer's purchase order number for the transaction.</td><td></td></tr><tr><td>CustReceipt</td><td>boolean</td><td>A flag indicating whether receipts will be sent to the email set in <code>Email</code> for the customer.</td><td></td></tr><tr><td>NextScheduledRunTime</td><td>string</td><td>The date and time that the schedule will next run.</td><td></td></tr><tr><td>InitialRunTime</td><td>string</td><td>The date and time of the first transaction run by the schedule.</td><td></td></tr><tr><td>LastRunTime</td><td>string</td><td>The date and time of the last transaction run by the schedule.</td><td></td></tr><tr><td>IsActive</td><td>boolean</td><td>A flag indicating whether the schedule is currently enabled/active.</td><td></td></tr><tr><td>CalendarCulture</td><td>string</td><td>Type of calendar to use when executing month and year interval types.</td><td></td></tr><tr><td>CreatedDate</td><td>string</td><td>Date that the schedule was created.</td><td></td></tr><tr><td>CustomerNumber</td><td>string</td><td>Merchant's internal customer identifier.</td><td></td></tr><tr><td>Email</td><td>string</td><td>Customer's email address.</td><td></td></tr><tr><td>BillFirstName</td><td>string</td><td>Customer's first name for their billing profile.</td><td></td></tr><tr><td>BillMiddleName</td><td>string</td><td>Customer's middle name or initial for their billing profile.</td><td></td></tr><tr><td>BillLastName</td><td>string</td><td>Customer's last/family name for their billing profile.</td><td></td></tr><tr><td>BillCompany</td><td>string</td><td>Customer's company for their billing profile.</td><td></td></tr><tr><td>AfterMaxRetriesAction</td><td>string</td><td><p>The action to perform after a schedule hits the maximum number of failed attempts in a single interval.</p><ul><li><strong>Disable:</strong> Disables the schedule.</li><li><strong>ContinueNextInterval:</strong> Skips the current interval and continues at the next interval.</li></ul></td><td>Disable, ContinueNextInterval</td></tr><tr><td>SplitInstruction</td><td>Object</td><td>On Instructional Funding accounts, the split instructions used for each scheduled transaction.</td><td></td></tr><tr><td>CustomXX</td><td>string</td><td><p>Custom fields (19 available) used for custom data, such as customer comments and so forth.</p><p><code>Custom01</code> is reserved.</p></td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum" : "r1234567890",
    "Result" : "S",
    "Error" : "",
    "Revision" : 1,
    "ScheduleId" : "c123456_s123456",
    "ScheduleName" : "Sample Schedule",
    "CustomerId" : "c123456",
    "PaymentMethodId": "c123456_p987654",
    "IsDeleted" : false,
    "UseDefaultCardOnly" : false,
    "FailedTransactionRetryTimes": 5,
    "DaysBetweenRetries" : 2,
    "IntervalType" : "month",
    "IntervalCount" : 12
    "ScheduleRule" : {
      "RuleType" : "Nth",
      "N" : 1,
      "NthOfType" : "Weekday"
     }
    "StartDate" : "2020-04-27",
    "EndDate" :  "2021-04-27",
    "AllowInitialTransactionToDecline" : false,
    "Description" : "Sample Schedule",
    "Amount" : 1.23,
    "TotalPayments" : 12,
    "PaymentsProcessed" : 2,
    "SkipSaturdayAndHolidays" : false,
    "LastTransactionStatus" : "Approved",
    "LastTransactionError" : ""
    "LastProjectedPaymentDate" : "2021-04-27",
    "Invoice" : "1234567",
    "PONumber" : "1234567",
    "CustReceipts" : false,
    "NextScheduledRunTime" : "2020-06-27",
    "InitialRunTime" : "2020-04-27 01:03:50",
    "LastRunTime" : "2020-05-27 012:15:34",
    "IsActive" : true,
    "CalendarCulture" : "Gregorian",
    "CreatedDate" : "2020-03-21 10:15:40",
    "CustomerNumber" :  "123456",
    "Email" : "sample@example.com",
    "BillFirstName" : "John",
    "BillMiddleName" : "G",
    "BillLastName" : "Doe",
    "BillCompany" : "ACME Inc.",
    "AfterMaxRetriesAction" : "Disable",
    "SplitInstruction": [
		{
			"xMid": "1234",
			"xAmount": "1.10"
		},
		{
			"xMid": "5678",
			"xAmount": "0.13"
		}
	],
    "Custom01" : "customValue1",
    "Custom02" : "customValue2",
    "Custom03" : "customValue3"
}
```

### /GetUpcomingPaymentDates

Returns a list of upcoming payment dates (up to 100) for a specific schedule.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>ScheduleId</td><td>Yes</td><td>string</td><td></td><td>The ID of the schedule to retrieve.</td><td></td></tr><tr><td>NumberOfPayments</td><td>Yes</td><td>integer</td><td></td><td>The number of payment dates to retrieve.</td><td>An integer between 1 and 100 (inclusive)</td></tr><tr><td>CalendarCulture</td><td>No</td><td>string</td><td>Gregorian</td><td>The culture the dates should be returned in.</td><td>Gregorian, Hebrew</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"ScheduleId" : "c123456_s123456",
    "NumberOfPayments" : 12,
    "CalendarCulture" : "Gregorian",
    "ShowDeleted" : false
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="184">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents an error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>UpcomingPaymentDates</td><td>string[]</td><td>The upcoming payment dates for the specified schedule in the format yyyy-mm-dd.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
    "UpcomingPaymentDates" : [
        "2020-01-01",
		"2020-02-01",
		"2020-03-01"
    ]
}
```

### /ListSchedules

Returns a list of schedules that are sorted by creation date (ascending or descending order). You can use search filters to narrow the search results that are returned.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>PageSize</td><td>No</td><td>integer</td><td>100</td><td>The maximum number of items to retrieve for this request.</td><td></td></tr><tr><td>NextToken</td><td>No</td><td>string</td><td></td><td>A token that can be sent in to the following request to get the next set of schedules.</td><td></td></tr><tr><td>SortOrder</td><td>No</td><td>string</td><td>Ascending</td><td>The list order. Order is determined by schedule creation date.</td><td>Ascending, Descending</td></tr><tr><td>Filters</td><td>No</td><td>object</td><td><p>{</p><p>    "IsDeleted" : false</p><p>}</p></td><td><p>Filters that can be applied to limit the result set.</p><p>Filters will remove any items that don't contain the string for that filter value. If there are multiple filters applied the item must match all of them.</p><p>Available filters:</p><ul><li>IsDeleted</li><li>Active</li><li>Amount</li><li>IntervalCount</li><li>CustomerId</li><li>ScheduleId</li><li>BillFirstName</li><li>BillMiddleName</li><li>BillLastName</li><li>BillName</li><li>Email</li><li>BillCompany</li><li>CustomerNumber</li><li>ScheduleName</li><li>Description</li><li>IntervalType</li><li>StartDate</li><li>PaymentsRemaining</li></ul></td><td></td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"NextToken" : "",
	"PageSize" : 500,
	"Filters" : {
		"IsDeleted" : false
	}
}

```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="150">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents an error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>Schedules</td><td>object[]</td><td><p>An array of schedule objects. Refer to the <a href="https://cardknox.atlassian.net/wiki/spaces/REC/pages/92045335/Recurring+v2+Api#/GetSchedule">/GetSchedule</a> endpoint for the values that are returned for each schedule.</p><p><strong>Note:</strong> The <code>ScheduleRule</code> field is not returned by this endpoint for each schedule.</p></td><td></td></tr><tr><td>NextToken</td><td>string</td><td>A token to include in the next request to get the next set of results.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
	"Schedules" : [
		{
       	 	"ScheduleId": "c123456_s123456",
      		"Revision": 5,
      		"CustomerId": "c123456",
	    	"FailedTransactionRetryTimes": 5,
		    "StartDate": "2018-04-27",
		    "Amount": 0.03,
		    "TotalPayments": 3,
		    "PaymentsProcessed": 2,
		    "IntervalType": "Day",
		    "IntervalCount": 1,
		    "LastTransactionStatus": "Approved",
		    "LastProjectedPaymentDate": "2019-05-16",
		    "InitialRunTime": "2019-05-16 01:03:50",
		    "LastRunTime": "2019-06-19 01:03:48",
		    "CalendarCulture": "Gregorian",
		    "CreatedDate": "2018-04-26 16:33:27.571",
		    "CustomerNumber": "1",
		    "BillFirstName": "John",
		    "BillLastName": "Smith",
	     	"BillCompany": "ACME Inc.",
			"SplitInstruction": [
				{
					"xMid": "1234",
					"xAmount": "1.10"
				},
				{
					"xMid": "5678",
					"xAmount": "0.13"
				}
			]
    	}
    ]
}
```

## Transaction Endpoints

### /ProcessTransaction

Processes a single payment transaction for a customer. You can specify a backup payment method to use should the initial payment fail. If desired, you can have the system send an email receipt of the transaction to the customer.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td></tr><tr><td>CustomerId</td><td>Yes</td><td>string</td><td></td><td><p>Customer's unique ID number.</p><p><br>*This field is required if PaymentMethodID is not passed in. Valid combinations are below:</p><ul><li>PM ID only</li><li>Customer ID Only (will use default PM on file)</li><li>Customer ID &#x26; new PM info</li></ul></td></tr><tr><td>PaymentMethodId</td><td>Yes*</td><td>string</td><td></td><td><p>The ID of the payment method to use for the transaction.</p><p>*Required if using an existing non-default payment method.<br></p></td></tr><tr><td>Amount</td><td>Yes</td><td>decimal</td><td></td><td>The amount of the transaction.</td></tr><tr><td>Tax<br></td><td>No</td><td>decimal</td><td></td><td>The tax portion that is included in the total transaction amount.</td></tr><tr><td>PaymentDetails</td><td>No*</td><td>object</td><td></td><td><p>The details for a new method of payment.</p><p>*Required if <strong>not</strong> using an existing payment method.</p><p><strong>Note:</strong> Refer to the <a href="/pages/-MbdYOaSwRkpUnOWYgE-#createpaymentmethod">/CreatePaymentMethod</a> endpoint for available and required fields.</p></td></tr><tr><td>UseBackupPaymentMethods</td><td>No</td><td>boolean</td><td>false</td><td>Indicates that the system should try another card if the default card fails.</td></tr><tr><td>Invoice</td><td>No</td><td>string</td><td></td><td><p>Customer's invoice number for the transaction. </p><p>Use <code>Invoice</code> when available for improved duplicate handling (recommended).</p></td></tr><tr><td>PONumber</td><td>No</td><td>string</td><td></td><td>Customer's purchase order number for the transaction.</td></tr><tr><td>Description</td><td>No</td><td>string</td><td></td><td>Additional data sent with the transaction.</td></tr><tr><td>AllowDuplicates</td><td>No</td><td>boolean</td><td>false</td><td>A flag indicating whether to disable duplicate detection. Useful for testing, but it is not suggested that this be set to <strong>true</strong> in production.</td></tr><tr><td>CustReceipt</td><td>No</td><td>boolean</td><td></td><td>A flag that can be set to send the receipts to the email address set in <code>Email</code> for the customer.</td></tr><tr><td>Cvv</td><td>No</td><td>string</td><td></td><td>The CVV value for the transaction.</td></tr><tr><td>Email</td><td>No</td><td>string</td><td></td><td>Customer's email address.</td></tr><tr><td>Fax</td><td>No</td><td>string</td><td></td><td>Customer's fax number.</td></tr><tr><td>BillFirstName</td><td>Yes*</td><td>string</td><td></td><td><p>Customer's first name for their billing profile.</p><p>*This field is required if <code>BillLastName</code> and <code>BillCompany</code> are not passed in.</p></td></tr><tr><td>BillMiddleName</td><td>No</td><td>string</td><td></td><td>Customer's middle name or initial for their billing profile.</td></tr><tr><td>BillLastName</td><td>Yes*</td><td>string</td><td></td><td><p>Customer's last/family name for their billing profile.</p><p>*This field is required if <code>BillFirstName</code> and <code>BillCompany</code> are not passed in.</p></td></tr><tr><td>BillCompany</td><td>Yes*</td><td>string</td><td></td><td><p>Customer's company for their billing profile.</p><p>*This field is required if <code>BillFirstName</code> and <code>BillLastName</code> are not passed in.</p></td></tr><tr><td>BillStreet</td><td>No</td><td>string</td><td></td><td>Customer's street address for their billing profile.</td></tr><tr><td>BillStreet2</td><td>No</td><td>string</td><td></td><td>Customer's street address second line for their billing profile.</td></tr><tr><td>BillCity</td><td>No</td><td>string</td><td></td><td>Customer's city for their billing profile.</td></tr><tr><td>BillState</td><td>No</td><td>string</td><td></td><td>Customer's state for their billing profile.</td></tr><tr><td>BillZip</td><td>No</td><td>string</td><td></td><td>Customer's ZIP code or postal code for their billing profile.</td></tr><tr><td>BillCountry</td><td>No</td><td>string</td><td></td><td>Customer's country for their billing profile.</td></tr><tr><td>BillPhone</td><td>No</td><td>string</td><td></td><td>Customer's phone number for their billing profile.</td></tr><tr><td>BillMobile</td><td>No</td><td>string</td><td></td><td>Customer's mobile number for their billing profile.</td></tr><tr><td>ShipFirstName</td><td>No</td><td>string</td><td></td><td>Customer’s first name for their shipping profile.</td></tr><tr><td>ShipMiddleName</td><td>No</td><td>string</td><td></td><td>Customer’s middle name or initial for their shipping profile.</td></tr><tr><td>ShipLastName</td><td>No</td><td>string</td><td></td><td>Customer’s last/family name for their shipping profile.</td></tr><tr><td>ShipCompany</td><td>No</td><td>string</td><td></td><td>Customer’s company name for their shipping profile.</td></tr><tr><td>ShipStreet</td><td>No</td><td>string</td><td></td><td>Customer’s street address for their shipping profile.</td></tr><tr><td>ShipStreet2</td><td>No</td><td>string</td><td></td><td>Customer’s street address second line for their shipping profile.</td></tr><tr><td>ShipCity</td><td>No</td><td>string</td><td></td><td>Customer’s city for their shipping profile.</td></tr><tr><td>ShipState</td><td>No</td><td>string</td><td></td><td>Customer’s state for their shipping profile.</td></tr><tr><td>ShipZip</td><td>No</td><td>string</td><td></td><td>Customer’s ZIP or postal code for their shipping profile.</td></tr><tr><td>ShipCountry</td><td>No</td><td>string</td><td></td><td>Customer’s country for their shipping profile.</td></tr><tr><td>ShipPhone</td><td>No</td><td>string</td><td></td><td>Customer’s phone number for their shipping profile.</td></tr><tr><td>ShipMobile</td><td>No</td><td>string</td><td></td><td>Customer’s mobile number for their shipping profile.</td></tr><tr><td>ShipEmail</td><td>No</td><td>string</td><td></td><td>Customer’s shipping email address for their shipping profile.</td></tr><tr><td>CustomXX</td><td>No</td><td>string</td><td></td><td><p>Custom fields (19 available) used for custom data, such as customer comments and so forth.</p><p><code>Custom01</code> is reserved. Use <code>Custom02</code> - <code>Custom20</code>.</p></td></tr><tr><td>Currency</td><td>No</td><td>string</td><td></td><td>Currency code for the transaction.</td></tr><tr><td>SplitInstruction</td><td>No</td><td>object</td><td>sale</td><td>On Instructional Funding accounts, add split instructions for the transaction. Format is an array of json objects, each having a mid and the amount for that mid.</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"PaymentMethodId" : "c123456_pm123456",
	"Amount" : 1.23,
	"PaymentDetails" : null,
	"UseBackupPaymentMethods" : false,
	"Invoice" : "1234567",
	"PONumber" : "1234567",
	"Description" : "Sample One Time Transaction",
	"AllowDuplicates" : false,
	"Cvv" : "123",
	"BillStreet" : "123 Main St.",
	"splitinstruction":[
		{
			"xmid":53141,
			"xamount":1.01
		},
		{
			"xmid":53138,
		 	"xamount":0.01
		}
	]
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>GatewayRefnum</td><td>string</td><td>The gateway reference number for the transaction.</td><td></td></tr><tr><td>GatewayStatus</td><td>string</td><td>The status of the transaction passed back by the gateway.</td><td>Approved, Declined, Error</td></tr><tr><td>GatewayErrorMessage</td><td>string</td><td>The error message for the transaction passed back by the gateway if the status indicates an error.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
    "GatewayRefnum" : "1234567890"
    "GatewayStatus" : "Approved",
    "GatewayErrorMessage" : ""
}
```

### /GetTransaction

Returns the details of an existing transaction, such as transaction date and customer ID. Also returned are the transaction's processing status and any error messages from the gateway.

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>RefNum</td><td>Yes</td><td>string</td><td>The ID of the transaction to retrieve.</td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"RefNum" : "c123456_s123456_t123456"
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>TransactionId</td><td>string</td><td>The ID of the retrieved transaction.</td><td></td></tr><tr><td>ScheduleId</td><td>string</td><td>The ID of the schedule that the transaction was run for.</td><td></td></tr><tr><td>CustomerId</td><td>string</td><td>The ID of the customer that the transaction was run for.</td><td></td></tr><tr><td>PaymentMethodId</td><td>string</td><td>The ID of the payment method used in the transaction.</td><td></td></tr><tr><td>TransactionDate</td><td>string</td><td>The date the transaction was run.</td><td></td></tr><tr><td>GatewayRefNum</td><td>string</td><td>The reference number generated by the gateway for the transaction.</td><td></td></tr><tr><td>GatewayStatus</td><td>string</td><td>The transaction processing status returned by the gateway.</td><td>Approved, Declined, Error</td></tr><tr><td>GatewayError</td><td>string</td><td>The error message returned by the gateway if <code>GatewayStatus</code> indicates an error.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
  "RefNum": "r1234567890",
  "Result": "S",
  "Error": "",
  "TransactionId": "c123456_s123456_t123456",
  "ScheduleId": "c123456_s123456",
  "CustomerId": "c123456",
  "PaymentMethodId": "c123456_pm123456",
  "TransactionDate": "2019-08-02 15:06:57",
  "GatewayRefNum": "1234567890",
  "GatewayStatus": "Approved",
  "GatewayError": ""
}
```

### /ListTransactions

Returns a list of transactions, that are sorted by transaction date (in ascending or descending order). You can use specific search criteria to define which transactions to return.

{% hint style="info" %}
`/ListTransactions` will only return transactions initiated from a schedule. Single transactions won't be returned, even if linked to a customer.
{% endhint %}

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Required</th><th width="150">Type</th><th width="150">Default Value</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Default Value</td><td>Description</td><td>Valid Values</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td></td><td>The name of the software making the request.</td><td></td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td></td><td>The version of the software making the request.</td><td></td></tr><tr><td>PageSize</td><td>No</td><td>integer</td><td>100</td><td>The maximum number of items to retrieve for this request.</td><td></td></tr><tr><td>NextToken</td><td>No</td><td>string</td><td></td><td>A token that can be sent in to the following request to get the next set of transactions.</td><td></td></tr><tr><td>SortOrder</td><td>No</td><td>string</td><td>Ascending</td><td>The list order. Order is determined by the date the transaction ran.</td><td>Ascending, Descending</td></tr><tr><td>Filters</td><td>No</td><td>object</td><td></td><td><p>Filters that can be applied to limit the result set.</p><p>Filters will remove any items that do not contain the string for that filter value. If there are multiple filters applied, the item must match all of them.</p><p>Available filters:</p><ul><li>IsApproved</li><li>FromDate</li><li>ToDate</li><li>CustomerId</li><li>ScheduleId</li><li>PaymentMethodId</li><li>TransactionId</li></ul></td><td></td></tr></tbody></table>

**Sample Request**

```javascript
{
	"SoftwareName" : "ACME Inc.", 
	"SoftwareVersion" : "1.0",
	"NextToken" : "",
	"PageSize" : 500,
	"Filters" : {
		"IsApproved" : true
	}
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th>Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents  error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>Transactions</td><td>object[]</td><td><p>An array of transaction objects.</p><p>Refer to the <a href="/pages/-MbdYOaSwRkpUnOWYgE-#gettransaction">/GetTransaction</a> endpoint for the values that are returned for each transaction.</p></td><td></td></tr><tr><td>NextToken</td><td>string</td><td>A token to include in the next request to get the next set of results.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
    "RefNum": "r1234567890",
    "Result": "S",
    "Error": "",
	"Transactions" : [
		{
        	"TransactionId": "c123456_s123456_t123456",
        	"ScheduleId": "c123456_s123456",
        	"CustomerId": "c123456",
      		"PaymentMethodId": "c123456_pm123456",
      		"TransactionDate": "2019-08-02 15:06:57",
      		"GatewayRefNum": "1234567890",
      		"GatewayStatus": "Approved"
    	},
    	{
     		"TransactionId": "c123456_s123456_t123456",
		    "ScheduleId": "c123456_s123456",
		    "CustomerId": "c123456",
      		"PaymentMethodId": "c123456_pm123456",
   		    "TransactionDate": "2019-08-07 16:34:16",
    		"GatewayRefNum": "1234567891",
    	    "GatewayStatus": "Approved"
    	},
    ]
}
```

## Merchant Endpoints

### /UpdateMerchant

Changes the recurring report settings for the merchant, which includes:

* Email address&#x20;
* Enabled status
* Show Details setting&#x20;

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="193.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr><tr><td>Revision</td><td>Yes</td><td>integer</td><td>The current revision number of the record. If his value is incorrect the update will fail.</td></tr><tr><td>ScheduleReportSettings</td><td>Yes</td><td>object</td><td><p>The schedule report settings for the merchant:</p><ul><li><strong>Enabled</strong> (boolean): A flag indicating if the system should send the report.</li><li><strong>EmailAddresses</strong> (array of string): One or more email addresses that will be sent the report.</li><li><strong>ShowDetails</strong> (boolean): A flag indicating if the system should send the detailed version of the report with transaction details. The system can send the detailed version sent only if there are 500 transactions or less.</li></ul></td></tr><tr><td>MaxRetriesReachedNotification</td><td>No</td><td>object</td><td><p>Settings for an email notification when a schedule reaches the maximum number of retries in an interval.</p><ul><li><strong>Enabled</strong> (boolean): A flag indicating if the system should send the email notification.</li><li><strong>EmailAddresses</strong> (array of string): One or more email addresses that will be sent the notification.</li></ul><p>Note: Values are only updated if they are not set to null. To clear the EmailAddresses, an empty array must be passed in.</p></td></tr></tbody></table>

**Sample Request**

```javascript
{
    "SoftwareName" : "ACME Inc.", 
    "SoftwareVersion" : "1.0",
    "Revision" : 1,
    "ScheduleReportSettings" : {
      "Enabled" : true,
      "EmailAddresses" : [
        "sample@example.com",
        "sample2@example.com"
      ],
      "ShowDetails" : true
    },
    "MaxRetriesReachedNotification" : {
      "Enabled" : true,
      "EmailAddresses" : [
        "sample@example.com",
        "sample2@example.com"
      ]
    }
}
```

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="154">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
  "RefNum": "r1234567890",
  "Result": "S",
  "Error": ""
}
```

### /DescribeMerchant

Returns the merchant's current configuration for recurring report settings (see [/UpdateMerchant](/api/recurring#updatemerchant)).

#### Request Body (JSON)

<table data-header-hidden><thead><tr><th width="187.7142857142857">Parameter</th><th width="150">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Required</td><td>Type</td><td>Description</td></tr><tr><td>SoftwareName</td><td>Yes</td><td>string</td><td>The name of the software making the request.</td></tr><tr><td>SoftwareVersion</td><td>Yes</td><td>string</td><td>The version of the software making the request.</td></tr></tbody></table>

**Sample Request**

{ "SoftwareName" : "ACME Inc.", "SoftwareVersion" : "1.0" }

#### Response Body (JSON)

<table data-header-hidden><thead><tr><th width="165">Parameter</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>Result</td><td>char</td><td>The result of the API call. <strong>S</strong> represents success, <strong>E</strong> represents error.</td><td>S, E</td></tr><tr><td>RefNum</td><td>string</td><td>A unique request ID.</td><td></td></tr><tr><td>Error</td><td>string</td><td>If the <code>Result</code> parameter contains a value of <strong>E</strong>, this parameter will contain any relevant error messages.</td><td></td></tr><tr><td>Revision</td><td>integer</td><td>The current revision number of the record.</td><td></td></tr><tr><td>ScheduleReportSettings</td><td>object</td><td><p>The schedule report settings for the merchant:</p><ul><li><strong>Enabled</strong> (boolean): A flag indicating if the system should send the report.</li><li><strong>EmailAddresses</strong> (array of string): One or more email addresses that will be sent the report.</li><li><strong>ShowDetails</strong> (boolean): A flag indicating if the system should send the detailed version of the report with transaction details. The system can send the detailed version sent only if there are 500 transactions or less.</li></ul></td><td></td></tr><tr><td>MaxRetriesReachedNotification</td><td>object</td><td><p>The max retry reached notification settings for the merchant:</p><ul><li><strong>Enabled</strong> (boolean): A flag indicating if the system should send the email notification.</li><li><strong>EmailAddresses</strong> (array of string): One or more email addresses that will be sent the notification.</li></ul></td><td></td></tr></tbody></table>

**Sample Response**

```javascript
{
  "RefNum": "r1234567890",
  "Result": "S",
  "Error": "",
  "ScheduleReportSettings" : {
    "Enabled" : true,
    "EmailAddresses" : [
      "sample@example.com",
      "sample2@example.com"
    ],
    "ShowDetails" : true
  },
  "MaxRetriesReachedNotification" : {
    "Enabled" : true,
    "EmailAddresses" : [
      "sample@example.com",
      "sample2@example.com"
    ]
  }
}
```

## **Appendix A - Schedule Rules**

### Fields

<table data-header-hidden><thead><tr><th width="157">Name</th><th width="150">Type</th><th>Description</th><th>Valid Values</th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td><td>Valid Values</td></tr><tr><td>RuleType</td><td>string</td><td>The type of rule to create.</td><td>On, Nth</td></tr><tr><td>DayOfWeek</td><td>integer</td><td>The day of the week to run the schedule on.</td><td>1 - 7</td></tr><tr><td>DayOfMonth</td><td>integer</td><td>The day of the month to run the schedule on.</td><td><p>1 - 31 for gregorian schedules</p><p>1 - 30 for hebrew schedules</p></td></tr><tr><td>MonthOfYear</td><td>integer</td><td>The month of the year to run the schedule on.</td><td><p>1 - 12 for gregorian schedules</p><p>1 - 13 for hebrew schedules</p></td></tr><tr><td>N</td><td>integer</td><td>The nth value to run the schedule on.</td><td>Any positive or negative integer other than zero</td></tr><tr><td>NthOfType</td><td>string</td><td>The type that the nth value should be applied to.</td><td>Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Day, Weekday, WeekendDay</td></tr></tbody></table>

### RuleType

There are two types of rules: `On` and `Nth`.

`On` rules run on a specified day within the specified interval (*Examples:* every Sunday, the 3rd of each month, or February 17th each year).

`Nth` rules run on nth (or nth from last) of the specified interval (*Examples:* the first weekday of each month, or the second to last Sunday of each month).

### Restrictions

* `DayOfWeek`, `DayOfMonth`, and `MonthOfYear` can only be used when `RuleType` is `On`.
* `DayOfWeek` can only be used for weekly schedules.
* `DayOfMonth` can only be used for monthly and yearly schedules.
* `MonthOfYear` can only be used for yearly schedules.
* `N` and `NthOfType` can only be used when `RuleType` is `Nth`.
* Weekly schedules can only have a `RuleType` of `On`.
* Daily schedules cannot use rule types.

### Additional Notes

* Weekdays begin with Monday and continue through Friday.
* Weekends are Saturday and Sunday.
* The following are the values for the days of the week:
  * Sunday = 1
  * Monday = 2
  * Tuesday = 3
  * Wednesday = 4
  * Thursday = 5
  * Friday = 6
  * Saturday = 7
* The following are the values for `MonthOfYear` for the **Hebrew** calendar:
  * Tishrei = 1
  * Cheshvan = 2
  * Kislev = 3
  * Teves = 4
  * Shevat = 5
  * Adar = 6
  * (Adar Beis = 7 in a leap year)
  * Nisan = 7 (8 in a leap year)
  * Iyar = 8 (9 in a leap year)
  * Sivan = 9 (10 in a leap year)
  * Tamuz = 10 (11 in a leap year)
  * Av = 11 (12 in a leap year)
  * Elul = 12 (13 in a leap year)
* Use a negative number as the value of `N` to run as the nth from last.
  * An `N` value of `1` indicates the first
  * An `N` value of -1 indicates the last
* A schedule with an `IntervalCount` greater than 1 will first run on the next matching date and will skip intervals from now on.
  * *Example:* The current date is January 1st, 2023 (a Wednesday), and the schedule rule says it should run on the first Thursday of the month with an `IntervalCount` of 2. The first run time will be on January 2nd, 2023, and the second run time will be on March 5th, 2023.
* Schedules will begin running on the first matching date on or after the scheduled start date. If the start date is past the first matching date in the current period, it will begin the next interval period.
  * *Example:* A yearly schedule that runs on January 1st with a start date of January 2nd, 2023, will first run on January 1st, 2024.
* If no schedule rule is passed in when creating a schedule, a default rule will be created based on the interval type. The default `RuleType` is `On` with the `DayOfWeek`, `DayOfMonth`, and `MonthOfYear` values set based on the start date.

#### Example 1

A monthly schedule that runs every 3 months on the first weekday of the month:

```javascript
{
  "IntervalType" : "Month",
  "IntervalCount" : 3,
  "ScheduleRule" : { 
    "RuleType" : "Nth",
    "N" : 1,
    "NthOfType" : "Weekday"
  }
}
```

#### Example 2

A yearly schedule that runs every year on January 1st:

```javascript
{
  "IntervalType" : "Year",
  "IntervalCount" : 1,
  "ScheduleRule" : { 
    "RuleType" : "On",
	"DayOfMonth" : 1,
    "MonthOfYear" : 1
  }
}
```

#### Example 3

A weekly schedule that runs every other Monday:

```javascript
{
  "IntervalType" : "Week",
  "IntervalCount" : 2,
  "ScheduleRule" : { 
    "RuleType" : "On",
	"DayOfWeek" : 2
  }
}
```

### Appendix B - Timeouts

Timeouts

Transactions that take longer than 45 seconds to process will now be automatically voided by the gateway and marked as declined on recurring.


# Reporting API

## Overview <a href="#overview" id="overview"></a>

The Sola Reporting API enables you to generate transaction reports based on specified parameters, such as date ranges. Reports can be created for single accounts or multiple accounts.

### Credentials <a href="#credentials" id="credentials"></a>

| Parameter | Description | Comment                               |
| --------- | ----------- | ------------------------------------- |
| xKey      | Credential  | Max Size: 250 Alphanumeric Characters |

### Universally Required Parameters <a href="#universally-required-parameters" id="universally-required-parameters"></a>

| Parameter        | Description                     | Comment                              |
| ---------------- | ------------------------------- | ------------------------------------ |
| xVersion         | Gateway API version             | The current version is 5.0.0         |
| xSoftwareName    | The name of your software       |                                      |
| xSoftwareVersion | Version number of your software | 2.1                                  |
| xCommand         | Transaction type                | Samples: report:all, report:approved |

### Other Parameters

| Parameter          | Description                                                                                                                    | Comment                                                                                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| xReturnDownloadURL | A boolean flag indicating if response should include `xReportURL` to use for downloading the results instead of `xReportData`. | If you are running reports that are returning more than 5MB of data we recommend that you use this parameter. The URL returned is valid for 5 minutes. |

### Endpoints <a href="#endpoints" id="endpoints"></a>

Base URL: [https://x1.cardknox.com](https://x1.cardknox.com/)

Sola reporting API allows you to send the data in **FormData** and **JSON** formats.\
Add to the base URL any of the following formats to indicate which format you are sending it as:

| FormData | /report     | <https://x1.cardknox.com/report>     |
| -------- | ----------- | ------------------------------------ |
| JSON     | /reportjson | <https://x1.cardknox.com/reportjson> |

#### Request Method <a href="#request-method" id="request-method"></a>

Method: POST\
The Cardknox gateway requires the POST method to be used for enhanced security. We do not support the GET method.

### Pagination <a href="#pagination" id="pagination"></a>

1. Submit the first request.
2. If xRecordsReturned equals xReportingMaxTransactions, submit another report request and adjust the beginning date and time according to the last transaction returned.

### Filter Options <a href="#filter-options" id="filter-options"></a>

Available filtering options include the following:

**Required Parameters**

| Parameter   | Description                                                      | Sample Value                                                                                                                             |
| ----------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| xgetnewest  | Returns the most recent transactions in the requested date range | True/False                                                                                                                               |
| xmaxrecords | Sets the maximum number of records to return on the report       | <p>Integer value between 1 – 1000\*</p><p>If the date range on the report is within 24 hours you can request up to 5000 transactions</p> |

For date-based reports, you can filter results using the following operators for any of the reporting fields:

| Parameter | Operator  | Description                                                                                          | Example               |
| --------- | --------- | ---------------------------------------------------------------------------------------------------- | --------------------- |
| ai        | In        | Use for an exact match.                                                                              | xBillCountry=aiCanada |
| a=        | Like      | Use for fields that include your search string, but sometimes also include other information.        | xAmount=a=40          |
| a!        | Not Like  | Use for fields that do not include your search string, but sometimes also include other information. | xCardLastFour=a!4444  |
| an        | Not In    | Shows results that don’t have the value you enter.                                                   | xBillPhone=an212      |
| as        | Ends With | Use when you know what your value starts with.                                                       | xName=asJane          |
| ae        | Ends With | Use when you know what your value ends with.                                                         | xEmail=aeOrg          |

### Customize report parameters  <a href="#customize-report-parameters" id="customize-report-parameters"></a>

To customize the transaction parameters included in a generated report, you can utilize the "xFields" parameter and specify the desired field names. Refer to the available parameters listed [here](https://docs.solapayments.com/#response-parameters).

| Parameter | Description                                      | Sample Value                                                                                |
| --------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------- |
| xFields   | Specify parameters to be returned in the report. | xrefnum, xcommand, xname, xmaskedcardnumber, xtoken, xamount, xentereddate, xresponseresult |

#### /GetReconReport <a href="#getreconreport" id="getreconreport"></a>

Gets a list of Invoices for a specific Cardknox MID with an option to get data for multiple MIDs. This includes all invoices charged to the merchant by Sola. GoPlus merchants only.

Method: POST

Authentication is required.

#### Request Body (JSON) <a href="#response-body-json" id="response-body-json"></a>

| **Parameter**    | **Required** | **Type** | **Description**                                                                                                        |
| ---------------- | ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| FromDate         | yes          | Date     | The start date to pull invoices for                                                                                    |
| ToDate           | yes          | Date     | The end date to pull invoices for. Can be max 6 months from `FromDate` if `IsMultiMidReport` is false, 31 days if true |
| IsMultiMidReport | no           | Boolean  | If true, data will be returned for all mids user has access to                                                         |

**Sample Request**

```json
{
    "FromDate": "2026-04-15",
    "ToDate": "2026-04-19",
    "IsMultiMidReport": false
}
```

#### Response Body (JSON) <a href="#response-body-json-.1" id="response-body-json-.1"></a>

| **Parameter** | **Type**              | **Description**                                                                                               | **Valid Values** |
| ------------- | --------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------- |
| Result        | char                  | The result of the API call. **S** represents success, **E** represents an error.                              | S, E             |
| RefNum        | string                | A unique request ID.                                                                                          |                  |
| Error         | string                | If the `Result` parameter contains a value of **E**, this parameter will contain any relevant error messages. |                  |
| InvoiceList   | array of json objects | The invoices for the requested billing date range                                                             | See fields below |

| **Invoice Field**    | **Type** | **Description**                                                                                                                           | **Valid Values**                          |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| InvoiceId            | string   | The unique id of this invoice                                                                                                             | numeric                                   |
| InvoiceDescription   | string   | The description of the fees being charged on the invoice                                                                                  |                                           |
| SolaMID              | string   | The Sola MID the fee was billed to                                                                                                        | numeric, valid Sola MID                   |
| ProcessorMID         | string   | The Processor MID of the account the fee was billed to                                                                                    | numeric, valid Fiserv or ACHQ MID         |
| DBA                  | string   | The account’s business name                                                                                                               |                                           |
| BillingStatus        | string   | The current status of the invoice                                                                                                         | Completed, Bounced, paid, paid-reconciled |
| BillingDate          | date     | The date the fees were billed                                                                                                             |                                           |
| TransactionStartDate | datetime | Only returned on invoices where the description is “Processing Fees”. The start date of the transactions the fees were charged for        |                                           |
| TransactionEndDate   | datetime | Only returned on invoices where the description is “Processing Fees”. The end date of the transactions the fees were charged for          |                                           |
| Processor            | string   | The processor of the account/SolaMID the invoice is for                                                                                   | Go Plus, ACHQ                             |
| ProcessingFees       | decimal  | The amount of the fees charged for transaction processing                                                                                 |                                           |
| OtherFees            | decimal  | The amount of fees charged for other services                                                                                             |                                           |
| TotalFees            | decimal  | The total amount of the fees charged                                                                                                      |                                           |
| Batches              | string   | Only returned on invoices where the description is “Processing Fees” for accounts billed per batch. The batches the fees were charged for | comma-delimited list of batch numbers     |

**Sample Response**

```json
{
	"refNum": "ra501002009",
	"result": "S",
	"error": "",
	"invoiceList": [
		{
			"invoiceId": "21015",
			"invoiceDescription": "Processing Fees",
			"solaMID": "999000017",
			"processorMID": "855956893512",
			"dba": "Test Go Plus",
			"billingStatus": "Complete",
			"billingDate": "2026-05-27",
			"transactionStartDate": "2026-05-01T21:32:46",
			"transactionEndDate": "2026-05-28T12:08:59",
			"processor": "Go Plus",
			"processingFees": 4.85,
			"otherFees": 0.00,
			"totalFees": 4.85,
			"batches": "37927929,5010404"
		},
        {
			"invoiceId": "279308.0",
			"invoiceDescription": "Processing Fees, Return Fee",
			"solaMID": "36977",
			"processorMID": "2001",
			"dba": "Test Retry, TID 10",
			"billingStatus": "Complete",
			"billingDate": "2026-05-29",
			"processor": "ACHQ",
			"processingFees": 3.0,
			"otherFees": 25.0,
			"totalFees": 28.0,
			"batches": "5005327"
		}
	]
}
```

## Report Types <a href="#report-types" id="report-types"></a>

Available report types include the following:

### Date-Based Reports <a href="#date-based-reports" id="date-based-reports"></a>

#### Report:Approved

xCommand: **Report:Approved**

The Report:Approved command returns the following transactions:

* CC:Sale
* CC:Capture
* CC:PostAuth
* CC:Save
* CC:Credit
* CC:Refund

The Report:Approved command does not return authorization-only transactions that have not been captured.

**Required Parameters**

| Parameter  | Description                                                        | Sample Value                                |
| ---------- | ------------------------------------------------------------------ | ------------------------------------------- |
| xBeginDate | Transaction begin date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate   | Transaction end date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format   | <p>2019-10-31</p><p>2020-06-30 12:00:00</p> |

#### Report:Declined

xCommand: **Report:Declined**

The Report:Declined command returns the following transactions:

* CC:Sale
* CC:AuthOnly
* CC:Capture
* CC:PostAuth
* CC:Save
* CC:Credit
* CC:Refund

**Required Parameters**

| Parameter  | Description                                                        | Sample Value                                |
| ---------- | ------------------------------------------------------------------ | ------------------------------------------- |
| xBeginDate | Transaction begin date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate   | Transaction end date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format   | <p>2019-10-31</p><p>2020-06-30 12:00:00</p> |

#### Report:Auth

xCommand: **ReportAuth**

The Report:Auth command returns the following transaction:

* CC:AuthOnly

The ReportAuth command only returns approved authorizations.

**Required Parameters**

| Parameter  | Description                                                        | Sample Value                                |
| ---------- | ------------------------------------------------------------------ | ------------------------------------------- |
| xBeginDate | Transaction begin date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate   | Transaction end date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format   | <p>2019-10-31</p><p>2020-06-30 12:00:00</p> |

#### Report:All

xCommand: **Report:All**

The Report:All command returns the following transactions:

* CC:Sale
* CC:AuthOnly
* CC:Capture
* CC:PostAuth
* CC:Save
* CC:Credit
* CC:Refund

**Required Parameters**

| Parameter  | Description                                                        | Sample Value                                |
| ---------- | ------------------------------------------------------------------ | ------------------------------------------- |
| xBeginDate | Transaction begin date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate   | Transaction end date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format   | <p>2019-10-31</p><p>2020-06-30 12:00:00</p> |

{% hint style="info" %}
**Note**: You can run a report against all accounts by adding the search parameter xSecondaryKeys:\[comma-delimited xKeys] and use all the xKeys for all accounts for the following date-based reports
{% endhint %}

| Parameter      | Description                                                                                                          | Sample Value                                                                                                                           |
| -------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| xSecondaryKeys | <p>Run a report for secondary accounts.</p><p>For multiple account keys, you can include comma-separated values.</p> | Bread\_Butter\_xxxdxxxecbxxxxaxxxdbexxx, Other\_Account\_xxxxfxxxexxfxxxfxbxxx, Yet\_Another\_Account\_xxxbexaxxddxxbabbxexcxxxafxfexx |

Optional Field: xBatch:\[batch#]to get only the transactions of a specific batch.

#### Report:Deposit

xCommand: **Report:Deposit**

{% hint style="warning" %}
The **Report:Deposit** command will only return valid responses for accounts that have ongoing ACHQ activity. The Deposit ID given as a parameter must be an ACHQ deposit ID and the values shown in the response are only pertaining to ACHQ transaction activity.
{% endhint %}

The Report:Deposit command returns the following values:

* Deposit Id
* Deposit Date
* Total Amount
* Transactions
  * Refnum
  * Amount

**Required Parameters**

| **Parameter** | **Description**                                        | **Sample Value**                            |
| ------------- | ------------------------------------------------------ | ------------------------------------------- |
| xDepositId\*  |                                                        |                                             |
| xBeginDate\*  | Begin date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEnd Date\*   | End date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format   | <p>2019-10-31</p><p>2020-06-30 12:00:00</p> |

\*Either xDepositId or xBeginDate and xEndDate are required.

### Transaction-Based Reports <a href="#transaction-based-reports" id="transaction-based-reports"></a>

Single transaction

* report:transaction

xCommand: **Report:Transaction**

**Required Parameters**

| Parameter | Description                                                                                                                                            | Sample Value                                       |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| xRefnum   | <p>Reference number</p><p>Multiple reference numbers are comma delimited.</p><p>This value is required only if you do not enter an Invoice number.</p> | <p>r10000001</p><p>r10000001,r2000001,r3000001</p> |

#### Multiple transactions

* report:transactions

xCommand: **Report:Transactions**

{% hint style="info" %}
Reports queried without `xBeginDate` and `xEndDate` will only return transactions from the past 2 years.
{% endhint %}

**Required Parameters**

| Parameter | Description                                                                                                                                            | Sample Value                                       |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| xRefnum   | <p>Reference number</p><p>Multiple reference numbers are comma delimited.</p><p>This value is required only if you do not enter an Invoice number.</p> | <p>r10000001</p><p>r10000001,r2000001,r3000001</p> |
| xInvoice  | <p>Invoice number</p><p>Multiple invoice numbers are comma delimited.</p><p>This value is required only if you do not enter a Reference number.</p>    | <p>1234</p><p>1234,5678,9012</p>                   |

#### Related Transactions <a href="#related-transactions" id="related-transactions"></a>

xCommand: **Report:Related**

**Required Parameters**

| Parameter | Description                                                                                                                                            | Sample Value                                       |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| xRefnum   | <p>Reference number</p><p>Multiple reference numbers are comma delimited.</p><p>This value is required only if you do not enter an Invoice number.</p> | <p>r10000001</p><p>r10000001,r2000001,r3000001</p> |

#### Gift:Approved <a href="#gift-approved" id="gift-approved"></a>

xCommand: **Report:GiftApproved**

**Required Parameters**

| xKey             | Your Sola API key                         | Max Size: 250 Alphanumeric Characters       |
| ---------------- | ----------------------------------------- | ------------------------------------------- |
| xCommand         | Sola transaction type                     | Report:GiftApproved                         |
| xBeginDate       | Beginning date of range                   | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate         | Ending date of range                      | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xSoftwareName    | Name of your software                     | \[xsoftwarecredentials]                     |
| xSoftwareVersion | Version number of your software           | The current version is 4.5.8                |
| xFields          | Optional. If not used, returns all fields |                                             |

**Response Fields**

| xResult          | “A”           |
| ---------------- | ------------- |
| xStatus          | “Approved”    |
| xError           | ““            |
| xRefNum          | "10000016875" |
| xRecordsReturned | “20”          |
| xReportData      |               |

#### Gift:Summary <a href="#gift-summary" id="gift-summary"></a>

xCommand: **Report:GiftSummary**

**Required Parameters**

| xKey             | Your Sola API key                         | \[xkeycredentials]                          |
| ---------------- | ----------------------------------------- | ------------------------------------------- |
| xCommand         | Sola transaction type                     | Report:GiftSummary                          |
| xBeginDate       | Beginning date of range                   | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate         | Ending date of range                      | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xSoftwareName    | Name of your software                     | \[xsoftwarecredentials]                     |
| xSoftwareVersion | Version number of your software           | The current version is 4.5.8                |
| xFields          | Optional. If not used, returns all fields |                                             |

**Response Fields**

| xResult          | “A”           |
| ---------------- | ------------- |
| xStatus          | “Approved”    |
| xError           | ““            |
| xRefNum          | "10000016875" |
| xRecordsReturned | “20”          |
| xReportData      |               |

#### Liability <a href="#liability" id="liability"></a>

xCommand: **Report:Liability**

**Required Parameters**

| xKey             | Your Sola API key               | \[xkeycredentials]           |
| ---------------- | ------------------------------- | ---------------------------- |
| xCommand         | Sola transaction type           | Report:Liability             |
| xSoftwareName    | Name of your software           | \[xsoftwarecredentials]      |
| xSoftwareVersion | Version number of your software | The current version is 4.5.8 |

**Response Fields**

| Parameter        | Example       |
| ---------------- | ------------- |
| xResult          | “A”           |
| xStatus          | “Approved”    |
| xError           | ““            |
| xRefNum          | "10000016875" |
| xRecordsReturned | “20”          |
| xReportData      |               |

### Batch Report <a href="#batch-report" id="batch-report"></a>

Obtain batch summary by date

* report:batch

xCommand: **Report:Batch**

**Required Parameters**

| Parameter  | Description                                            | Sample Value                                |
| ---------- | ------------------------------------------------------ | ------------------------------------------- |
| xBeginDate | Begin date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format | <p>2020-01-01</p><p>2019-08-15 09:00:00</p> |
| xEndDate   | End date in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format   | <p>2019-10-31</p><p>2020-06-30 12:00:00</p> |

## Send a Receipt for a Completed Transaction <a href="#send-a-receipt-for-a-completed-transaction" id="send-a-receipt-for-a-completed-transaction"></a>

You can use the **Reporting API** feature to send a receipt for a completed transaction.

### Reporting URL <a href="#reporting-url" id="reporting-url"></a>

Use the following Sola URL: <https://x1.cardknox.com/report>

### Required Variables: <a href="#required-variables" id="required-variables"></a>

| Parameter        | Description                          | Comments                              |
| ---------------- | ------------------------------------ | ------------------------------------- |
| xKey             | Credential                           | Max Size: 250 Alphanumeric Characters |
| xVersion         | Gateway API version                  | The current version is 4.5.8          |
| xSoftwareName    | The name of your software            |                                       |
| xSoftwareVersion | Version number of your software      |                                       |
| xCommand         | Transaction type                     | Report:Transaction                    |
| xRefnum          | Reference number                     |                                       |
| xEmail           | Email address of receipt destination |                                       |


# Account Boarding API

## Overview <a href="#overview" id="overview"></a>

The Sola Account Boarding API gives ISV partners the ability to board PayFac accounts directly through their system, rather than from the Partner Portal. Using the Account Boarding API, ISVs can build a form within their system for collecting all the necessary merchant data to onboard Sola Go accounts. Once the ISV submits the application via the API, it is passed along to Sola for instant approval.

This page outlines the configuration process for integrating with Sola's Account Boarding API.

{% hint style="info" %}
[See this API on Swagger UI](https://psapi.cardknox.com/boarding/v1/swagger/index.html)

Visualize and interact with the API using Swagger UI. Please note that only sandbox keys may be used when submitting accounts and the `Signature.Token` field is not required.
{% endhint %}

## API Endpoints <a href="#api-endpoints" id="api-endpoints"></a>

### GetTierNames <a href="#gettiers" id="gettiers"></a>

**URL**: <https://psapi.cardknox.com/boarding/v1/GetTierNames>

**Description:** The GetTierNames endpoint gives a list of available tiers that can be passed along to the SubmitGoApp request.

**Method**: POST

**Input**: JSON

#### Request **Body** <a href="#request" id="request"></a>

| **Parameter** | **Type** | **Description**            | **Required** |
| ------------- | -------- | -------------------------- | ------------ |
| ApiKey        | String   | Authentication credentials | True         |

#### Sample Request: <a href="#response" id="response"></a>

```
{
  "apiKey": "0d48f767f1d34d088ae59a214fe11e25"
}
```

#### Response <a href="#response" id="response"></a>

| **Parameter** | **Description**                                    |
| ------------- | -------------------------------------------------- |
| `status`      | <ul><li>Success</li><li>Error</li></ul>            |
| `refnum`      |                                                    |
| `error`       | <ul><li>Error Code</li><li>Error Message</li></ul> |
| `tiers`       | List of available tiers                            |

**Sample Success Response:**

```
{
  "tiers": [
    "123_tier1",
    "123_tier2"
  ],    
  "refnum": "brd258465289",
  "status": "Success"
}
```

**Sample Error Response:**

```
{    
  "refnum": "brd258465289", 
  "status": "Error",   
  "error": {     
    "errorCode": "AccessDenied",    
    "errorMessages": [        
      "Access Denied"       
    ]   
  }
}
```

### SubmitGoApp <a href="#submitgoapp" id="submitgoapp"></a>

**URL**: <https://psapi.cardknox.com/boarding/v1/SubmitGoApp>

{% hint style="info" %}
The SubmitGoApp end point will create a GoPlus Application.
{% endhint %}

**Description:**

The SubmitGoApp endpoint validates the request and generates an application if the account associated with the API key is authorized to board Sola Go accounts. If it is a Sandbox request, the equipment will be created immediately.

**Method**: POST

**Input**: JSON

#### Request <a href="#request.1" id="request.1"></a>

| **Parameter**               | **Type** | **Description**                                                                                                                                                                    | **Required** |
| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| ApiKey                      | String   | Authentication Key                                                                                                                                                                 | True         |
| TierName                    | String   | Name of tier                                                                                                                                                                       | True         |
| CorporateName               | String   | Business’s legal name                                                                                                                                                              | True         |
| DBAName                     | String   | Business’s DBA Name, if no DBA default to CorporateName                                                                                                                            | True         |
| AnnualCreditCardSales       | Number   | Credit card sales for the last full year                                                                                                                                           | False        |
| OwnershipType               | Enum     | <p>Ownership structure<br></p><p>Valid values are:</p><ul><li>SoleProprietor</li><li>Partnership</li><li>Corporation</li><li>SoleOwnership</li><li>LLC</li><li>NonProfit</li></ul> | True         |
| BusinessStartDate           | Date     | Start date of the business in YYYY-MM-DD format                                                                                                                                    | True         |
| AgentName                   | String   | Full name of primary agent                                                                                                                                                         | False        |
| AgentEmail                  | String   | Email address of primary agent                                                                                                                                                     | False        |
| Website                     | String   | <p>Business website<br><br>\*Required field if Ecommerce tier is being used</p>                                                                                                    | False        |
| TaxId                       | String   | Business EIN / Tax Identification Number                                                                                                                                           | True         |
| BusinessEmail               | String   | Business email address                                                                                                                                                             | True         |
| BusinessPhone               | String   | Business phone number (format: 000-000-0000)                                                                                                                                       | True         |
| BusinessAddress             | Object   | Object containing business address fields                                                                                                                                          | True         |
| MailingAddress              | Object   | Object containing business mailing address fields                                                                                                                                  | True         |
| ProductSold                 | String   | Short description of product sold                                                                                                                                                  | True         |
| BankingInformation          | Object   | Object containing banking information including bank name, routing number, and account number                                                                                      | True         |
| SecondaryBankingInformation | Object   | Object containing banking information including bank name, routing number, and account number                                                                                      | False        |
| SignerInformationList       | Object   | Object containing signer information                                                                                                                                               | True         |
| Signature                   | Object   | <p>Signature Object contains the Token string.<br><br>Token is from the terms and conditions confirmation.</p><p>For production accounts, it must be set to a valid value.</p>     | True         |
| AverageTicket               | Number   | Average value of each sale                                                                                                                                                         | True         |
| MonthlySalesVolume          | Number   | Credit card sales for the last full month                                                                                                                                          | True         |
| HighTicket                  | Number   | Largest ticket size                                                                                                                                                                | True         |

[Click here](/api/account-boarding-api/account-boarding-merchant-agreement) for more information on how to obtain tokens.

**BankingDetails**

| **Field Name** | **Description**                                             |
| -------------- | ----------------------------------------------------------- |
| BankName       | String, Required                                            |
| RoutingNumber  | String, Required, must be a valid 9-digit routing number    |
| AccountNumber  | String, Required, numeric value between 6 and 17 characters |

\
**SignerDetails**

| **Field Name**      | **Description**                                                                                                                                                                           |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SSN                 | String, Required                                                                                                                                                                          |
| DateOfBirth         | Date, Required, minimum age is 18                                                                                                                                                         |
| FirstName           | String, Required                                                                                                                                                                          |
| LastName            | String, Required                                                                                                                                                                          |
| Address             | Address, Required                                                                                                                                                                         |
| OwnershipPercentage | Decimal, Required                                                                                                                                                                         |
| Title               | <p>String, Required</p><p>Valid Values:</p><ul><li>Treasurer</li><li>Owner</li><li>Partner</li><li>CEO</li><li>Secretary</li><li>Director</li><li>Other</li><li>Sole Proprieter</li></ul> |
| OwnerCellPhone      | String, Required (format: 000-000-0000)                                                                                                                                                   |

\
**Address**

| **Field Name** | **Description**                      |
| -------------- | ------------------------------------ |
| StreetAddress  | String, Required                     |
| City           | String, Required                     |
| State          | String, Required, 2 digit state code |
| Zip            | String, Required, 5 digits           |
| Country        | String, Optional                     |

\
**Signature**

| **Field Name** | **Description**                                                                                                                  |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Token          | <p>Token from the terms and conditions confirmation, Required</p><p>For production accounts, it must be set to a valid value</p> |

**Sample Request**

```json
{
  "apiKey": "{{API_KEY}}",
  "tierName": "{{TIER}}",
  "corporateName": "Acme Corp",
  "dbaName": "Acme Corporation",
  "annualCreditCardSales": "80000",
  "monthlySalesVolume": 1000,
  "highTicket": 500,
  "averageTicket": 250,
  "ownershipType": "corporation",
  "businessStartDate": "2005-08-01",
  "agentName": "John Smith",
  "agentEmail": "john.smith@test.com",
  "website": "http://www.acmecorporation.com/",
  "taxId": "225555555",
  "businessEmail": "robert@acmecorporation.com",
  "businessPhone": "800-555-1212",
  "businessAddress": {
    "streetAddress": "1213 Main Street",
    "city": "Anytown",
    "state": "AL",
    "zip": "11111",
    "country": "United States"
  },
  "mailingAddress": {
    "streetAddress": "1213 Main Street",
    "city": "Anytown",
    "state": "AL",
    "zip": "11111",
    "country": "United States"
  },
  "productSold": "Convenience Goods",
  "bankingInformation": {
    "bankName": "Chase",
    "routingNumber": "021000021",
    "accountNumber": "454545454545"
  },
  "secondaryBankingInformation": {
    "bankName": "Chase",
    "routingNumber": "121122676",
    "accountNumber": "898989898989"
  },
  "signerInformationList": [
    {
      "ssn": "115668989",
      "dateOfBirth": "1955-07-14",
      "firstName": "Robert",
      "lastName": "Brown",
      "address": {
        "streetAddress": "1213 Main Street",
        "city": "Anytown",
        "state": "AL",
        "zip": "11111",
        "country": "United States"
      },
      "ownershipPercentage": 100,
      "title": "Owner",
      "ownerCellPhone": "222-333-4444"
    }
  ],
  "signature": {
    "token": ""
  }
}
```

#### Response <a href="#response.1" id="response.1"></a>

| **Parameter** | **Description**                                                      |
| ------------- | -------------------------------------------------------------------- |
| Status        | <ul><li>Success</li><li>Error</li></ul>                              |
| Refnum        |                                                                      |
| Error         | <ul><li>Error Code</li><li>Error Messages - List of errors</li></ul> |
| AppId         |                                                                      |

**Sample Success Response**&#x20;

```json
{
  "appId": 9854,
  "refnum": "brd221002160",
  "status": "Success"
}
```

**Sample Error Response:**

```json
{
  "status": "Error",
  "error": {
    "errorCode": "BadRequest",
    "errorMessages": [            
      "BusinessAddress.State: The State field is required.",            
      "SignerInformationList[0].SSN: The SSN field is required."        
    ]    
  }
}
```

### Merchant’s Documents Submission Endpoints

#### **Description**:

In some cases, in order to complete a merchant’s onboarding, additional documentation is required. For such cases we provide two (2) additional endpoints that work together: GetFileUploadData and TransferFile

#### How to use endpoints to submit additional merchant information:

1. Call GetFileUploadData endpoint
2. Encrypt the file using key and IV from GetFileUploadData response
3. Upload the encrypted file using the pre-signed S3 URL returned in step 1
4. Call the TransferFile endpoint

**Sample code to encrypt file:**

```javascript
function encryptFile(file, encryptionKey, encryptionIv) {
    return new Promise(resolve => {
    const reader = new FileReader();
    reader.onload = function(f) {
        const contentBytes = new Uint8Array(reader.result);
        const aesCbc = new AesJs.ModeOfOperation.cbc(encryptionKey, encryptionIv);
        var cipherText = aesCbc.encrypt((AesJs.padding.pkcs7.pad(contentBytes)));
        cipherText = new Uint8Array([...encryptionIv, ...cipherText]);
        const encryptedBlob = new Blob([cipherText])
            const encryptedFile = new File([encryptedBlob], file.name, { type: file.type })
            resolve(encryptedFile)
        }
        reader.readAsArrayBuffer(file);
    })
}
```

***

#### GetFileUploadData

**URL**: <https://psapi.cardknox.com/boarding/v1/GetFileUploadDataAsync>

**Method**: POST

**Input**: JSON

#### Request

| **Parameter** | **Description**  |
| ------------- | ---------------- |
| ApiKey        | String, Required |
| ContentType   | String, Required |
| FileName      | String, Required |

**Sample Request:**

```json
{
  "apiKey": "0d48f767f1d34d088ae59a214fe11e25",
  "contentType": "application/pdf",
  "fileName": "myDoc.pdf"
}
```

#### Response

| **Parameter** | **Description**                                                           |
| ------------- | ------------------------------------------------------------------------- |
| Status        | <ul><li>Success</li><li>Error</li></ul>                                   |
| Refnum        |                                                                           |
| Error         | <ul><li>Error Code</li><li>Error Messages - List of errors</li></ul>      |
| Url           | Temporary Presigned Url to upload your file to                            |
| Iv            | A random initialization vector used for the algorithm to encrypt the file |
| Key           | A generated random key used for the algorithm to encrypt the file         |

**Sample Response:**

```json
{
  "key": [61,224,1,137,248,140,54,146,165,186,104,80,174,88,32,192,234,250,27,24,137,254,84,226,45,85,191,68,114,114,159,164],
  "iv": [10,99,52,138,100,28,168,243,8,250,141,103,223,182,134,108],
  "url": "https://partnerportal-83c5a00e90d54c02b0245ac81bbf79a9-us-east-2-prd.s3.us-east-2.amazonaws.com/0525b1d47a.pdf?X-Amz-Expires=600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEGIaCXVzLWVhc3QtMiJIMEYCIQDI4fDIubPYDH1DlmmlKC2hYNv%2Br9kaM%2BAaKKROLo8FmAIhAMolhwCtPjQFl0BlLPse2T4%2FlKlBAJKW84tKUNlmALFSKpgDCOv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQABoMNjYwODI4MDgyODQwIgw3vCSgTR5iPKo%2FjvQq7ALhNqOYkGO5HeaUdjkpfIcZ2UxgTBjmc5ZPdCc4tul2kjax%2BHdi5lcrkQfLtDKo6UQh4GEC%2BfYpSL0OB8%2FMfDnKMwUn6z7f1omuMNou0X7HGsBEEzXp53rv1r%2BwOkLbG5gpLoCAi9%2Fg2c7GdDp01mSqOgsL74WJ46cUCYN2Wim1ZQyteh%2BldF5ST8P3OHcHrHoxF6m0oO7V7lAZdBD32enWQ7BgT%2B4E%2B1S4ZFuFxcxc2rSVYzcbNsXG4F6uxVc%2BEA%2Fq8WmLIyJ6BE1AQwC0lfQb6pCiWju3TDCcwWPYQlU8E%2BRrRk4MHE2KT2vrWeIQd4bL30FAmodWfv8XdCTWbXZTU%2BWZjN2GLFFderFpmoHnpAqPmsvS9qXusUlmvJog6cz4l5KtfjtSM5STenLq0KL8mjOgeTwn18lXETyuwIXpOJkcVkPCVTb6mUMKmU17kGOpwBpqachqL1llkjTKhIPmijHPJkx3iSd5YrihLLkmvIK6Edr9Phku9pOXh%2FrBuR1xDlHThcmjA5YcNPWecHABSJQsw4H8zJQ2QZ8QO89SbYRVEYHo1x9eBhRPXx8NpjYMoXunD1nyuBHvDA606gp7kGvTRT8H%2Fc0G3wUxiOjWGgKgYfTUDcgpz14RgzqMBbcpROxFUhOfI5EBOyJ4kK&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAZTXDMKKMDZNJ3PWG%2F20241114%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20241114T100046Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=a760b50d071ff99284cejkna0a3655e65",
  "refnum": "brd221002160",
  "status": "Success"
}
```

#### TransferFile

**URL**: <https://psapi.cardknox.com/boarding/v1/TransferFileAsync>

**Method**: POST

**Input**: JSON

#### Request

| **Parameter**       | **Description**                                                                                                                                                                                                                                                                                           |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ApiKey              | String, Required                                                                                                                                                                                                                                                                                          |
| ParentId            | <p>String, Required</p><p>AppId</p>                                                                                                                                                                                                                                                                       |
| AdditionalParentIds | List of String, Optional                                                                                                                                                                                                                                                                                  |
| FileName            | <p>String, Required</p><p>Name for the uploaded file</p>                                                                                                                                                                                                                                                  |
| FileTag             | <p>String, Required</p><p>Valid values are:</p><ul><li>"SignedMPA",</li><li>"SignaturePages",</li><li>"VoidedCheck",</li><li>"BankingStatement",</li><li>"MerchantStatement",</li><li>"ProofOfAddress",</li><li>"TaxExemption",</li><li>"CorporateDocs",</li><li>"CompanyLogo",</li><li>"Other"</li></ul> |
| FileKey             | <p>String, Required</p><p>File Key used when getting Presigned URL</p>                                                                                                                                                                                                                                    |
| FileDescription     | String, Optional                                                                                                                                                                                                                                                                                          |
| EncryptionKey       | Byte Array, Required                                                                                                                                                                                                                                                                                      |

**Sample Request:**

```json
{
  "apiKey":"0d48f767f1d34d088ae59a214fe11e25",
  "encryptionKey": [61, 224, 1, 177, 248, 138, 54, 146, 165, 196, 104, 80, 174, 88, 52, 192, 234, 250, 27, 24, 137, 254,…],
  "fileKey": "0525b1d47a.pdf",
  "fileName": "65545.pdf",
  "fileTag": "VoidedCheck",
  "parentId": 123456
}
```

#### Response

| **Parameter** | **Description**                                                      |
| ------------- | -------------------------------------------------------------------- |
| Status        | <ul><li>Success</li><li>Error</li></ul>                              |
| Refnum        |                                                                      |
| Error         | <ul><li>Error Code</li><li>Error Messages - List of errors</li></ul> |

**Sample Success Response:**

```
{
  "refnum": "brd221002160",
  "status": "Success"
}
```

### ExecuteAction

ExecuteAction will execute an Action for a given ActionName and Template

**URL**: [https://psapi.cardknox.com/boarding/v1/ExecuteAction](https://psapi.cardknox.com//boarding/v1/ExecuteAction)

**Method**: POST

**Input**: JSON

#### Request

| **Parameter** | **Description**                                                      |
| ------------- | -------------------------------------------------------------------- |
| apiKey        | Credential, Required                                                 |
| actionName    | Name of the Action, Required                                         |
| template      | A json Object containing parameters necessary to complete the Action |

**Sample Request:**

```
{
  "apiKey": "0d48f767f1d34d088ae59a214fe11e25",
  "actionName": "a01_SomeAction_xya123456ae"
}
```

#### Response

| **Parameter** | **Description**                                    |
| ------------- | -------------------------------------------------- |
| status        | <ul><li>Success</li><li>Error</li></ul>            |
| refnum        |                                                    |
| error         | <ul><li>Error Code</li><li>Error Message</li></ul> |

**Sample Success Response:**

```
{
  "refnum": "brd258465289",
  "status": "Success"
}
```

**Sample Error Response:**

```
{    
  "refnum": "brd258465289", 
  "status": "Error",   
  "error": {     
    "errorCode": "AccessDenied",    
    "errorMessages": [        
      "Access Denied"       
    ]   
  }
}
```


# Account Boarding Merchant Agreement

## Overview <a href="#overview" id="overview"></a>

***

In order to be boarded every Merchant needs to agree to Go Plus Terms and Conditions.\
To help Developers integrate Agreement API into their website we are supporting Agreement API through Sola iFields.

### **Integrate Agreement API using ifields** <a href="#integrate-agreement-api-using-ifields" id="integrate-agreement-api-using-ifields"></a>

{% hint style="info" %}
Obtain your ***iFields xKey*** from your Sola [Partner Portal](https://partner.solapayments.com/login) account settings.
{% endhint %}

#### Adding Reference to iFields <a href="#adding-reference-to-ifields" id="adding-reference-to-ifields"></a>

***

**Step 1:** Check the latest stable iFields version here: <https://cdn.cardknox.com/ifields/versions.htm>

**Step 2:** Add the ifields.js file after the \<head> tag on your website:

`<script src=https://cdn.cardknox.com/ifields/**ifields-version-number**/ifields.min.js></script>`

&#x20;

#### Adding iFrame and JavaScript Objects for Merchant Agreement <a href="#adding-iframe-and-javascript-objects-for-merchant-agreement" id="adding-iframe-and-javascript-objects-for-merchant-agreement"></a>

***

**Step 1:** Add the following iFrame JS snippet inside the *\<body>* where Merchant Agreement is desired.

* Make sure you have an attribute `data-ifields-id="agreement"` as part of *\<iframe>* tag

`<iframe id="agreement" class="agreement" data-ifields-id="agreement" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/agreement.htm"></iframe>`

&#x20;

**Step 2:** Create JavaScript function to handle Agreement API callback

```
function handleAgreementResponse(response) {
    let msg = null;
    if (!response) {
        msg = "Failed to load token. No Response";
    } else if (response.status !== iStatus.success) {
        msg = "Failed to load token. "+response.statusText || "No Error description available";
    } else if (!response.token) {
        msg = "Failed to load token. No Token available";
    } else {
        msg = response.token;
    }
    setTimeout(() => {alert(msg)}, 10);
}
```

For `response` object reference refer here: [Agreement Response](#agreement-response)

&#x20;

**Step 3:** Enable Customer Agreement to get the token

There are two ways to get the token:

* Asynchronously (a callback will be performed once the customer agrees to Terms and Conditions)\
  \
  Just add `enableAgreement` call when the document is loaded (`autoAgree` the parameter is set to `true`):

```javascript
document.addEventListener("DOMContentLoaded", function(event) {
    ................ 
    ckCustomerAgreement.enableAgreement({
        iframeField: 'agreement',
        xKey: '<Your ifields xKey>',
        autoAgree: true,
        callbackName: 'handleAgreementResponse'
    });
    ................    
}
```

* Synchronously (Explicitly calling `getToken` function for example on Submit)\
  \
  Add `enableAgreement` call when the document is loaded (`autoAgree` the parameter is set to `false`):

```javascript
document.addEventListener("DOMContentLoaded", function(event) {
    ................ 
    ckCustomerAgreement.enableAgreement({
        iframeField: 'agreement',
        xKey: '<Your ifields xKey>',
        autoAgree: false
    });
    ................    
}
```

\
In your `Submit` function add the following code:

```javascript
ckCustomerAgreement.getToken()
    .then(resp => {
        handleAgreementResponse(resp);
    })
    .catch(err => {
        console.error("Agreement Token Error", exMsg(err));
        handleAgreementResponse(err);
    });
```

### Objects Reference <a href="#objects-reference" id="objects-reference"></a>

***

#### iStatus <a href="#istatus" id="istatus"></a>

```javascript
const iStatus = {
    success: 100,
    unsupported: -100,
    error: -200
}
```

#### Agreement Response  <a href="#agreement-response" id="agreement-response"></a>

**The object holding the response with token from Agreement API.**

| **Name**     | **Type**                                                                                   | **Description**                                                                                                                                                                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`     | [iStatus](/api/account-boarding-api/account-boarding-merchant-agreement#objects-reference) | <p>There are 2 possible cases:</p><ul><li>Agreement was accepted and Token was obtained <code>status=iStatus.success</code></li><li>Agreement wasn’t accepted or an error occurred obtaining the token: <code>status=iStatus.error</code></li></ul> |
| `statusText` | String                                                                                     | When `status=iStatus.error` this field will be populated with the reason                                                                                                                                                                            |
| `token`      | String                                                                                     | <p>When <code>status=iStatus.success</code> this field will be populated with <code>token</code><br></p>                                                                                                                                            |


# Account Boarding Swagger UI

For general information about using Swagger UI, refer to [this documentation](https://swagger.io/docs/specification/2-0/what-is-swagger/).

#### Swagger URL <a href="#swagger-url" id="swagger-url"></a>

[![](https://psapi.cardknox.com/boarding/v1/swagger/favicon-16x16.png)Swagger UI](https://psapi.cardknox.com/boarding/v1/swagger)

#### Using Swagger UI <a href="#using-swagger-ui" id="using-swagger-ui"></a>

* Only sandbox keys may be used when submitting accounts
* The Signature.Token field is not required


# Account Boarding FAQs

#### For accounts that are not approved automatically:

#### Q. At what point is this communicated? (initial API response, first webhook, second webhook)

A. Merchant will be contacted by our Risk Team member

#### Q. What will be the "Application Status" value?

A. Pending Underwriting or Pending Bank Approval

#### Q. Will it return any other info as to why it wasn't approved?

A. Yes, process generates a detailed email to our Risk team and copy agent/telemarketer

#### Q. Once "not approved" has been communicated, is the underwriting process from there and on completely manual? Or there is still some functionality available through API like uploading documents etc?

A. TransferFile endpoint is used to upload necessary additional documents. See [here](/api/account-boarding-api#merchants-documents-submission-endpoints).

#### Q. Is there an endpoint to "pull" an update on a pending app? or only way is to wait for push notifications (webhook)?

A. Yes, once update is available an update will be sent via webhook and email.

#### Q. Once the account is approved after manual review, will we send an approval webhook like we would for any other account that did approve automatically?

A. Yes

#### Q. What are the File upload endpoints listed on our Swagger used for?

A. They are intended for Merchants to submit additional necessary documents to complete boarding. Please refer to [documentation](/api/account-boarding-api#merchants-documents-submission-endpoints) on how to use these endpoints.<br>


# Reconciliation API

### Overview

The **GetReconReport** endpoint returns a list of Sola-charged invoices for a specified Cardknox MID (or multiple MIDs) over a given date range. Each invoice includes fee breakdowns, billing status, and processor details, making it the primary way to reconcile the fees Sola bills against your account activity.

### Endpoints

#### /GetReconReport

Gets a list of Invoices for a specific Cardknox MID with an option to retrieve invoices for multiple MIDs. This report is for GoPlus merchants only and gives invoices for all items that are charged by Sola.

Method: POST

Authentication is required.

#### Request Body (JSON)

| **Parameter**    | **Required** | **Type** | **Description**                                                                                                    |
| ---------------- | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------ |
| FromDate         | Yes          | Date     | The start date to pull invoices for                                                                                |
| ToDate           | Yes          | Date     | The end date to pull invoices for. Can be max 6 months from FromDate if IsMultiMidReport is false, 31 days if true |
| IsMultiMidReport | No           | Boolean  | If true, data will be returned for all mids user has access to. Only works with Cognito+Mid authentication         |

**Sample Request**

```json
{
    "FromDate": "2026-04-15",
    "ToDate": "2026-04-19",
    "IsMultiMidReport": false
}
```

#### Response Body (JSON)

| **Parameter** | **Type**                     | **Description**                                                                                             | **Valid Values** |
| ------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------- | ---------------- |
| Result        | Char                         | The result of the API call. **S** represents success, **E** represents an error.                            | S, E             |
| RefNum        | String                       | A unique request ID.                                                                                        |                  |
| Error         | String                       | If the Result parameter contains a value of **E**, this parameter will contain any relevant error messages. |                  |
| InvoiceList   | Array containing JSON object | The invoices for the requested billing date range                                                           | See fields below |

| **Invoice Field**    | **Type** | **Description**                                                                                                                           | **Valid Values**                          |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| InvoiceId            | String   | The unique id of this invoice                                                                                                             | numeric                                   |
| InvoiceDescription   | String   | The description of the fees being charged on the invoice                                                                                  |                                           |
| SolaMID              | String   | The Sola MID the fee was billed to                                                                                                        | numeric, valid Sola MID                   |
| ProcessorMID         | String   | The Processor MID of the account the fee was billed to                                                                                    | numeric, valid Fiserv or ACHQ MID         |
| DBA                  | String   | The account’s business name                                                                                                               |                                           |
| BillingStatus        | String   | The current status of the invoice                                                                                                         | Completed, Bounced, paid, paid-reconciled |
| BillingDate          | Date     | The date the fees were billed                                                                                                             |                                           |
| TransactionStartDate | DateTime | Only returned on invoices where the description is “Processing Fees”. The start date of the transactions the fees were charged for        |                                           |
| TransactionEndDate   | DateTime | Only returned on invoices where the description is “Processing Fees”. The end date of the transactions the fees were charged for          |                                           |
| Processor            | String   | The processor of the account/SolaMID the invoice is for                                                                                   | Go Plus, ACHQ                             |
| ProcessingFees       | Float    | The amount of the fees charged for transaction processing                                                                                 |                                           |
| OtherFees            | Float    | The amount of fees charged for other services                                                                                             |                                           |
| TotalFees            | Float    | The total amount of the fees charged                                                                                                      |                                           |
| Batches              | String   | Only returned on invoices where the description is “Processing Fees” for accounts billed per batch. The batches the fees were charged for | comma-delimited list of batch numbers     |

**Sample Response**

```json
{
	"refNum": "ra501002009",
	"result": "S",
	"error": "",
	"invoiceList": [
		{
			"invoiceId": "21015",
			"invoiceDescription": "Processing Fees",
			"solaMID": "999000017",
			"processorMID": "855956893512",
			"dba": "Test Go Plus",
			"billingStatus": "Complete",
			"billingDate": "2026-05-27",
			"transactionStartDate": "2026-05-01T21:32:46",
			"transactionEndDate": "2026-05-28T12:08:59",
			"processor": "Go Plus",
			"processingFees": 4.85,
			"otherFees": 0.00,
			"totalFees": 4.85,
			"batches": "37927929,5010404"
		},
        {
			"invoiceId": "279308.0",
			"invoiceDescription": "Processing Fees, Return Fee",
			"solaMID": "36977",
			"processorMID": "2001",
			"dba": "Test Retry, TID 10",
			"billingStatus": "Complete",
			"billingDate": "2026-05-29",
			"processor": "ACHQ",
			"processingFees": 3.0,
			"otherFees": 25.0,
			"totalFees": 28.0,
			"batches": "5005327"
		}
	]
}
```


# Code Samples

## Programming Language

{% tabs %}
{% tab title="Code Examples: Sale" %}

* [C#](#c)
* [Java/Android](#java-android)
* [Node.js](#node.js)
* [PHP](#php)
* [Python 2](#python-2)
* [Python 3](#python-3)
* [VB.NET](#vb.net)
  {% endtab %}
  {% endtabs %}

### C\#

{% code overflow="wrap" lineNumbers="true" %}

```csharp
//Request
  System.Collections.Specialized.NameValueCollection 
  MyPost = new System.Collections.Specialized.NameValueCollection();
  MyPost.Add("xKey", ""); // Credential
  MyPost.Add("xVersion", "4.5.5"); // API version
  MyPost.Add("xSoftwareName", My.Application.Info.Title); // Name of your software
  MyPost.Add("xSoftwareVersion", My.Application.Info.Version.ToString); // Version of your software
  MyPost.Add("xCommand", "cc:sale");
  MyPost.Add("xCardNum", "");
  MyPost.Add("xExp", "");
  MyPost.Add("xName", "");
  MyPost.Add("xAmount", "");
  MyPost.Add("xAccount", "");
  MyPost.Add("xMagstripe", "");
  MyPost.Add("xToken", "");
  MyPost.Add("xCustom01", "");
  MyPost.Add("xCVV", "");
  MyPost.Add("xStreet", "");
  MyPost.Add("xZip", "");
  MyPost.Add("xBillFirstName", "");
  MyPost.Add("xBillMiddleName", "");
  MyPost.Add("xBillLastName", "");
  MyPost.Add("xBillCompany", "");
  MyPost.Add("xBillStreet", "");
  MyPost.Add("xBillStreet2", "");
  MyPost.Add("xBillCity", "");
  MyPost.Add("xBillZip", "");	
  MyPost.Add("xBillCountry", "");
  MyPost.Add("xBillPhone", "");
  MyPost.Add("xBillMobile", "");
  MyPost.Add("xShipFirstName", "");
  MyPost.Add("xShipMiddleName", "");
  MyPost.Add("xShipLastName", "");
  MyPost.Add("xShipCompany", ""); 
  MyPost.Add("xShipStreet", "");
  MyPost.Add("xShipStreet2", "");
  MyPost.Add("xShipCity", "");
  MyPost.Add("xShipState", "");
  MyPost.Add("xShipZip", "");
  MyPost.Add("xShipCountry", "");
  MyPost.Add("xShipPhone", "");
  MyPost.Add("xShipMobile", "");
  MyPost.Add("xRefNum", "");
  MyPost.Add("xAuthCode", "");
  MyPost.Add("xIP", "");
  MyPost.Add("xRouting", "");
  MyPost.Add("xCardpresent", "");
  MyPost.Add("xDUKPT", "");
  MyPost.Add("xTax", "");
  MyPost.Add("xTip", "");
  MyPost.Add("xInvoice", "");
  MyPost.Add("xPONum", "");
  MyPost.Add("xComments", "");
  MyPost.Add("xDescription", "");
  MyPost.Add("xEmail", "");
  MyPost.Add("xFax", "");
  MyPost.Add("xBillState", "");
  MyPost.Add("xAllowPartialAuth", "");
  MyPost.Add("xRxAmount", "");
  MyPost.Add("xDentalAmount", "");
  MyPost.Add("xVisionAmount", "");
  MyPost.Add("xTransitAmount", "");
  MyPost.Add("xCopayAmount", "");
  MyPost.Add("xClinicalAmount", "");
  MyPost.Add("xOrderID", "");
  MyPost.Add("xExistingCustomer", "");
  MyPost.Add("xAllowDuplicate", "");
  MyPost.Add("xMICR", "");
  MyPost.Add("xCheckNum", "");
  MyPost.Add("xCheckImageFront", "");
  MyPost.Add("xCheckImageBack", "");
  MyPost.Add("xVoucherApproval", "");
  MyPost.Add("xVoucherSerial", "");
  MyPost.Add("xGatewayRefNum", "");
  MyPost.Add("xGatewayResult", "");
  MyPost.Add("xGatewayError", "");
  MyPost.Add("xGatewayCVV", "");
  MyPost.Add("xGatewayAVS", "");
  MyPost.Add("xOrderItems", "");
  MyPost.Add("xOrderType", "");
  MyPost.Add("xCustomerComments", "");
  MyPost.Add("xShipMethod", "");
  MyPost.Add("xShipAmount", "");
  
  System.Net.WebClient MyClient = new System.Net.WebClient();
  string MyResponse = System.Text.UTF8Encoding.ASCII.GetString(MyClient.UploadValues("https://x1.cardknox.com/gateway", MyPost));
  // Response
  System.Collections.Specialized.NameValueCollection MyResponseData = System.Web.HttpUtility.ParseQueryString(MyResponse); // If necessary, add reference to System.Web
  string MyResult = "";
  if (MyResponseData.AllKeys.Contains("xResult"))
  MyResult = MyResponseData["xResult"];
  string MyStatus = "";
  if (MyResponseData.AllKeys.Contains("xStatus"))
    MyStatus = MyResponseData["xStatus"];
    string MyError = "";
  if (MyResponseData.AllKeys.Contains("xError"))
    MyError = MyResponseData["xError"];
    string MyRefNum = "";
  if (MyResponseData.AllKeys.Contains("xRefNum"))
    MyRefNum = MyResponseData["xRefNum"];
```

{% endcode %}

### Java/Android

{% code overflow="wrap" lineNumbers="true" %}

```java
public void postData() 
  { 
    // Create a new HttpClient and Post Header Java/Android
    HttpClient httpclient = new DefaultHttpClient(); 
    HttpPost httppost = new HttpPost("https://x1.cardknox.com/gateway"); 
    try 
      { 
        // Add your data 
        List nameValuePairs = new ArrayList(9); 
        nameValuePairs.add(new BasicNameValuePair("xKey", "")); // Credential 
        nameValuePairs.add(new BasicNameValuePair("xVersion", "4.5.5")); // API Version
        nameValuePairs.add(new BasicNameValuePair("xSoftwareName", "")); // Name of your software
        nameValuePairs.add(new BasicNameValuePair("xSoftwareVersion", "")); // Version of your software 
        nameValuePairs.add(new BasicNameValuePair("xCommand", "cc:sale")); 
        nameValuePairs.add(new BasicNameValuePair("xCardNum", "")); 
        nameValuePairs.add(new BasicNameValuePair("xExp", "")); 
        nameValuePairs.add(new BasicNameValuePair("xName", "")); 
        nameValuePairs.add(new BasicNameValuePair("xAmount", ""));
        nameValuePairs.add(new BasicNameValuePair("xAccount", ""));
        nameValuePairs.add(new BasicNameValuePair("xMagstripe", "")); 
        nameValuePairs.add(new BasicNameValuePair("xToken", "")); 
        nameValuePairs.add(new BasicNameValuePair("xCustom01", "")); 
        nameValuePairs.add(new BasicNameValuePair("xCVV", "")); 
        nameValuePairs.add(new BasicNameValuePair("xStreet", "")); 
        nameValuePairs.add(new BasicNameValuePair("xZip", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillFirstName", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillMiddleName", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillLastName", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillCompany", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillStreet", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillStreet2", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillCity", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillZip", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillCountry", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillPhone", "")); 
        nameValuePairs.add(new BasicNameValuePair("xBillMobile", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipFirstName", "")); 
	nameValuePairs.add(new BasicNameValuePair("xShipMiddleName", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipLastName", "")); 
	nameValuePairs.add(new BasicNameValuePair("xShipCompany", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipStreet", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipStreet2", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipCity", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipState", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipZip", "")); 
	nameValuePairs.add(new BasicNameValuePair("xShipCountry", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipPhone", "")); 
        nameValuePairs.add(new BasicNameValuePair("xShipMobile", "")); 
        nameValuePairs.add(new BasicNameValuePair("xRefNum", "")); 
	nameValuePairs.add(new BasicNameValuePair("xAuthCode", "")); 
	nameValuePairs.add(new BasicNameValuePair("xIP", "")); 
	nameValuePairs.add(new BasicNameValuePair("xRouting", "")); 
	nameValuePairs.add(new BasicNameValuePair("xCardpresent", "")); 
	nameValuePairs.add(new BasicNameValuePair("xDUKPT", "")); 
	nameValuePairs.add(new BasicNameValuePair("xTax", "")); 
	nameValuePairs.add(new BasicNameValuePair("xTip", "")); 
	nameValuePairs.add(new BasicNameValuePair("xInvoice", "")); 
	nameValuePairs.add(new BasicNameValuePair("xPONum", "")); 
	nameValuePairs.add(new BasicNameValuePair("xComments", "")); 
	nameValuePairs.add(new BasicNameValuePair("xDescription", "")); 
	nameValuePairs.add(new BasicNameValuePair("xEmail", "")); 
	nameValuePairs.add(new BasicNameValuePair("xFax", "")); 
	nameValuePairs.add(new BasicNameValuePair("xBillState", "")); 
	nameValuePairs.add(new BasicNameValuePair("xAllowPartialAuth", "")); 
	nameValuePairs.add(new BasicNameValuePair("xRxAmount", "")); 
	nameValuePairs.add(new BasicNameValuePair("xDentalAmount", "")); 
	nameValuePairs.add(new BasicNameValuePair("xVisionAmount", "")); 
	nameValuePairs.add(new BasicNameValuePair("xTransitAmount", "")); 
	nameValuePairs.add(new BasicNameValuePair("xCopayAmount", "")); 
	nameValuePairs.add(new BasicNameValuePair("xClinicalAmount", "")); 
	nameValuePairs.add(new BasicNameValuePair("xOrderID", "")); 
	nameValuePairs.add(new BasicNameValuePair("xExistingCustomer", "")); 
	nameValuePairs.add(new BasicNameValuePair("xAllowDuplicate", "")); 
	nameValuePairs.add(new BasicNameValuePair("xMICR", "")); 
	nameValuePairs.add(new BasicNameValuePair("xCheckNum", "")); 
	nameValuePairs.add(new BasicNameValuePair("xCheckImageFront", "")); 
	nameValuePairs.add(new BasicNameValuePair("xCheckImageBack", "")); 
	nameValuePairs.add(new BasicNameValuePair("xVoucherApproval", "")); 
	nameValuePairs.add(new BasicNameValuePair("xVoucherSerial", "")); 
	nameValuePairs.add(new BasicNameValuePair("xGatewayRefNum", "")); 
	nameValuePairs.add(new BasicNameValuePair("xGatewayResult", "")); 
	nameValuePairs.add(new BasicNameValuePair("xGatewayError", "")); 
	nameValuePairs.add(new BasicNameValuePair("xGatewayCVV", "")); 
	nameValuePairs.add(new BasicNameValuePair("xGatewayAVS", "")); 
	nameValuePairs.add(new BasicNameValuePair("xOrderItems", "")); 
	nameValuePairs.add(new BasicNameValuePair("xOrderType", "")); 
	nameValuePairs.add(new BasicNameValuePair("xCustomerComments", "")); 
	nameValuePairs.add(new BasicNameValuePair("xShipMethod", "")); 
	nameValuePairs.add(new BasicNameValuePair("xShipAmount", "")); 
	httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); 
        // Execute HTTP Post Request 
        HttpResponse response = httpclient.execute(httppost); 
        System.out.println("response = " + EntityUtils.toString(response.getEntity())); 
      } 
    catch (ClientProtocolException e) 
      { 
        // TODO Auto-generated catch block 
      } 
    catch (IOException e) 
      { 
        // TODO Auto-generated catch block 
      } 
  }
```

{% endcode %}

### Node.js

{% code overflow="wrap" lineNumbers="true" %}

```javascript
// Node.Js
var request = require("request");
var querystring = require('querystring');
request.post({
  url: 'https://x1.cardknox.com/gateway',
  form: {
    xKey: '', // Credential
    xVersion: '', // API Version
    xSoftwareName: '', // Name of your software
    xSoftwareVersion: '', // Version of your software
    xCommand: '',
    xCardNum: '',
    xExp: '',
    xAmount: '',
    xAccount:'',
    xMagstripe:'',
    xToken:'',
    xCustom01:'',
    xCVV:'',
    xStreet:'',
    xZip:'',
    xBillFirstName:'',
    xBillMiddleName:'',
    xBillLastName:'',
    xBillCompany:'',
    xBillStreet:'',
    xBillStreet2:'',
    xBillCity:'',
    xBillCountry:'',
    xBillPhone:'',
    xShipFirstName:'',
    xShipMiddleName:'',
    xShipCompany:'',
    xShipStreet:'',
    xShipStreet2:'',
    xShipCity:'',
    xShipState:'',
    xShipZip:'',
    xShipCountry:'',
    xShipPhone:'',
    xShipMobile:'',
    xRefNum:'',
    xAuthCode:'',
    xRouting:'',
    xCardpresent:'',
    xDUKPT:'',
    xTax:'',
    xTip:'',
    xInvoice:'',
    xPONum:'',
    xComments:'',
    xDescription:'',
    xEmail:'',
    xFax:'',
    xBillState:'',
    xAllowPartialAuth:'',
    xRxAmount:'',
    xDentalAmount:'',
    xVisionAmount:'',
    xTransitAmount:'',
    xCopayAmount:'',
    xClinicalAmount:'',
    xOrderID:'',
    xExistingCustomer:'',
    xAllowDuplicate:'',
    xMICR:'',
    xCheckNum:'',
    xCheckImageFront:'',
    xCheckImageBack:'',
    xVoucherApproval:'',
    xVoucherSerial:'',
    xGatewayRefNum:'',
    xGatewayResult:'',
    xGatewayError:'',
    xGatewayCVV:'',
    xGatewayAVS:'',
    xOrderItems:'',
    xOrderType:'',
    xCustomerComments:'',
    xShipMethod:'',
    xShipAmount:'',
  }
},
  function (error, response, body) {
    if (error) throw new Error(error);
    console.log(querystring.parse(body));
  });
```

{% endcode %}

### PHP

{% code overflow="wrap" lineNumbers="true" %}

```php
<?php
	// Request 
	$data = array();
	$data["xKey"] = ""; // Credential
	$data["xVersion"] = ""; // API Version
	$data["xSoftwareName"] = ""; // Name of your software
	$data["xSoftwareVersion"] = ""; // Version of your software
	$data["xCommand"] = "";
	$data["xCardNum"] = "";
	$data["xExp"] = "";
	$data["xName"] = "";
	$data["xAmount"] = "";
	$data["xAccount"] = "";
	$data["xMagstripe"] = "";
	$data["xToken"] = "";
	$data["xCustom01"] = "";
	$data["xCVV"] = "";
	$data["xStreet"] = "";
	$data["xZip"] = "";
	$data["xBillFirstName"] = "";
	$data["xBillMiddleName"] = "";
	$data["xBillLastName"] = "";
	$data["xBillCompany"] = "";
	$data["xBillStreet"] = "";
	$data["xBillStreet2"] = "";
	$data["xBillState"] = "";
	$data["xBillCity"] = "";
	$data["xBillZip"] = "";
	$data["xBillCountry"] = "";
	$data["xBillPhone"] = "";
	$data["xBillMobile"] = "";
	$data["xShipFirstName"] = "";
	$data["xShipMiddleName"] = "";
	$data["xShipLastName"] = "";
	$data["xShipCompany"] = "";
	$data["xShipStreet"] = "";
	$data["xShipStreet2"] = "";
	$data["xShipCity"] = "";
	$data["xShipState"] = "";
	$data["xShipZip"] = "";
	$data["xShipCountry"] = "";
	$data["xShipPhone"] = "";
	$data["xShipMobile"] = "";
	$data["xRefNum"] = "";
	$data["xAuthCode"] = ""; 
	$data["xIP"] = ""; 
	$data["xRouting"] = ""; 
	$data["xCardpresent"] = "";	
	$data["xDUKPT"] = "";
	$data["xTax"] = "";  
	$data["xTip"] = "";
	$data["xInvoice"] = "";	
	$data["xPONum"] = "";	
	$data["xComments"] = "";
	$data["xDescription"] = "";  
	$data["xEmail"] = "";
	$data["xFax"] = "";	
	$data["xBillState"] = "";	
	$data["xAllowPartialAuth"] = "";
	$data["xRxAmount"] = "";  
	$data["xDentalAmount"] = "";
	$data["xVisionAmount"] = "";	
	$data["xTransitAmount"] = "";	
	$data["xCopayAmount"] = "";
	$data["xClinicalAmount"] = "";  
	$data["xOrderID"] = "";
	$data["xExistingCustomer"] = "";	
	$data["xAllowDuplicate"] = "";	
	$data["xMICR"] = "";  
	$data["xCheckNum"] = "";
	$data["xCheckImageFront"] = "";	
	$data["xCheckImageBack"] = "";	
	$data["xVoucherApproval"] = "";  
	$data["xVoucherSerial"] = "";
	$data["xGatewayRefNum"] = "";	
	$data["xGatewayResult"] = "";	
	$data["xGatewayError"] = "";  
	$data["xGatewayCVV"] = "";
	$data["xGatewayAVS"] = "";	
	$data["xOrderItems"] = "";	
	$data["xOrderType"] = "";  
	$data["xCustomerComments"] = "";
	$data["xShipMethod"] = "";	
	$data["xShipAmount"] = "";	
	
    function buildQuery($data)
      { 
        if(function_exists('http_build_query') && ini_get('arg_separator.output')=='&') return http_build_query($data); 
        $tmp = array(); 
        foreach($data as $key=>$val) $tmp[] = rawurlencode($key) . '=' . rawurlencode($val); 
        return implode('&', $tmp); 
      }
    $data = buildQuery($data); 
    $ch = curl_init("https://x1.cardknox.com/gateway"); 
    if(!is_resource($ch)) 
      { 
        echo "Error: Unable to initialize CURL ($ch)"; 
        exit; 
      } 
    curl_setopt($ch, CURLOPT_HEADER, 1); 
    curl_setopt($ch, CURLOPT_POST,1); 
    curl_setopt($ch, CURLOPT_TIMEOUT, 45); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $raw_result = curl_exec($ch); 
    if(curl_error($ch) != "") 
      { 
        echo curl_error($ch); 
      } 
    elseif(!strlen($raw_result)) 
      {
        echo "Error reading from card processing gateway. Please contact the merchant to verify whether transaction has been processed."; 
        curl_close($ch); 
        exit; 
      } 
    elseif($raw_result == false)
      { 
        echo "Blank response from card processing gateway."; 
        curl_close($ch); 
        exit; 
      } 
    else 
      { 
        // SUCCESS 
        curl_close($ch); 
        // result will be on the last line of the return 
        $tmp = explode("\n",$raw_result); 
        $result_string = $tmp[count($tmp)-1]; 
        parse_str($result_string, $result_array);  
        print_r($result_array); 
      }
	  ?>
```

{% endcode %}

### Python 2

{% code overflow="wrap" lineNumbers="true" %}

```python
# Python 2
import urllib2, urllib
from urlparse import parse_qs
data = {}
data["xKey"] = "" # Credential
data["xVersion"] = "" # API Version
data["xSoftwareName"] = "" # Name of your software
data["xSoftwareVersion"] = "" # Version of your software
data["xCommand"] = ""
data["xCardNum"] = ""
data["xExp"] = ""
data["xName"] = ""
data["xAmount"] = ""
data["xAccount"] = ""
data["xMagstripe"] = ""
data["xToken"] = ""
data["xCustom01"] = ""
data["xCVV"] = ""
data["xStreet"] = ""
data["xZip"] = ""
data["xBillFirstName"] = ""
data["xBillMiddleName"] = ""
data["xBillLastName"] = ""
data["xBillCompany"] = ""
data["xBillStreet"] = ""
data["xBillStreet2"] = ""
data["xBillCity"] = ""
data["xBillCountry"] = ""
data["xBillPhone"] = ""
data["xBillMobile"] = ""
data["xShipFirstName"] = ""
data["xShipMiddleName"] = ""
data["xShipCompany"] = ""
data["xShipStreet"] = ""
data["xShipStreet2"] = ""
data["xShipCity"] = ""
data["xShipState"] = ""
data["xShipZip"] = ""
data["xShipCountry"] = ""
data["xShipPhone"] = ""
data["xShipMobile"] = ""
data["xRefNum"] = ""
data["xAuthCode"] = ""
data["xIP"] = ""
data["xRouting"] = ""
data["xCardpresent"] = ""
data["xDUKPT"] = ""
data["xTax"] = ""
data["xTip"] = ""
data["xInvoice"] = ""
data["xPONum"] = ""
data["xComments"] = ""
data["xDescription"] = ""
data["xEmail"] = ""
data["xFax"] = ""
data["xBillState"] = ""
data["xAllowPartialAuth"] = ""
data["xRxAmount"] = ""
data["xDentalAmount"] = ""
data["xVisionAmount"] = ""
data["xTransitAmount"] = ""
data["xCopayAmount"] = ""
data["xClinicalAmount"] = ""
data["xOrderID"] = ""
data["xExistingCustomer"] = ""
data["xAllowDuplicate"] = ""
data["xMICR"] = ""
data["xCheckNum"] = ""
data["xCheckImageFront"] = ""
data["xCheckImageBack"] = ""
data["xVoucherApproval"] = ""
data["xVoucherSerial"] = ""
data["xGatewayRefNum"] = ""
data["xGatewayResult"] = ""
data["xGatewayError"] = ""
data["xGatewayCVV"] = ""
data["xGatewayAVS"] = ""
data["xOrderItems"] = ""
data["xOrderType"] = ""
data["xCustomerComments"] = ""
data["xShipMethod"] = ""
data["xShipAmount"] = ""

request = urllib2.Request("https://x1.cardknox.com/gateway", urllib.urlencode(data).encode('utf-8'))
rawResponse = urllib2.urlopen(request).read().decode('utf-8')
response = parse_qs(rawResponse, keep_blank_values=True)
print("xRefNum: " + "".join(response.get("xRefNum","")));
print("xResult: " + "".join(response.get("xResult","")));
print("xStatus: " + "".join(response.get("xStatus","")));
print("xError:  " + "".join(response.get("xError","")));
```

{% endcode %}

### Python 3

{% code overflow="wrap" lineNumbers="true" %}

```python
# Python 3
import urllib.request
from urllib.parse import parse_qs
data = {}
data["xKey"] = "" # Credential
data["xVersion"] = "" # API Version
data["xSoftwareName"] = "" # Name of your software
data["xSoftwareVersion"] = "" # Version of your software
data["xCommand"] = ""
data["xCardNum"] = ""
data["xExp"] = ""
data["xName"] = ""
data["xAmount"] = ""
data["xAccount"] = ""
data["xMagstripe"] = ""
data["xToken"] = ""
data["xCustom01"] = ""
data["xCVV"] = ""
data["xStreet"] = ""
data["xZip"] = ""
data["xBillFirstName"] = ""
data["xBillMiddleName"] = ""
data["xBillLastName"] = ""
data["xBillCompany"] = ""
data["xBillStreet"] = ""
data["xBillStreet2"] = ""
data["xBillCity"] = ""
data["xBillCountry"] = ""
data["xBillPhone"] = ""
data["xBillMobile"] = ""
data["xShipFirstName"] = ""
data["xShipMiddleName"] = ""
data["xShipCompany"] = ""
data["xShipStreet"] = ""
data["xShipStreet2"] = ""
data["xShipCity"] = ""
data["xShipState"] = ""
data["xShipZip"] = ""
data["xShipCountry"] = ""
data["xShipPhone"] = ""
data["xShipMobile"] = ""
data["xRefNum"] = ""
data["xAuthCode"] = ""
data["xIP"] = ""
data["xRouting"] = ""
data["xCardpresent"] = ""
data["xDUKPT"] = ""
data["xTax"] = ""
data["xTip"] = ""
data["xInvoice"] = ""
data["xPONum"] = ""
data["xComments"] = ""
data["xDescription"] = ""
data["xEmail"] = ""
data["xFax"] = ""
data["xBillState"] = ""
data["xAllowPartialAuth"] = ""
data["xRxAmount"] = ""
data["xDentalAmount"] = ""
data["xVisionAmount"] = ""
data["xTransitAmount"] = ""
data["xCopayAmount"] = ""
data["xClinicalAmount"] = ""
data["xOrderID"] = ""
data["xExistingCustomer"] = ""
data["xAllowDuplicate"] = ""
data["xMICR"] = ""
data["xCheckNum"] = ""
data["xCheckImageFront"] = ""
data["xCheckImageBack"] = ""
data["xVoucherApproval"] = ""
data["xVoucherSerial"] = ""
data["xGatewayRefNum"] = ""
data["xGatewayResult"] = ""
data["xGatewayError"] = ""
data["xGatewayCVV"] = ""
data["xGatewayAVS"] = ""
data["xOrderItems"] = ""
data["xOrderType"] = ""
data["xCustomerComments"] = ""
data["xShipMethod"] = ""
data["xShipAmount"] = ""
request = urllib.request.Request("https://x1.cardknox.com/gateway", urllib.parse.urlencode(data).encode('utf-8'))
rawResponse = urllib.request.urlopen(request).read().decode('utf-8')
response = parse_qs(rawResponse, keep_blank_values=True)
print("xRefNum: " + "".join(response.get("xRefNum","")));
print("xResult: " + "".join(response.get("xResult","")));
print("xStatus: " + "".join(response.get("xStatus","")));
print("xError:  " + "".join(response.get("xError","")));
```

{% endcode %}

### VB.NET

{% code overflow="wrap" lineNumbers="true" %}

```vbnet
  'Request
  Dim MyPost As New System.Collections.Specialized.NameValueCollection 
  MyPost.Add("xKey", "") ‘Credential
  MyPost.Add("xVersion", "4.5.5") ‘API Version
  MyPost.Add("xSoftwareName", My.Application.Info.Title) ‘Name of your software
  MyPost.Add("xSoftwareVersion", My.Application.Info.Version.ToString) ‘Version of your software 
  MyPost.Add("xCommand", "cc:sale")
  MyPost.Add("xCardNum", "")
  MyPost.Add("xExp", "")
  MyPost.Add("xName", "")
  MyPost.Add("xAmount", "")
  MyPost.Add("xAccount", "")
  MyPost.Add("xMagstripe", "")
  MyPost.Add("xToken", "")
  MyPost.Add("xCustom01", "")
  MyPost.Add("xCVV", "")
  MyPost.Add("xStreet", "")
  MyPost.Add("xZip", "")
  MyPost.Add("xBillFirstName", "")
  MyPost.Add("xBillMiddleName", "")
  MyPost.Add("xBillLastName", "")
  MyPost.Add("xBillCompany", "")
  MyPost.Add("xBillStreet", "")
  MyPost.Add("xBillStreet2", "")
  MyPost.Add("xBillCity", "")
  MyPost.Add("xBillZip", "")
  MyPost.Add("xBillCountry", "")
  MyPost.Add("xBillPhone", "")
  MyPost.Add("xBillMobile", "")
  MyPost.Add("xShipFirstName", "")
  MyPost.Add("xShipMiddleName", "")
  MyPost.Add("xShipLastName", "")
  MyPost.Add("xShipCompany", "");
  MyPost.Add("xShipStreet", "")
  MyPost.Add("xShipStreet2", "")
  MyPost.Add("xShipCity", "")
  MyPost.Add("xShipState", "")
  MyPost.Add("xShipZip", "")
  MyPost.Add("xShipCountry", "")
  MyPost.Add("xShipPhone", "")
  MyPost.Add("xShipMobile", "")
  MyPost.Add("xRefNum", "")
  MyPost.Add("xAuthCode", "")
  MyPost.Add("xIP", "")
  MyPost.Add("xRouting", "")
  MyPost.Add("xCardpresent", "")
  MyPost.Add("xDUKPT", "")
  MyPost.Add("xTax", "")
  MyPost.Add("xTip", "")
  MyPost.Add("xInvoice", "")
  MyPost.Add("xPONum", "")
  MyPost.Add("xComments", "")
  MyPost.Add("xDescription", "")
  MyPost.Add("xEmail", "")
  MyPost.Add("xFax", "")
  MyPost.Add("xBillState", "")
  MyPost.Add("xAllowPartialAuth", "")
  MyPost.Add("xRxAmount", "")
  MyPost.Add("xDentalAmount", "")
  MyPost.Add("xVisionAmount", "")
  MyPost.Add("xTransitAmount", "")
  MyPost.Add("xCopayAmount", "")
  MyPost.Add("xClinicalAmount", "")
  MyPost.Add("xOrderID", "")
  MyPost.Add("xExistingCustomer", "")
  MyPost.Add("xAllowDuplicate", "")
  MyPost.Add("xMICR", "")
  MyPost.Add("xCheckNum", "")
  MyPost.Add("xCheckImageFront", "")
  MyPost.Add("xCheckImageBack", "")
  MyPost.Add("xVoucherApproval", "")
  MyPost.Add("xVoucherSerial", "")
  MyPost.Add("xGatewayRefNum", "")
  MyPost.Add("xGatewayResult", "")
  MyPost.Add("xGatewayError", "")
  MyPost.Add("xGatewayCVV", "")
  MyPost.Add("xGatewayAVS", "")     
  MyPost.Add("xOrderItems", "")
  MyPost.Add("xOrderType", "")
  MyPost.Add("xCustomerComments", "")
  MyPost.Add("xShipMethod", "")
  MyPost.Add("xShipAmount", "")    
  Dim MyClient As New Net.WebClient
  Dim MyResponse As String = System.Text.UTF8Encoding.ASCII.GetString(MyClient.UploadValues("https://x1.cardknox.com/gateway", MyPost))
  'Response
  Dim MyResponseData As System.Collections.Specialized.NameValueCollection = System.Web.HttpUtility.ParseQueryString(MyResponse) 'If necessary, add reference to System.Web
  Dim MyResult As String = ""
  If MyResponseData.AllKeys.Contains("xResult") Then MyResult = MyResponseData("xResult")
  Dim MyStatus As String = ""
  If MyResponseData.AllKeys.Contains("xStatus") Then MyStatus = MyResponseData("xStatus")
  Dim MyError As String = ""
  If MyResponseData.AllKeys.Contains("xError") Then MyError = MyResponseData("xError")
  Dim MyRefNum As String = ""
  If MyResponseData.AllKeys.Contains("xRefNum") Then MyRefNum = MyResponseData("xRefNum")
```

{% endcode %}


# Error Codes

xErrorCode within API docs

## Gateway errors

These errors come from the Sola gateway when the request is invalid or something is misconfigured.\
Use the table below to understand the error and how to resolve it.

| **Error Code** | **Message**                                                           | **What It Means**                                                                                                                                           | **How to Fix**                                                                                     |
| -------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| 01727          | Specified Token Not Found (SUT)                                       | The provided SUT is invalid. This usually occurs if the token has already been used.                                                                        | Ensure each SUT is used only once and generate a new one for every request.                        |
| 01208          | <p>Specified Key Not<br>Found</p><p>Specified Key Not Found (SUT)</p> | The xKey or iFields key provided is invalid. This can happen if the key is incomplete or has been modified.                                                 | Make sure you are using the full, unmodified key exactly as provided.                              |
| 99999          | <p>Signature Invalid<br>(SUT)</p>                                     | The SUT is invalid, often because the data was altered or not fully included.                                                                               | Send the full, unmodified SUT exactly as returned.                                                 |
| 01222          | <p>Unauthorized Token (V)</p><p>Unauthorized Token (I) (SUT)</p>      | The Vendor ID or iFields key is invalid. This usually occurs if the Vendor ID is incorrect or the iFields key belongs to a different account than the xKey. | Verify that the Vendor ID is correct and that the iFields key and xKey belong to the same account. |
| 01473          | <p>Card Or Magstripe<br>Required</p>                                  | The request is missing card information.                                                                                                                    | Ensure that a card number, SUT, or token is included in the transaction request.                   |

## Bank Declines

These declines come directly from the cardholder’s bank and usually need to be resolved by the cardholder with their issuing bank. In rare cases, the issue may be on Sola’s side, or we may be able to provide additional guidance. If you suspect this, please reach out to our support team.

| **Error Code** | **Message**                                                                                                                                                                                                                                                                                                                                               |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 09999          | Undefined Error                                                                                                                                                                                                                                                                                                                                           |
| 01000          | Missing Required Variable                                                                                                                                                                                                                                                                                                                                 |
| 01001          | Missing Required Tags                                                                                                                                                                                                                                                                                                                                     |
| 01002          | Missing Required Fields                                                                                                                                                                                                                                                                                                                                   |
| 01010          | Unable to verify card ID number.                                                                                                                                                                                                                                                                                                                          |
| 01011          | Customer Name Required                                                                                                                                                                                                                                                                                                                                    |
| 01012          | More Than One Record Matches PTRANNUM; Please Use TTID                                                                                                                                                                                                                                                                                                    |
| 01013          | AVSCode is required                                                                                                                                                                                                                                                                                                                                       |
| 01014          | Bad Cardholder Account Information                                                                                                                                                                                                                                                                                                                        |
| 01015          | Invalid Issuing Bank                                                                                                                                                                                                                                                                                                                                      |
| 01016          | CVV Required                                                                                                                                                                                                                                                                                                                                              |
| 01017          | Invalid Street                                                                                                                                                                                                                                                                                                                                            |
| 01018          | Unknown Error From Host                                                                                                                                                                                                                                                                                                                                   |
| 01019          | Shipping\_Information\_Required                                                                                                                                                                                                                                                                                                                           |
| 01020          | Bank Not On File                                                                                                                                                                                                                                                                                                                                          |
| 01021          | Exceeds Amount Limit                                                                                                                                                                                                                                                                                                                                      |
| 01022          | Pin Required (EBT)                                                                                                                                                                                                                                                                                                                                        |
| 01023          | Refund not permitted                                                                                                                                                                                                                                                                                                                                      |
| 01024          | Security Voilation                                                                                                                                                                                                                                                                                                                                        |
| 01025          | Invalid\_Version                                                                                                                                                                                                                                                                                                                                          |
| 01026          | Unmatched Return Not Allowed                                                                                                                                                                                                                                                                                                                              |
| 01027          | Void Rejected                                                                                                                                                                                                                                                                                                                                             |
| 01028          | Must Allow Partial Auth                                                                                                                                                                                                                                                                                                                                   |
| 01029          | AuthCode Required                                                                                                                                                                                                                                                                                                                                         |
| 01031          | Batch Error                                                                                                                                                                                                                                                                                                                                               |
| 01032          | Unable to parse response                                                                                                                                                                                                                                                                                                                                  |
| 01033          | No Such Issuer                                                                                                                                                                                                                                                                                                                                            |
| 01035          | Authonly not allowed on Debit/EBT transaction                                                                                                                                                                                                                                                                                                             |
| 01036          | Lookup status not supported                                                                                                                                                                                                                                                                                                                               |
| 01037          | Adjustment Error                                                                                                                                                                                                                                                                                                                                          |
| 01038          | Transaction Type Not Voidable                                                                                                                                                                                                                                                                                                                             |
| 01040          | Command Type Not Supported for Debit                                                                                                                                                                                                                                                                                                                      |
| 01041          | Incremental Auths Not Supported                                                                                                                                                                                                                                                                                                                           |
| 01042          | Connection Timeout                                                                                                                                                                                                                                                                                                                                        |
| 01043          | No Original                                                                                                                                                                                                                                                                                                                                               |
| 01044          | A capture requires that the existing transaction be an auth                                                                                                                                                                                                                                                                                               |
| 01045          | The original transaction cannot have this operation performed on it at this time                                                                                                                                                                                                                                                                          |
| 01046          | Disconnect before response                                                                                                                                                                                                                                                                                                                                |
| 01048          | Revocation Auth                                                                                                                                                                                                                                                                                                                                           |
| 00104          | Login failed. The login is from an untrusted domain and cannot be used with Windows authentication                                                                                                                                                                                                                                                        |
| 01050          | Account: Invalid Length                                                                                                                                                                                                                                                                                                                                   |
| 01051          | Transaction type not allowed from this source                                                                                                                                                                                                                                                                                                             |
| 01052          | No Account                                                                                                                                                                                                                                                                                                                                                |
| 01054          | Processing Institution Does Not Support That Transaction Type                                                                                                                                                                                                                                                                                             |
| 01055          | Bank Unavailable                                                                                                                                                                                                                                                                                                                                          |
| 01057          | Pin XLate Error                                                                                                                                                                                                                                                                                                                                           |
| 01058          | Merchant number does not relate to a defined bank or financial institution                                                                                                                                                                                                                                                                                |
| 01059          | Auth Prohibited                                                                                                                                                                                                                                                                                                                                           |
| 01060          | Partial Refund Not Allowed                                                                                                                                                                                                                                                                                                                                |
| 01062          | The sum of unit and qty minus disc plus freight plus duty plus tax must equal transaction amount                                                                                                                                                                                                                                                          |
| 01063          | Original Transaction Not Approved                                                                                                                                                                                                                                                                                                                         |
| 01064          | Unable to connect to remote server                                                                                                                                                                                                                                                                                                                        |
| 01066          | The underlying connection was closed                                                                                                                                                                                                                                                                                                                      |
| 01067          | Credits are not enabled                                                                                                                                                                                                                                                                                                                                   |
| 01070          | Transaction type is not voidable. Issue refund instead.                                                                                                                                                                                                                                                                                                   |
| 01072          | Routing: Invalid Value                                                                                                                                                                                                                                                                                                                                    |
| 01073          | Account: Invalid Value                                                                                                                                                                                                                                                                                                                                    |
| 01075          | Card Must Be Swiped                                                                                                                                                                                                                                                                                                                                       |
| 01076          | AVS CV2 Declined                                                                                                                                                                                                                                                                                                                                          |
| 01078          | Authentication Error                                                                                                                                                                                                                                                                                                                                      |
| 01080          | Command Not Supported                                                                                                                                                                                                                                                                                                                                     |
| 01082          | Login Failed                                                                                                                                                                                                                                                                                                                                              |
| 01083          | Issuer Unavailable                                                                                                                                                                                                                                                                                                                                        |
| 01084          | Account Not Issued                                                                                                                                                                                                                                                                                                                                        |
| 01085          | Refused                                                                                                                                                                                                                                                                                                                                                   |
| 01086          | Velocity Exception                                                                                                                                                                                                                                                                                                                                        |
| 01087          | Invalid Data                                                                                                                                                                                                                                                                                                                                              |
| 01088          | An error occurred while receiving the HTTP response                                                                                                                                                                                                                                                                                                       |
| 01089          | Remote Server Error                                                                                                                                                                                                                                                                                                                                       |
| 01090          | Unable to connect to the remote server                                                                                                                                                                                                                                                                                                                    |
| 01092          | Engine Required                                                                                                                                                                                                                                                                                                                                           |
| 01093          | No checking account                                                                                                                                                                                                                                                                                                                                       |
| 01094          | Invalid CC Account Number                                                                                                                                                                                                                                                                                                                                 |
| 01095          | Terminal not identified or inactive                                                                                                                                                                                                                                                                                                                       |
| 01096          | This terminal or user id is not permitted to process this transaction type.                                                                                                                                                                                                                                                                               |
| 01097          | Connection Error                                                                                                                                                                                                                                                                                                                                          |
| 01098          | Host Connection Error                                                                                                                                                                                                                                                                                                                                     |
| 01099          | Unknown Transaction Type                                                                                                                                                                                                                                                                                                                                  |
| 01100          | Transaction Not Found                                                                                                                                                                                                                                                                                                                                     |
| 01102          | Payment Initiative Not Supported                                                                                                                                                                                                                                                                                                                          |
| 01103          | CheckNum Invalid Value                                                                                                                                                                                                                                                                                                                                    |
| 01105          | Unable to Auth                                                                                                                                                                                                                                                                                                                                            |
| 01106          | Valid Auth Not Found                                                                                                                                                                                                                                                                                                                                      |
| 01110          | Gift Issuance not allowed for this location                                                                                                                                                                                                                                                                                                               |
| 01112          | Invalid Gift Card                                                                                                                                                                                                                                                                                                                                         |
| 01113          | Invalid GiftCard Magstripe                                                                                                                                                                                                                                                                                                                                |
| 01114          | Account Already Issued                                                                                                                                                                                                                                                                                                                                    |
| 01115          | Invalid Set ID                                                                                                                                                                                                                                                                                                                                            |
| 01116          | cannot modify transaction during settlement                                                                                                                                                                                                                                                                                                               |
| 01117          | Invalid data in Settlement Transaction Detail message                                                                                                                                                                                                                                                                                                     |
| 01118          | Reference Number Not Supported                                                                                                                                                                                                                                                                                                                            |
| 01119          | Transaction is in a state that cannot be refunded                                                                                                                                                                                                                                                                                                         |
| 01120          | Transaction already refunded                                                                                                                                                                                                                                                                                                                              |
| 01121          | Transaction not eligible for refund.                                                                                                                                                                                                                                                                                                                      |
| 01122          | The transaction ID is invalid for this transaction type                                                                                                                                                                                                                                                                                                   |
| 01123          | Capture Not Supported                                                                                                                                                                                                                                                                                                                                     |
| 01124          | Max refund amount exceeded                                                                                                                                                                                                                                                                                                                                |
| 01125          | TAX MUST BE >= 0.00 AND <= AMOUNT                                                                                                                                                                                                                                                                                                                         |
| 01126          | Invalid Order Amount (MIN)                                                                                                                                                                                                                                                                                                                                |
| 01127          | Invalid Order Amount (MAX)                                                                                                                                                                                                                                                                                                                                |
| 01128          | The provided Order has no lines in On Hold status                                                                                                                                                                                                                                                                                                         |
| 01130          | None of the order lines specified could be updated to the specified reason.                                                                                                                                                                                                                                                                               |
| 01132          | An error occurred while updating the entries                                                                                                                                                                                                                                                                                                              |
| 01135          | Unable to retrieve expiration date                                                                                                                                                                                                                                                                                                                        |
| 01137          | CVV2 check cannot be performed as no data was supplied in the authorization request.                                                                                                                                                                                                                                                                      |
| 01138          | The cc payment type and/or currency is not accepted                                                                                                                                                                                                                                                                                                       |
| 01140          | Name On Account Required.                                                                                                                                                                                                                                                                                                                                 |
| 01141          | Pin code required for credit/void                                                                                                                                                                                                                                                                                                                         |
| 01145          | This account has not been given the permission(s) required for this request.                                                                                                                                                                                                                                                                              |
| 01150          | Exceeds Count Limit                                                                                                                                                                                                                                                                                                                                       |
| 01151          | Refunds cannot be performed until the transaction has settled                                                                                                                                                                                                                                                                                             |
| 01152          | The server is temporarily unavailable. Please try back shortly.                                                                                                                                                                                                                                                                                           |
| 01153          | Backend DB Error                                                                                                                                                                                                                                                                                                                                          |
| 01154          | You have tried this card too many times                                                                                                                                                                                                                                                                                                                   |
| 01155          | No Credit Account                                                                                                                                                                                                                                                                                                                                         |
| 01160          | Revk Pay Ordered                                                                                                                                                                                                                                                                                                                                          |
| 01161          | Stop Pay Ordered                                                                                                                                                                                                                                                                                                                                          |
| 01165          | Invalid Null Account Number Last Four                                                                                                                                                                                                                                                                                                                     |
| 01167          | UserName not recognized                                                                                                                                                                                                                                                                                                                                   |
| 01170          | Phone Field Required                                                                                                                                                                                                                                                                                                                                      |
| 01171          | Country Field Required                                                                                                                                                                                                                                                                                                                                    |
| 01172          | Email Field Required                                                                                                                                                                                                                                                                                                                                      |
| 01175          | Input String was not in a correct format                                                                                                                                                                                                                                                                                                                  |
| 01179          | Authenticate Failed                                                                                                                                                                                                                                                                                                                                       |
| 01180          | Lookup Failed                                                                                                                                                                                                                                                                                                                                             |
| 01182          | Balance Temoporarily Unavailable                                                                                                                                                                                                                                                                                                                          |
| 01184          | Network Error                                                                                                                                                                                                                                                                                                                                             |
| 01185          | No Reply                                                                                                                                                                                                                                                                                                                                                  |
| 01187          | Merchant has been deactivated                                                                                                                                                                                                                                                                                                                             |
| 01188          | Funds can not be released for this transaction                                                                                                                                                                                                                                                                                                            |
| 01189          | Incorrect Device Encryption                                                                                                                                                                                                                                                                                                                               |
| 01190          | Bad MID                                                                                                                                                                                                                                                                                                                                                   |
| 01191          | Host Drop                                                                                                                                                                                                                                                                                                                                                 |
| 01192          | No Response                                                                                                                                                                                                                                                                                                                                               |
| 01193          | Transaction Count Exceeded Limit                                                                                                                                                                                                                                                                                                                          |
| 01194          | Amount exceeds original transaction amount.                                                                                                                                                                                                                                                                                                               |
| 01195          | Processor returned an invalid authorization code                                                                                                                                                                                                                                                                                                          |
| 01196          | Zip Required for Keyed Transaction                                                                                                                                                                                                                                                                                                                        |
| 01197          | Unable to connect to TSYS                                                                                                                                                                                                                                                                                                                                 |
| 01198          | Processing Error Please Try Again                                                                                                                                                                                                                                                                                                                         |
| 01199          | Server Error                                                                                                                                                                                                                                                                                                                                              |
| 01200          | Unable To Create Transaction. Please Contact Support.                                                                                                                                                                                                                                                                                                     |
| 01201          | Refund amount exceeds sale amount                                                                                                                                                                                                                                                                                                                         |
| 01202          | Credit amount exceeds sale amount                                                                                                                                                                                                                                                                                                                         |
| 01203          | Amount Required                                                                                                                                                                                                                                                                                                                                           |
| 01204          | Invalid Token                                                                                                                                                                                                                                                                                                                                             |
| 01205          | Invalid Zip                                                                                                                                                                                                                                                                                                                                               |
| 01206          | Invalid\_Pin                                                                                                                                                                                                                                                                                                                                              |
| 01207          | License Required                                                                                                                                                                                                                                                                                                                                          |
| 01209          | Activity Limit Exceeded                                                                                                                                                                                                                                                                                                                                   |
| 01210          | Over Pin Limit                                                                                                                                                                                                                                                                                                                                            |
| 01211          | Negative amount not allowed                                                                                                                                                                                                                                                                                                                               |
| 01212          | Swiping Not Allowed. Contact Support                                                                                                                                                                                                                                                                                                                      |
| 01213          | Invalid Action                                                                                                                                                                                                                                                                                                                                            |
| 01214          | Unsupported Cardtype                                                                                                                                                                                                                                                                                                                                      |
| 01215          | Not Authorized                                                                                                                                                                                                                                                                                                                                            |
| 01217          | Account is inactive                                                                                                                                                                                                                                                                                                                                       |
| 01218          | Unrecognized Trackdata Format                                                                                                                                                                                                                                                                                                                             |
| 01220          | Duplicate Keys Found                                                                                                                                                                                                                                                                                                                                      |
| 01221          | Invalid GiftCard Number                                                                                                                                                                                                                                                                                                                                   |
| 01223          | Card Number was not between 13 and 16 digits                                                                                                                                                                                                                                                                                                              |
| 01224          | Original transaction not specified                                                                                                                                                                                                                                                                                                                        |
| 01225          | Pin Pad Error                                                                                                                                                                                                                                                                                                                                             |
| 01226          | Invalid\_Command                                                                                                                                                                                                                                                                                                                                          |
| 01227          | Auth Declined                                                                                                                                                                                                                                                                                                                                             |
| 01228          | Record Not Found                                                                                                                                                                                                                                                                                                                                          |
| 01230          | Transaction Not Permitted                                                                                                                                                                                                                                                                                                                                 |
| 01231          | OrderNumber is required                                                                                                                                                                                                                                                                                                                                   |
| 01232          | Transaction Already Settled                                                                                                                                                                                                                                                                                                                               |
| 01233          | Account Required                                                                                                                                                                                                                                                                                                                                          |
| 01234          | Eligible transaction not found                                                                                                                                                                                                                                                                                                                            |
| 01235          | Missing CardCVV                                                                                                                                                                                                                                                                                                                                           |
| 01236          | Account Not Found                                                                                                                                                                                                                                                                                                                                         |
| 01237          | Terminal ID Error                                                                                                                                                                                                                                                                                                                                         |
| 01238          | PIN Retries Exceeded                                                                                                                                                                                                                                                                                                                                      |
| 01239          | Invalid Credentials                                                                                                                                                                                                                                                                                                                                       |
| 01240          | Invalid Share Group.                                                                                                                                                                                                                                                                                                                                      |
| 01241          | GiftCard Already Exists                                                                                                                                                                                                                                                                                                                                   |
| 01242          | Routing: Invalid Length                                                                                                                                                                                                                                                                                                                                   |
| 01243          | Internal Error                                                                                                                                                                                                                                                                                                                                            |
| 01244          | Credit Not Allowed                                                                                                                                                                                                                                                                                                                                        |
| 01245          | Refund Not Allowed                                                                                                                                                                                                                                                                                                                                        |
| 01246          | Void Not Allowed                                                                                                                                                                                                                                                                                                                                          |
| 01247          | Transaction Not Allowed                                                                                                                                                                                                                                                                                                                                   |
| 01248          | Order has already been imported                                                                                                                                                                                                                                                                                                                           |
| 01249          | Edit Error                                                                                                                                                                                                                                                                                                                                                |
| 01251          | Card Expired                                                                                                                                                                                                                                                                                                                                              |
| 01253          | Unable to locate transaction                                                                                                                                                                                                                                                                                                                              |
| 01254          | Req exceeds bal                                                                                                                                                                                                                                                                                                                                           |
| 01255          | The request was aborted: Could not create SSL/TLS secure channel.                                                                                                                                                                                                                                                                                         |
| 01257          | Transaction amount exceeds limit                                                                                                                                                                                                                                                                                                                          |
| 01258          | Connection Failed: Possible Setup Error                                                                                                                                                                                                                                                                                                                   |
| 01259          | Stop Recurring                                                                                                                                                                                                                                                                                                                                            |
| 01260          | Bad SE Number                                                                                                                                                                                                                                                                                                                                             |
| 01261          | Type Not Supported                                                                                                                                                                                                                                                                                                                                        |
| 01262          | Merchant does not support this card type                                                                                                                                                                                                                                                                                                                  |
| 01264          | Unable to verify card ID number                                                                                                                                                                                                                                                                                                                           |
| 01265          | Settlement Error                                                                                                                                                                                                                                                                                                                                          |
| 01266          | Limit Exceeded                                                                                                                                                                                                                                                                                                                                            |
| 01267          | Invalid AuthCode                                                                                                                                                                                                                                                                                                                                          |
| 01269          | Invalid Software                                                                                                                                                                                                                                                                                                                                          |
| 01270          | No Open Batches Found                                                                                                                                                                                                                                                                                                                                     |
| 01271          | Billing\_Information\_Required                                                                                                                                                                                                                                                                                                                            |
| 01272          | Card Fraud                                                                                                                                                                                                                                                                                                                                                |
| 01273          | Line item total must equal amount                                                                                                                                                                                                                                                                                                                         |
| 01274          | AMEXSE merchant parameter not provided                                                                                                                                                                                                                                                                                                                    |
| 01275          | Invalid Routing Number                                                                                                                                                                                                                                                                                                                                    |
| 01277          | SEC Violation                                                                                                                                                                                                                                                                                                                                             |
| 01278          | Invalid\_Routing                                                                                                                                                                                                                                                                                                                                          |
| 01279          | Amount Error                                                                                                                                                                                                                                                                                                                                              |
| 01280          | Cardnumber Mismatch                                                                                                                                                                                                                                                                                                                                       |
| 01286          | No Phone Number Provided                                                                                                                                                                                                                                                                                                                                  |
| 01287          | Invalid\_CVV                                                                                                                                                                                                                                                                                                                                              |
| 01289          | Invalid Website                                                                                                                                                                                                                                                                                                                                           |
| 01290          | Debit Requires Track2 Data                                                                                                                                                                                                                                                                                                                                |
| 01291          | Invalid Email                                                                                                                                                                                                                                                                                                                                             |
| 01294          | Invalid Exp Length                                                                                                                                                                                                                                                                                                                                        |
| 01295          | Expiration Date Must Be In Future                                                                                                                                                                                                                                                                                                                         |
| 01296          | Invalid Merchant ID                                                                                                                                                                                                                                                                                                                                       |
| 01297          | Invalid Terminal ID                                                                                                                                                                                                                                                                                                                                       |
| 01298          | Invalid Account                                                                                                                                                                                                                                                                                                                                           |
| 01299          | Invalid Account Settings                                                                                                                                                                                                                                                                                                                                  |
| 01300          | Invalid Effective Date                                                                                                                                                                                                                                                                                                                                    |
| 01301          | Invalid merchant key                                                                                                                                                                                                                                                                                                                                      |
| 01302          | Try\_Again\_Later                                                                                                                                                                                                                                                                                                                                         |
| 01303          | Void of activation after account activity                                                                                                                                                                                                                                                                                                                 |
| 01304          | Edit Honor                                                                                                                                                                                                                                                                                                                                                |
| 01305          | Not approved                                                                                                                                                                                                                                                                                                                                              |
| 01306          | Call acquirer's security                                                                                                                                                                                                                                                                                                                                  |
| 01307          | Crypto box is offline                                                                                                                                                                                                                                                                                                                                     |
| 01308          | Invalid Checking Account Number                                                                                                                                                                                                                                                                                                                           |
| 01309          | Accepted but not yet processed                                                                                                                                                                                                                                                                                                                            |
| 01310          | Promo location restricted                                                                                                                                                                                                                                                                                                                                 |
| 01311          | Bulk activation package amount error                                                                                                                                                                                                                                                                                                                      |
| 01312          | Hard Capture; Pick Up                                                                                                                                                                                                                                                                                                                                     |
| 01313          | Promotions for Internet virtual and physical cards do not match                                                                                                                                                                                                                                                                                           |
| 01314          | Transaction not permitted to terminal                                                                                                                                                                                                                                                                                                                     |
| 01315          | Reversal Rejected. Do not try again                                                                                                                                                                                                                                                                                                                       |
| 01316          | Bad checksum. The checksum provided is incorrect                                                                                                                                                                                                                                                                                                          |
| 01317          | No term record on system                                                                                                                                                                                                                                                                                                                                  |
| 01318          | System malfunction                                                                                                                                                                                                                                                                                                                                        |
| 01319          | Internet access disabled                                                                                                                                                                                                                                                                                                                                  |
| 01320          | No reason to decline                                                                                                                                                                                                                                                                                                                                      |
| 01321          | Invalid status change                                                                                                                                                                                                                                                                                                                                     |
| 01323          | TransArmor Service Unavailable                                                                                                                                                                                                                                                                                                                            |
| 01324          | Void/Full Reversal requests in which the Original Authorization was not found                                                                                                                                                                                                                                                                             |
| 01325          | Too many transactions requested                                                                                                                                                                                                                                                                                                                           |
| 01327          | Duplicate Return                                                                                                                                                                                                                                                                                                                                          |
| 01328          | Unmatched card expiry date                                                                                                                                                                                                                                                                                                                                |
| 01329          | Invalid issuer                                                                                                                                                                                                                                                                                                                                            |
| 01330          | Lost card                                                                                                                                                                                                                                                                                                                                                 |
| 01331          | Account closed                                                                                                                                                                                                                                                                                                                                            |
| 01332          | Duplicate Transaction                                                                                                                                                                                                                                                                                                                                     |
| 01333          | CCV failed                                                                                                                                                                                                                                                                                                                                                |
| 01334          | Decline                                                                                                                                                                                                                                                                                                                                                   |
| 01335          | System Error                                                                                                                                                                                                                                                                                                                                              |
| 01336          | New Account Information                                                                                                                                                                                                                                                                                                                                   |
| 01337          | Invalid account number                                                                                                                                                                                                                                                                                                                                    |
| 01338          | Invalid Card Account                                                                                                                                                                                                                                                                                                                                      |
| 01339          | Count Exceeds Limit                                                                                                                                                                                                                                                                                                                                       |
| 01340          | Transaction Error                                                                                                                                                                                                                                                                                                                                         |
| 01341          | Invalid EAN                                                                                                                                                                                                                                                                                                                                               |
| 01342          | Target embossed card entered and Transaction count entered do not match                                                                                                                                                                                                                                                                                   |
| 01343          | Debit Switch Unavailable                                                                                                                                                                                                                                                                                                                                  |
| 01344          | Approve VIP                                                                                                                                                                                                                                                                                                                                               |
| 01345          | Violation of law                                                                                                                                                                                                                                                                                                                                          |
| 01346          | Transaction destination not                                                                                                                                                                                                                                                                                                                               |
| 01347          | Expired card                                                                                                                                                                                                                                                                                                                                              |
| 01348          | Already active and reloadable                                                                                                                                                                                                                                                                                                                             |
| 01349          | Already reversed                                                                                                                                                                                                                                                                                                                                          |
| 01350          | Please retry                                                                                                                                                                                                                                                                                                                                              |
| 01351          | Invalid account/date or sales date in future                                                                                                                                                                                                                                                                                                              |
| 01352          | Product code(s) restricted                                                                                                                                                                                                                                                                                                                                |
| 01353          | Date of Birth Error for Check Processing                                                                                                                                                                                                                                                                                                                  |
| 01354          | Invalid State Code                                                                                                                                                                                                                                                                                                                                        |
| 01355          | Incorrect PIN                                                                                                                                                                                                                                                                                                                                             |
| 01356          | The authorizing network has a problem decrypting the cryptogram in the request                                                                                                                                                                                                                                                                            |
| 01357          | Transaction not permitted to cardholder                                                                                                                                                                                                                                                                                                                   |
| 01358          | Store location zero not allowed                                                                                                                                                                                                                                                                                                                           |
| 01359          | Error                                                                                                                                                                                                                                                                                                                                                     |
| 01360          | Account on hold                                                                                                                                                                                                                                                                                                                                           |
| 01361          | Approved EMV Key Load                                                                                                                                                                                                                                                                                                                                     |
| 01362          | Invalid clerk                                                                                                                                                                                                                                                                                                                                             |
| 01363          | Account is Purged                                                                                                                                                                                                                                                                                                                                         |
| 01364          | Invalid\_Amount                                                                                                                                                                                                                                                                                                                                           |
| 01365          | Invalid transaction source                                                                                                                                                                                                                                                                                                                                |
| 01366          | Invalid time zone                                                                                                                                                                                                                                                                                                                                         |
| 01367          | Service not allowed                                                                                                                                                                                                                                                                                                                                       |
| 01368          | Card issuer timed out                                                                                                                                                                                                                                                                                                                                     |
| 01370          | Bad authorization code                                                                                                                                                                                                                                                                                                                                    |
| 01371          | Duplicate Reversal                                                                                                                                                                                                                                                                                                                                        |
| 01373          | DUKPT: An error while processing the PIN block that is not related to the point-ofsale equipment. Contact the Help Desk for assistance 01372 Network Response indicates that Merchant ID/SE is invalid"                                                                                                                                                   |
| 01377          | Bad\_repay\_date                                                                                                                                                                                                                                                                                                                                          |
| 01378          | Invalid currency                                                                                                                                                                                                                                                                                                                                          |
| 01379          | Incorrect transaction version or format number for POS transactions                                                                                                                                                                                                                                                                                       |
| 01380          | Do not try again                                                                                                                                                                                                                                                                                                                                          |
| 01381          | No account link                                                                                                                                                                                                                                                                                                                                           |
| 01382          | Duplicate Completion                                                                                                                                                                                                                                                                                                                                      |
| 01383          | Allowable PIN tries exceeded                                                                                                                                                                                                                                                                                                                              |
| 01384          | Bulk activation error                                                                                                                                                                                                                                                                                                                                     |
| 01385          | CVV2 Declined                                                                                                                                                                                                                                                                                                                                             |
| 01386          | Restricted card                                                                                                                                                                                                                                                                                                                                           |
| 01387          | Incorrect location                                                                                                                                                                                                                                                                                                                                        |
| 01388          | Transaction history not available                                                                                                                                                                                                                                                                                                                         |
| 01389          | Invalid terminal                                                                                                                                                                                                                                                                                                                                          |
| 01390          | Totals Unavailable                                                                                                                                                                                                                                                                                                                                        |
| 01391          | The DUKPT Base Derivation key is missing or incorrect in the PIN pad, or PIN key synchronization error                                                                                                                                                                                                                                                    |
| 01392          | No Savings Account                                                                                                                                                                                                                                                                                                                                        |
| 01393          | Cash Back greater than total Transaction amount                                                                                                                                                                                                                                                                                                           |
| 01394          | Refer – Call Authorization (Checks only)                                                                                                                                                                                                                                                                                                                  |
| 01395          | Password retry exceeded                                                                                                                                                                                                                                                                                                                                   |
| 01396          | Currency conversion error                                                                                                                                                                                                                                                                                                                                 |
| 01397          | Unknown account                                                                                                                                                                                                                                                                                                                                           |
| 01398          | Max balance exceeded                                                                                                                                                                                                                                                                                                                                      |
| 01399          | Honor With Authentication                                                                                                                                                                                                                                                                                                                                 |
| 01401          | TransArmor Key Error                                                                                                                                                                                                                                                                                                                                      |
| 01402          | Not lost or stolen                                                                                                                                                                                                                                                                                                                                        |
| 01403          | Account already linked                                                                                                                                                                                                                                                                                                                                    |
| 01404          | Already active                                                                                                                                                                                                                                                                                                                                            |
| 01405          | Invalid transaction                                                                                                                                                                                                                                                                                                                                       |
| 01406          | No transactions available/no more transactions available                                                                                                                                                                                                                                                                                                  |
| 01407          | Debit/EBT network gateway cannot get through to the ISSUER                                                                                                                                                                                                                                                                                                |
| 01409          | Account locked                                                                                                                                                                                                                                                                                                                                            |
| 01410          | Refer to issuer‘s special conditions                                                                                                                                                                                                                                                                                                                      |
| 01411          | Insufficent\_Funds                                                                                                                                                                                                                                                                                                                                        |
| 01412          | Exceeded account reloads                                                                                                                                                                                                                                                                                                                                  |
| 01413          | Invalid merchant                                                                                                                                                                                                                                                                                                                                          |
| 01414          | Invalid new password                                                                                                                                                                                                                                                                                                                                      |
| 01415          | Request not permitted by this merchant location                                                                                                                                                                                                                                                                                                           |
| 01416          | Request not permitted by this account                                                                                                                                                                                                                                                                                                                     |
| 01417          | Enter lesser amount                                                                                                                                                                                                                                                                                                                                       |
| 01418          | Amount Too Large                                                                                                                                                                                                                                                                                                                                          |
| 01419          | No phone service                                                                                                                                                                                                                                                                                                                                          |
| 01420          | Unsuccessful                                                                                                                                                                                                                                                                                                                                              |
| 01421          | Debit/EBT transaction count exceeds pre-determined limit in specified time/ Withdrawal limit exceeded                                                                                                                                                                                                                                                     |
| 01422          | Account not in inactive state                                                                                                                                                                                                                                                                                                                             |
| 01423          | Bad Post Date                                                                                                                                                                                                                                                                                                                                             |
| 01424          | Stolen card                                                                                                                                                                                                                                                                                                                                               |
| 01426          | Unable to Locate Record On File                                                                                                                                                                                                                                                                                                                           |
| 01427          | Bulk activation un-attempted error                                                                                                                                                                                                                                                                                                                        |
| 01428          | Account status is void lock                                                                                                                                                                                                                                                                                                                               |
| 01429          | Schema Validation Error                                                                                                                                                                                                                                                                                                                                   |
| 01430          | No card record                                                                                                                                                                                                                                                                                                                                            |
| 01432          | Pick Up Card                                                                                                                                                                                                                                                                                                                                              |
| 01433          | The terminal transaction number did not match (on a void or reversal)                                                                                                                                                                                                                                                                                     |
| 01434          | Subsystem Unavailable                                                                                                                                                                                                                                                                                                                                     |
| 01435          | New Account Information available                                                                                                                                                                                                                                                                                                                         |
| 01436          | Call for authorization                                                                                                                                                                                                                                                                                                                                    |
| 01437          | Approve for partial amount                                                                                                                                                                                                                                                                                                                                |
| 01438          | Inactive account                                                                                                                                                                                                                                                                                                                                          |
| 01439          | TransArmor Invalid Token or Account Number                                                                                                                                                                                                                                                                                                                |
| 01440          | EMV Key Download Error                                                                                                                                                                                                                                                                                                                                    |
| 01441          | Do not honor                                                                                                                                                                                                                                                                                                                                              |
| 01442          | Referred – Skip Trace Info                                                                                                                                                                                                                                                                                                                                |
| 01443          | Balance not available (denial)                                                                                                                                                                                                                                                                                                                            |
| 01444          | Bad mag stripe                                                                                                                                                                                                                                                                                                                                            |
| 01446          | Approved EMV Key Load                                                                                                                                                                                                                                                                                                                                     |
| 01447          | Invalid password                                                                                                                                                                                                                                                                                                                                          |
| 01448          | Exceeds withdrawal frequency limit                                                                                                                                                                                                                                                                                                                        |
| 01449          | No previous transaction                                                                                                                                                                                                                                                                                                                                   |
| 01451          | Transaction not permitted to acquirer or terminal                                                                                                                                                                                                                                                                                                         |
| 01452          | Hard Negative Info On File                                                                                                                                                                                                                                                                                                                                |
| 01453          | Account row locked                                                                                                                                                                                                                                                                                                                                        |
| 01455          | Format error                                                                                                                                                                                                                                                                                                                                              |
| 01456          | Exceeds withdrawal amount limit                                                                                                                                                                                                                                                                                                                           |
| 01457          | Resubmission of transaction violates debit/EBT network frequency                                                                                                                                                                                                                                                                                          |
| 01458          | New password required                                                                                                                                                                                                                                                                                                                                     |
| 01462          | Transaction Previously Voided                                                                                                                                                                                                                                                                                                                             |
| 01463          | Invalid\_RefNum                                                                                                                                                                                                                                                                                                                                           |
| 01464          | Invalid Credit Card                                                                                                                                                                                                                                                                                                                                       |
| 01465          | Invalid Trackdata                                                                                                                                                                                                                                                                                                                                         |
| 01466          | Either Token or Magstripe or Card Num and Exp valid per transaction                                                                                                                                                                                                                                                                                       |
| 01467          | Refund/Void not allowed on EBT transaction                                                                                                                                                                                                                                                                                                                |
| 01468          | Invalid EBT Card                                                                                                                                                                                                                                                                                                                                          |
| 01469          | Transaction amount exceeded for test account                                                                                                                                                                                                                                                                                                              |
| 01470          | Invalid\_EXP                                                                                                                                                                                                                                                                                                                                              |
| 01471          | Refund/Void not allowed on Debit transaction                                                                                                                                                                                                                                                                                                              |
| 01472          | PIN/DUKPT Required                                                                                                                                                                                                                                                                                                                                        |
| 01474          | Invalid Pin/Dukpt                                                                                                                                                                                                                                                                                                                                         |
| 01477          | Expiration Date Required                                                                                                                                                                                                                                                                                                                                  |
| 01478          | Invalid EBT Card Length                                                                                                                                                                                                                                                                                                                                   |
| 01479          | Invalid Card                                                                                                                                                                                                                                                                                                                                              |
| 01480          | Voice\_Authentication\_Required                                                                                                                                                                                                                                                                                                                           |
| 01481          | Timeout                                                                                                                                                                                                                                                                                                                                                   |
| 01482          | Billing Address Mismatch                                                                                                                                                                                                                                                                                                                                  |
| 01483          | Invalid DUKPT format                                                                                                                                                                                                                                                                                                                                      |
| 01485          | Account Setup Error                                                                                                                                                                                                                                                                                                                                       |
| 01486          | Credit Denied                                                                                                                                                                                                                                                                                                                                             |
| 01487          | Unsupported Card Type                                                                                                                                                                                                                                                                                                                                     |
| 01488          | Processor temporarily unavailable                                                                                                                                                                                                                                                                                                                         |
| 01489          | Invalid CVV Length                                                                                                                                                                                                                                                                                                                                        |
| 01490          | Card Number Error                                                                                                                                                                                                                                                                                                                                         |
| 01491          | Invalid\_CardNumber                                                                                                                                                                                                                                                                                                                                       |
| 01492          | Invalid Tran Code                                                                                                                                                                                                                                                                                                                                         |
| 01493          | Hold Card                                                                                                                                                                                                                                                                                                                                                 |
| 01494          | Use VOID to refund an unsettled transaction                                                                                                                                                                                                                                                                                                               |
| 01495          | Invalid Variable                                                                                                                                                                                                                                                                                                                                          |
| 01496          | Invalid Hash                                                                                                                                                                                                                                                                                                                                              |
| 01500          | Invalid FSA Amounts                                                                                                                                                                                                                                                                                                                                       |
| 01501          | Resume Map                                                                                                                                                                                                                                                                                                                                                |
| 01502          | Name exceeds max length                                                                                                                                                                                                                                                                                                                                   |
| 01503          | Monthly volume exceeded                                                                                                                                                                                                                                                                                                                                   |
| 01504          | Transaction can not be completed, violation of law                                                                                                                                                                                                                                                                                                        |
| 01505          | Invalid Transaction Type                                                                                                                                                                                                                                                                                                                                  |
| 01506          | Unsupported AID                                                                                                                                                                                                                                                                                                                                           |
| 01507          | Processing Error                                                                                                                                                                                                                                                                                                                                          |
| 01508          | Invalid Store Key                                                                                                                                                                                                                                                                                                                                         |
| 01509          | Invalid Integer                                                                                                                                                                                                                                                                                                                                           |
| 01510          | Routing or MICR Required                                                                                                                                                                                                                                                                                                                                  |
| 01511          | Account Closed - Contact Cardholder (AU)                                                                                                                                                                                                                                                                                                                  |
| 01512          | Contact Cardholder (AU)                                                                                                                                                                                                                                                                                                                                   |
| 01513          | Specified source key not found.                                                                                                                                                                                                                                                                                                                           |
| 01514          | Invalid Bill Street                                                                                                                                                                                                                                                                                                                                       |
| 01515          | Invalid Bill First Name                                                                                                                                                                                                                                                                                                                                   |
| 01516          | Invalid Bill Last Name                                                                                                                                                                                                                                                                                                                                    |
| 01517          | Invalid Ship Street                                                                                                                                                                                                                                                                                                                                       |
| 01518          | Invalid Ship First Name                                                                                                                                                                                                                                                                                                                                   |
| 01519          | Invalid Ship Last Name                                                                                                                                                                                                                                                                                                                                    |
| 01520          | Declined (SF)                                                                                                                                                                                                                                                                                                                                             |
| 01521          | MVV merchant parameter empty or invalid                                                                                                                                                                                                                                                                                                                   |
| 01522          | Unable to process transaction                                                                                                                                                                                                                                                                                                                             |
| 01523          | Transaction cannot be refunded at this time                                                                                                                                                                                                                                                                                                               |
| 01524          | Transaction cannot be voided at this time                                                                                                                                                                                                                                                                                                                 |
| 01525          | Transaction Cannot Be Voided                                                                                                                                                                                                                                                                                                                              |
| 01526          | Specified source key not found                                                                                                                                                                                                                                                                                                                            |
| 01530          | FSA Not Supported                                                                                                                                                                                                                                                                                                                                         |
| 01531          | Pin Required for EBT                                                                                                                                                                                                                                                                                                                                      |
| 01532          | Account Setup error. Please Contact Support.                                                                                                                                                                                                                                                                                                              |
| 01533          | Card or Magstripe or MemberID Required                                                                                                                                                                                                                                                                                                                    |
| 01534          | Access Denied                                                                                                                                                                                                                                                                                                                                             |
| 01535          | Invalid Input                                                                                                                                                                                                                                                                                                                                             |
| 01536          | Invalid Tax                                                                                                                                                                                                                                                                                                                                               |
| 01537          | Sequence ID Required                                                                                                                                                                                                                                                                                                                                      |
| 01538          | CVV2 Refused                                                                                                                                                                                                                                                                                                                                              |
| 01539          | Transaction exceeds maximum amount.                                                                                                                                                                                                                                                                                                                       |
| 01540          | Name Required                                                                                                                                                                                                                                                                                                                                             |
| 01541          | Street exceeds max length                                                                                                                                                                                                                                                                                                                                 |
| 01542          | Invalid Service Code                                                                                                                                                                                                                                                                                                                                      |
| 01543          | Invalid Account/Card Number.                                                                                                                                                                                                                                                                                                                              |
| 01544          | CVC2/CID Rejected by Issuer.                                                                                                                                                                                                                                                                                                                              |
| 01545          | Reversal error                                                                                                                                                                                                                                                                                                                                            |
| 01546          | Invalid Name                                                                                                                                                                                                                                                                                                                                              |
| 01548          | EXAMOUNT MUST BE >= 0.00 AND <= AMOUNT                                                                                                                                                                                                                                                                                                                    |
| 01550          | EMV Pin Error                                                                                                                                                                                                                                                                                                                                             |
| 01551          | Ineligible Refnum                                                                                                                                                                                                                                                                                                                                         |
| 01552          | Invalid PNRef                                                                                                                                                                                                                                                                                                                                             |
| 01553          | Command Type Does Not Support Pin                                                                                                                                                                                                                                                                                                                         |
| 01554          | Void Not Supported For Pin Transactions                                                                                                                                                                                                                                                                                                                   |
| 01555          | Card not accepted by merchant, please try a different card                                                                                                                                                                                                                                                                                                |
| 01556          | Invalid Invoice                                                                                                                                                                                                                                                                                                                                           |
| 01557          | Refund not permitted, original sale not found                                                                                                                                                                                                                                                                                                             |
| 01558          | Balance Temporarily Unavailable                                                                                                                                                                                                                                                                                                                           |
| 01559          | System temporarily unavailable                                                                                                                                                                                                                                                                                                                            |
| 01560          | Issue Amount Exceeds Redeem Amount                                                                                                                                                                                                                                                                                                                        |
| 01561          | This card can not be used with MOTO transactions                                                                                                                                                                                                                                                                                                          |
| 01562          | Current permissions do not allow this operation. Please contact customer support.                                                                                                                                                                                                                                                                         |
| 01563          | Transaction amount below minimum                                                                                                                                                                                                                                                                                                                          |
| 01564          | Invalid check images                                                                                                                                                                                                                                                                                                                                      |
| 01565          | Invalid Username                                                                                                                                                                                                                                                                                                                                          |
| 01566          | Invalid Currency Code                                                                                                                                                                                                                                                                                                                                     |
| 01567          | Invalid Account Type                                                                                                                                                                                                                                                                                                                                      |
| 01568          | Invalid mInitial                                                                                                                                                                                                                                                                                                                                          |
| 01569          | Invalid aptNum                                                                                                                                                                                                                                                                                                                                            |
| 01570          | Invalid city                                                                                                                                                                                                                                                                                                                                              |
| 01571          | Invalid state                                                                                                                                                                                                                                                                                                                                             |
| 01572          | Invalid billZip                                                                                                                                                                                                                                                                                                                                           |
| 01573          | Invalid mailApt                                                                                                                                                                                                                                                                                                                                           |
| 01574          | Invalid mailCity                                                                                                                                                                                                                                                                                                                                          |
| 01575          | Invalid mailState                                                                                                                                                                                                                                                                                                                                         |
| 01576          | Invalid mailZip                                                                                                                                                                                                                                                                                                                                           |
| 01577          | Invalid dayPhone                                                                                                                                                                                                                                                                                                                                          |
| 01578          | Invalid evenPhone                                                                                                                                                                                                                                                                                                                                         |
| 01579          | Invalid ssn                                                                                                                                                                                                                                                                                                                                               |
| 01580          | Invalid dob                                                                                                                                                                                                                                                                                                                                               |
| 01581          | Invalid recEmail                                                                                                                                                                                                                                                                                                                                          |
| 01582          | Invalid knownAccount                                                                                                                                                                                                                                                                                                                                      |
| 01583          | Invalid rtNum                                                                                                                                                                                                                                                                                                                                             |
| 01584          | Invalid splitNum                                                                                                                                                                                                                                                                                                                                          |
| 01585          | A ProPay account With this e-mail address already exists Or User has no AccountNumber                                                                                                                                                                                                                                                                     |
| 01586          | A ProPay account With this social security number already exists                                                                                                                                                                                                                                                                                          |
| 01587          | The email address provided does Not correspond To a ProPay account.                                                                                                                                                                                                                                                                                       |
| 01588          | Recipients e-mail address shouldnt have a ProPay account And does                                                                                                                                                                                                                                                                                         |
| 01589          | Invalid Credential Or IP address Not allowed                                                                                                                                                                                                                                                                                                              |
| 01590          | Over credit card use limit                                                                                                                                                                                                                                                                                                                                |
| 01591          | Miscellaneous Error                                                                                                                                                                                                                                                                                                                                       |
| 01592          | Denied a ProPay account (Developer should display a descriptive message that guides a New user To fill out ProPay exceptions form And submit it.)                                                                                                                                                                                                         |
| 01593          | Unauthorized service requested                                                                                                                                                                                                                                                                                                                            |
| 01594          | Account Not affiliated                                                                                                                                                                                                                                                                                                                                    |
| 01595          | Duplicate invoice number (The same card was charged For the same amount With the same invoice number (including blank invoices) In a 1 minute period. Details about the original transaction are included whenever a 69 response Is returned. These details include a repeat Of the auth code, the original AVS response, And the original CVV response.) |
| 01596          | Duplicate external ID                                                                                                                                                                                                                                                                                                                                     |
| 01597          | Account previously Set up, but problem affiliating it With partner                                                                                                                                                                                                                                                                                        |
| 01598          | The ProPay Account has already been upgraded To a Premium Account                                                                                                                                                                                                                                                                                         |
| 01599          | Invalid Destination Account                                                                                                                                                                                                                                                                                                                               |
| 01600          | Account Or Trans Error                                                                                                                                                                                                                                                                                                                                    |
| 01601          | Money already pulled                                                                                                                                                                                                                                                                                                                                      |
| 01602          | Not Premium (used only For push/pull transactions)                                                                                                                                                                                                                                                                                                        |
| 01603          | Empty results                                                                                                                                                                                                                                                                                                                                             |
| 01604          | Generic account status Error                                                                                                                                                                                                                                                                                                                              |
| 01605          | InvalidUserID                                                                                                                                                                                                                                                                                                                                             |
| 01606          | BatchTransCountError                                                                                                                                                                                                                                                                                                                                      |
| 01607          | InvalidBeginDate                                                                                                                                                                                                                                                                                                                                          |
| 01608          | InvalidEndDate                                                                                                                                                                                                                                                                                                                                            |
| 01609          | InvalidExternalID                                                                                                                                                                                                                                                                                                                                         |
| 01610          | DuplicateUserID                                                                                                                                                                                                                                                                                                                                           |
| 01611          | Duplicate Batch ID                                                                                                                                                                                                                                                                                                                                        |
| 01612          | Duplicate Batch Transaction                                                                                                                                                                                                                                                                                                                               |
| 01613          | Batch Transaction amount Error                                                                                                                                                                                                                                                                                                                            |
| 01614          | Unavailable Tier                                                                                                                                                                                                                                                                                                                                          |
| 01615          | Invalid Country Code                                                                                                                                                                                                                                                                                                                                      |
| 01616          | Account created In documentary status, but still must be validated.                                                                                                                                                                                                                                                                                       |
| 01617          | Account created In documentary status, but still must be validated And paid For.                                                                                                                                                                                                                                                                          |
| 01618          | Account created successfully, but still must be paid For.                                                                                                                                                                                                                                                                                                 |
| 01619          | Invalid Payer Name                                                                                                                                                                                                                                                                                                                                        |
| 01620          | Transaction does Not meet Date criteria                                                                                                                                                                                                                                                                                                                   |
| 01621          | Direct deposit account Not specified                                                                                                                                                                                                                                                                                                                      |
| 01622          | Invalid SEC code                                                                                                                                                                                                                                                                                                                                          |
| 01623          | Invalid x509 certificate                                                                                                                                                                                                                                                                                                                                  |
| 01624          | Invalid value for require CC refund                                                                                                                                                                                                                                                                                                                       |
| 01625          | Required field Is missing (This Is returned only For edit ProPay account. See response tag For field name.)                                                                                                                                                                                                                                               |
| 01626          | Invalid EIN                                                                                                                                                                                                                                                                                                                                               |
| 01627          | Invalid business legal name (DBA)                                                                                                                                                                                                                                                                                                                         |
| 01628          | One of the business legal address fields Is invalid                                                                                                                                                                                                                                                                                                       |
| 01629          | Business (legal) city Is invalid                                                                                                                                                                                                                                                                                                                          |
| 01630          | Business (legal) state Is invalid                                                                                                                                                                                                                                                                                                                         |
| 01631          | Business (legal) zip Is invalid                                                                                                                                                                                                                                                                                                                           |
| 01632          | Business (legal) country Is invalid                                                                                                                                                                                                                                                                                                                       |
| 01633          | Mailing address invalid                                                                                                                                                                                                                                                                                                                                   |
| 01634          | Business (legal) address Is invalid                                                                                                                                                                                                                                                                                                                       |
| 01635          | Incomplete business address                                                                                                                                                                                                                                                                                                                               |
| 01636          | Amount Encumbered by enhanced Spendback                                                                                                                                                                                                                                                                                                                   |
| 01637          | Invalid key serial number                                                                                                                                                                                                                                                                                                                                 |
| 01638          | You may Not transfer money between these two accounts. Sponsor bank transfer disallowed.                                                                                                                                                                                                                                                                  |
| 01639          | Currency code Not allowed for this transaction                                                                                                                                                                                                                                                                                                            |
| 01640          | Currency code Not permitted for this account                                                                                                                                                                                                                                                                                                              |
| 01641          | Requires Additional Validation                                                                                                                                                                                                                                                                                                                            |
| 01642          | Multicurrency processing Is Not allowed for the account                                                                                                                                                                                                                                                                                                   |
| 01643          | Multicurrency processing Is Not supported For this bank processor                                                                                                                                                                                                                                                                                         |
| 01644          | Capture amount exceeds allowed amount                                                                                                                                                                                                                                                                                                                     |
| 01645          | Account setup does Not allow capture For amount greater than authorization                                                                                                                                                                                                                                                                                |
| 01646          | Threat Metrix risk denied (no responseCode Is returned)                                                                                                                                                                                                                                                                                                   |
| 01647          | Threat Metrix Invalid SessionId                                                                                                                                                                                                                                                                                                                           |
| 01648          | Threat Metrix Invalid Account configuration                                                                                                                                                                                                                                                                                                               |
| 01649          | External Payment Provider Not provided                                                                                                                                                                                                                                                                                                                    |
| 01650          | External Payment Identifier Not provided                                                                                                                                                                                                                                                                                                                  |
| 01651          | External Payment Provider Not valid                                                                                                                                                                                                                                                                                                                       |
| 01652          | Inactive Or blocked MCC Code                                                                                                                                                                                                                                                                                                                              |
| 01653          | Invalid MCC Code (non-numeric Or Not In our database)                                                                                                                                                                                                                                                                                                     |
| 01654          | Gross settle: invalid credit card information                                                                                                                                                                                                                                                                                                             |
| 01655          | Gross settle: invalid billing information                                                                                                                                                                                                                                                                                                                 |
| 01656          | Gross settle: no billing information was included with the payment info                                                                                                                                                                                                                                                                                   |
| 01657          | Debit Requires Swipe. Please Swipe or Use Credit.                                                                                                                                                                                                                                                                                                         |
| 01658          | Swipe again                                                                                                                                                                                                                                                                                                                                               |
| 01659          | Key Is Inactive                                                                                                                                                                                                                                                                                                                                           |
| 01660          | Invalid Void After Refund                                                                                                                                                                                                                                                                                                                                 |
| 01661          | Refund on a refund not allowed                                                                                                                                                                                                                                                                                                                            |
| 01662          | Invalid Cavv/Eci Value                                                                                                                                                                                                                                                                                                                                    |
| 01663          | Invalid Contactless                                                                                                                                                                                                                                                                                                                                       |
| 01664          | CVV Response Code is required                                                                                                                                                                                                                                                                                                                             |
| 01665          | Invalid processor                                                                                                                                                                                                                                                                                                                                         |
| 01666          | Processor is temporarily unavailable                                                                                                                                                                                                                                                                                                                      |
| 01667          | NOT AUTHORISED                                                                                                                                                                                                                                                                                                                                            |
| 01668          | BIN is required                                                                                                                                                                                                                                                                                                                                           |
| 01669          | Invalid license                                                                                                                                                                                                                                                                                                                                           |
| 01670          | Token Expired                                                                                                                                                                                                                                                                                                                                             |
| 01671          | Token reference not found                                                                                                                                                                                                                                                                                                                                 |
| 01672          | Invalid EMV Read. Please try again.                                                                                                                                                                                                                                                                                                                       |
| 01673          | Inactive Gift Card                                                                                                                                                                                                                                                                                                                                        |
| 01674          | Card already active                                                                                                                                                                                                                                                                                                                                       |
| 01675          | Card already inactive                                                                                                                                                                                                                                                                                                                                     |
| 01678          | Refund not permitted, amount exceeds original sale                                                                                                                                                                                                                                                                                                        |
| 01679          | Declined - Contact Support                                                                                                                                                                                                                                                                                                                                |
| 01680          | Unsupported Transaction                                                                                                                                                                                                                                                                                                                                   |
| 01681          | AVS Street Required                                                                                                                                                                                                                                                                                                                                       |
| 01683          | Line Items Required                                                                                                                                                                                                                                                                                                                                       |
| 01684          | Re enter                                                                                                                                                                                                                                                                                                                                                  |
| 01685          | Missing or Invalid PARes                                                                                                                                                                                                                                                                                                                                  |
| 01686          | Recapture not supported                                                                                                                                                                                                                                                                                                                                   |
| 01687          | You have tried too many card numbers, please contact merchant.                                                                                                                                                                                                                                                                                            |
| 01689          | Capture not allowed on voided auth                                                                                                                                                                                                                                                                                                                        |
| 01690          | Negative Tax amount not allowed                                                                                                                                                                                                                                                                                                                           |
| 01691          | Data Unavailable                                                                                                                                                                                                                                                                                                                                          |
| 01692          | Account Unavailable                                                                                                                                                                                                                                                                                                                                       |
| 01693          | This terminal has been disabled. Please contact customer service to configure the terminal.                                                                                                                                                                                                                                                               |
| 01694          | Transaction not supported                                                                                                                                                                                                                                                                                                                                 |
| 01695          | Cashback not supported                                                                                                                                                                                                                                                                                                                                    |
| 01696          | An unexpected error has occurred. Technical Support has been alerted to this problem.                                                                                                                                                                                                                                                                     |
| 01697          | Unable to map data                                                                                                                                                                                                                                                                                                                                        |
| 01698          | Invalid billing address                                                                                                                                                                                                                                                                                                                                   |
| 01699          | Incorrect CVV                                                                                                                                                                                                                                                                                                                                             |
| 01700          | AID Mismatch                                                                                                                                                                                                                                                                                                                                              |
| 01701          | Batch previously locked for settlement                                                                                                                                                                                                                                                                                                                    |
| 01702          | Insert Card Again                                                                                                                                                                                                                                                                                                                                         |
| 01703          | Card Type Not Allowed                                                                                                                                                                                                                                                                                                                                     |
| 01704          | Refund not allowed; issue void                                                                                                                                                                                                                                                                                                                            |
| 01705          | Invalid RoomNum                                                                                                                                                                                                                                                                                                                                           |
| 01706          | Amount Not Supported                                                                                                                                                                                                                                                                                                                                      |
| 01707          | Unsupported Industry                                                                                                                                                                                                                                                                                                                                      |
| 01708          | Transaction authentication required.                                                                                                                                                                                                                                                                                                                      |
| 01709          | Swipe Card                                                                                                                                                                                                                                                                                                                                                |
| 01710          | Encryption Required (Port)                                                                                                                                                                                                                                                                                                                                |
| 01711          | Specified Encryption Key Not Found                                                                                                                                                                                                                                                                                                                        |
| 01712          | Debit Void Not Supported                                                                                                                                                                                                                                                                                                                                  |
| 01713          | Command Type Not Supported For Debit/EBT                                                                                                                                                                                                                                                                                                                  |
| 01714          | Invalid chip read; try again.                                                                                                                                                                                                                                                                                                                             |
| 01715          | Invalid Start Date (Batch Report)                                                                                                                                                                                                                                                                                                                         |
| 01716          | Invalid Start Date/Time                                                                                                                                                                                                                                                                                                                                   |
| 01717          | Swipe Not Allowed                                                                                                                                                                                                                                                                                                                                         |
| 01718          | Invalid EntryMode                                                                                                                                                                                                                                                                                                                                         |
| 01719          | Invalid Encryption Key                                                                                                                                                                                                                                                                                                                                    |
| 01720          | Signature Invalid (SUT)                                                                                                                                                                                                                                                                                                                                   |
| 01721          | Transaction can no longer be voided                                                                                                                                                                                                                                                                                                                       |
| 01722          | Invalid Encrypted Swipe                                                                                                                                                                                                                                                                                                                                   |
| 01723          | One or more errors occurred                                                                                                                                                                                                                                                                                                                               |
| 01724          | The referenced transaction does not meet the criteria for issuing a credit                                                                                                                                                                                                                                                                                |
| 01725          | Bill field required                                                                                                                                                                                                                                                                                                                                       |
| 01726          | Invalid GiftCard Length                                                                                                                                                                                                                                                                                                                                   |
| 01728          | Invalid Batch Sequence                                                                                                                                                                                                                                                                                                                                    |
| 01729          | Missing Required Credit Card Data                                                                                                                                                                                                                                                                                                                         |
| 01730          | Unable to Communicate with MAPS Server                                                                                                                                                                                                                                                                                                                    |
| 01731          | Bad Data                                                                                                                                                                                                                                                                                                                                                  |
| 01732          | Verify Balances                                                                                                                                                                                                                                                                                                                                           |
| 01733          | OOS Required                                                                                                                                                                                                                                                                                                                                              |
| 01734          | Currency Not Supported                                                                                                                                                                                                                                                                                                                                    |
| 01735          | Object reference not set to an instance of an object                                                                                                                                                                                                                                                                                                      |
| 01736          | Source has been blocked from processing transactions.                                                                                                                                                                                                                                                                                                     |
| 01737          | Invalid Field                                                                                                                                                                                                                                                                                                                                             |
| 01738          | An error occurred during processing. Call Merchant Service Provider.                                                                                                                                                                                                                                                                                      |
| 01739          | Partial Auth not supported for eWIC                                                                                                                                                                                                                                                                                                                       |
| 01740          | This transaction cannot be accepted.                                                                                                                                                                                                                                                                                                                      |
| 01741          | Invalid eWIC card                                                                                                                                                                                                                                                                                                                                         |
| 01742          | Could not Retrieve Transaction ID                                                                                                                                                                                                                                                                                                                         |
| 01743          | Missing part of path                                                                                                                                                                                                                                                                                                                                      |
| 01744          | Error Processing Lookup Request Message                                                                                                                                                                                                                                                                                                                   |
| 01745          | Invoice exceeds max length. Field has been truncated.                                                                                                                                                                                                                                                                                                     |
| 01746          | Invalid Device IP                                                                                                                                                                                                                                                                                                                                         |
| 01747          | Database Unavailable                                                                                                                                                                                                                                                                                                                                      |
| 01748          | Adjustment not allowed                                                                                                                                                                                                                                                                                                                                    |
| 01749          | Must specify a valid payment method                                                                                                                                                                                                                                                                                                                       |
| 01750          | An error has occured. Please contact support.                                                                                                                                                                                                                                                                                                             |
| 01751          | Try Again                                                                                                                                                                                                                                                                                                                                                 |
| 01752          | Batch Not Found                                                                                                                                                                                                                                                                                                                                           |
| 01753          | Authentication Data Unavailable                                                                                                                                                                                                                                                                                                                           |
| 01754          | Exceeds Daily Limit                                                                                                                                                                                                                                                                                                                                       |
| 01755          | Exceeds 7 Day Limit                                                                                                                                                                                                                                                                                                                                       |
| 01756          | Exceeds 30 Day Limit                                                                                                                                                                                                                                                                                                                                      |
| 01757          | FAILED PLZ CALL S80                                                                                                                                                                                                                                                                                                                                       |
| 01758          | Transaction already settled, issue refund (P)                                                                                                                                                                                                                                                                                                             |


# .NET SDK

## Overview <a href="#overview" id="overview"></a>

The .NET Payment Engine SDK provides an easy way for developers to integrate card-present and card-not-present payment processing into their .NET projects. Our SDK is designed with user-friendly payment functions and compatibility with a broad range of payment hardware, removing the need for complicated device integration. With this SDK, you can easily incorporate its advanced payment processing capabilities into your .NET projects, streamlining your payment processing experience.

### Getting Started <a href="#getting-started" id="getting-started"></a>

#### Download and reference SDK files <a href="#download-and-reference-sdk-files" id="download-and-reference-sdk-files"></a>

1. **Download & Run**
   * Download the [Updater app](https://cdn.cardknox.com/dl/updater.exe).
   * Right-click the file and Run as Administrator.
2. **Enter Software Name**
   * When prompted, type: paymentengine
3. **Select SDK Specifications**
   * Choose (Defaults are preselected):
     * Release Type (Stable/Beta/Alpha)
     * Program Version
     * OS Version
     * .NET Version
     * Download Location
   * Click Next.
4. **Download the SDK**
   * Click Start and wait for the files to download.
   * Click Next once the download is complete.
   * Click Finish.

Your SDK files are now downloaded to the specified location. Reference the following DLLs in your project: **PaymentEngine**, **xCore**, **xCore.Forms**, **NLog**, and **Newtonsoft.Json**.

(For SDK files with checksum [click here](https://solapayments.com/sdk))

### Initiate Transaction <a href="#initiate-transaction" id="initiate-transaction"></a>

This guide explains how to initiate credit card transactions using the Cardknox SDK. Transactions can be processed **in-scope** or **out-of-scope**, depending on whether the SDK needs to collect sensitive cardholder information.

#### 0. Create a Transaction Request Object <a href="#id-0.-create-a-transaction-request-object" id="id-0.-create-a-transaction-request-object"></a>

Instantiate a new `PaymentEngine.xTransaction.Request` object. This object will hold all transaction parameters and settings

#### 1. Prepare the Transaction Request <a href="#id-1.-prepare-the-transaction-request" id="id-1.-prepare-the-transaction-request"></a>

Before submitting a transaction, you must set the required and optional parameters. These include:

* Basic SDK parameters: `xKey`, `xVersion`, `xSoftwareName`, `xSoftwareVersion`.
* Transaction-specific parameters: `xCommand`, `xAmount`, `xInvoice`, etc.
* Device settings (if using a physical device): `EnableDeviceInsertSwipeTap`, `Device_Set` etc.

Parameter information is documented in the sections below.

#### 2. Initiate the Transaction <a href="#id-2.-initiate-the-transaction" id="id-2.-initiate-the-transaction"></a>

The Cardknox SDK provides two methods for processing transactions:

**Out-of-Scope Transactions (**`ProcessOutOfScope`**)**\
Use this method when the SDK must collect sensitive card data directly from the cardholder. The SDK securely captures the information via a pop-up window or a card-present device (e.g., Verifone terminal for swipes, taps, or chip insertions) and submits the transaction to the Cardknox gateway.

**In-Scope Transactions (**`Process`**)**\
Use this method when card data is already available in your system or for non-interactive transactions such as voids, refunds, or card-on-file payments. No user input or device interaction is required; the SDK submits the transaction directly to the Cardknox gateway.

#### 3. Handle the Response <a href="#id-3.-handle-the-response" id="id-3.-handle-the-response"></a>

After processing, the SDK returns the transaction response data to the calling method. This object contains all transaction details returned by the gateway, including status, approval code, and error messages.

For definitions see [response parameters](https://docs.solapayments.com/#response-parameters)

### Troubleshooting steps <a href="#troubleshooting-steps" id="troubleshooting-steps"></a>

* Ensure the Payment Engine DLLs are downloaded and referenced in the project. These include PaymentEngine, xCore, xCore.Forms, NLog, and Newtonsoft.Json.
* Ensure that the Payment Engine DLLs architecture (x86, x64, AnyCPU) matches your project build settings.
* Ensure that the Payment Engine DLLs .NET version matches your project framework version.

### Backup gateway host <a href="#backup-gateway-host" id="backup-gateway-host"></a>

You can set the transactions to use a backup host in case there is an issue with the gateway. See Transaction Specific>ActivateBackupGatewayURL. You can sign up for status updates at <https://status.solapayments.com/>

### Transaction Workflow <a href="#out-of-scope" id="out-of-scope"></a>

Click [here](/sdk/payment-engine-sdk/payment-engine-sdk) to view Transaction Workflows.

[Download Our Sample Application](https://kb.cardknox.com/wp-content/uploads/PlastiDip.zip)\
Our sample application supports some of the basic transaction workflows; more will be added in the future. The application is intended to show you how our SDK works.

### Transaction Functions <a href="#transaction-functions" id="transaction-functions"></a>

| Function          | Description                         | Sample Data          |
| ----------------- | ----------------------------------- | -------------------- |
| ProcessOutOfScope | Process an out-of-scope transaction | ProcessOutOfScope(); |
| Process           | Process an in-scope transaction     | Process();           |

### Basic Parameters <a href="#basic-parameters" id="basic-parameters"></a>

| Name             | Required | Description                     | Sample Data       |
| ---------------- | -------- | ------------------------------- | ----------------- |
| xKey             | Yes      | Sola account key                | SolaSupport\_Test |
| xVersion         | Yes      | Gateway version                 | 4.5.8             |
| xSoftwareName    | Yes      | Name of your software           | My app            |
| xSoftwareVersion | Yes      | Version number of your software | 1.0.0             |

### Transaction-Specific <a href="#transaction-specific" id="transaction-specific"></a>

| Name                               | Required                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Sample Data                                                                |
| ---------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| xCommand                           | Yes                                                              | Sola transaction type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | cc:Sale                                                                    |
| xAmount                            | Yes                                                              | Total amount of the transaction, including tax and tip, if applicable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | 3.0                                                                        |
| xTax                               | No                                                               | Tax amount of the transaction. The xTax amount is included in the xAmount.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                            |
| xAllowDuplicate                    | No                                                               | <p>By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard.</p><p>True/False allowed.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | True                                                                       |
| RequireAVS                         | No                                                               | <p>Requires the user to enter their street address and ZIP Code (only affects keyed transactions).</p><p>True/False allowed.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | True                                                                       |
| RequireCVV                         | No                                                               | <p>Requires the user to enter CVV (only affects keyed transactions).</p><p>True/False allowed.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | True                                                                       |
| ActivateBackupGatewayURL           | No                                                               | Set transactions to use the backup host for the next half hour.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | <p>ActivateBackupGatewayURL(“x2“)<br><br><em>Options are x2 or b1</em></p> |
| DeactivateBackupGatewayURL         | No                                                               | Set transactions to use the regular host going forward                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | DeactivateBackupGatewayURL()                                               |
| Settings.EnableOfflineTransactions | <p>No\*</p><p>Required for offline transactions (cc:encrypt)</p> | Enable offline transactions. Offline transactions are initiated with the cc:encrypt command                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | True                                                                       |
| EnableTipPrompt                    | No                                                               | Prompts the user on the device to add a tip to the transaction. This functionality is only available when the device is enabled. The response to the transaction will include two parameters: "xTip" (the tip amount) and "xAuthAmount" (the final authorized amount on the card, including the tip amount).                                                                                                                                                                                                                                                                                                                                                                                                                                              | True                                                                       |
| TipPromptOption                    | No                                                               | <p>To configure the tip percentage options shown to the user when the "EnableTipPrompt" feature is enabled, you can use the "TipPromptOption" setting. You can specify four options, separated by commas. You may include a “c” as one of the options, which allows the user to enter a custom tip amount when selecting that option and/or “0“ to have a “No Tip“ option as well. To enable fixed dollar amounts, include a "$" next to the number for the fixed dollar. <br><br>For example, if you want to show tip options of 5%, 10%, a fixed $1 tip option, and a custom amount, you can set the "Tip Prompt Option" as "5,10,$1, c". This will present these five options to the user when they are prompted to add a tip to the transaction. </p> | 5,10,$1, c                                                                 |

### Form Settings <a href="#form-settings" id="form-settings"></a>

| Name                  | Required | Description                                                                                                                                                                              | Sample Data        |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| ExitFormIfApproved    | No       | <p>Returns control to the calling application if the transaction is approved.</p><p>True/False allowed.</p>                                                                              | True               |
| ExitFormIfNotApproved | No       | <p>Returns control to the calling application if the transaction is not approved.</p><p>True/False allowed.</p>                                                                          | True               |
| ExitFormOnDeviceError | No       | <p>Returns control to the calling application after any device error.</p><p>True/False allowed.</p>                                                                                      | True               |
| Form\_Timeout         | No       | Sets the number of milliseconds that the request should time out after. This should typically be set to at least 2 minutes (120,000) so it does not interrupt a transaction in progress. | 120000             |
| Form\_BackColor       | No       | Set form background color                                                                                                                                                                | Drawing.Color.Agua |
| Form\_Height          | No       | Set form height                                                                                                                                                                          | 500                |
| Form\_Width           | No       | Set form width                                                                                                                                                                           | 500                |

### Device Settings <a href="#device-settings" id="device-settings"></a>

Device Name

Pax devices start with `Pax_` and end with `.3` (example: `Pax_s300.3`)\
`S300` `S920` `A60` `A80` `A920` `PX5` `PX7` `D210` `D220 A35`

\
Verifone devices start with `Verifone_` and end with `.4` (example: `Verifone_MX915.4`)\
`P400` `P200` `M400` `E285` `MX915` `MX925` `VX805` `MX850` `MX860` `MX870` `MX880`

VeriFone driver download: <https://cdn.cardknox.com/pe/drivers/verifone/VerifoneUnifiedDriverInstaller-5.0.5.2-B9.zip><br>

Ingenico ISC and IPP devices start with `Ingenico_` and end with `.6` (example: `Ingenico_iSC480.6`)\
`IPP320` `IPP350` `ISC250` `ISC350`

\
Ingenico ICT and Tetra devices start with `Ingenico_` and end with `.2` (example: `Ingenico_iCT250.2`)\
`ICT250` `Desk5000` `Move5000`

ID TECH devices start with `IDTech_` and end with `.12` (example: `IDTech_VP6300.12`)\
`VP6300` `VP6800`

**USB**\
These settings should match what is set for the device in device manager:

COM Port (default: `COM9`)\
Baud rate (default: `115200`)\
Parity (default: `N`)\
Data Bits (default: `8`)

**IP**\
These settings should match what the device is set to.

IP Port\
Port (default: pax`10009` verifone`9001` ingenico`9999`)

| Name                       | Required                                                                 | Description                                                                                                                                  | Sample Data                                                                                                                |
| -------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| EnableDeviceInsertSwipeTap | No                                                                       | <p>Enables the use of a credit card device for card-present transactions.</p><p>True/False allowed.</p>                                      | True                                                                                                                       |
| Device\_Set                | <p>No\*</p><p>Required if EnableDeviceInsertSwipeTap is set to True.</p> | Sets specific device parameters.                                                                                                             | <p>Device\_Set(“Verifone\_Mx915.4”, “COM11”, “115200”, “N”, “8”);<br>IP: “Verifone\_Mx915.4”, “10.166.110.101”, “9001”</p> |
| EnableDeviceKeyedEntry     | No                                                                       | Allows the user to key in their card number on the credit card device. EnableDeviceInsertSwipeTap cannot be set to True in the same request. | True                                                                                                                       |
| ShowMenu\_DeviceKeyedEntry | No                                                                       | Adds the DeviceKeyedEntry option on the form for the cashier to toggle.                                                                      | True                                                                                                                       |

### Cancel Command <a href="#pin-signature" id="pin-signature"></a>

| Name     | Description             | Sample Data                    |
| -------- | ----------------------- | ------------------------------ |
| Cancel() | Cancel ongoing function | Cancel("Transaction canceled") |

### PIN Signature <a href="#pin-signature" id="pin-signature"></a>

| Name                             | Description                                                                                                                                | Sample Data                                                                   |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| EnableDeviceSignature            | <p>Prompt for signature after the transaction is approved.<br></p><p>True/False allowed.</p>                                               | True                                                                          |
| EnableDeviceSignature\_MinAmount | <p>Prompt for signature only if xAmount is greater than the amount set here.<br></p><p>EnableDeviceSignature must be set.</p>              | 5                                                                             |
| GetSignature                     | Manually prompts for signature post transaction.                                                                                           | string MySignature = TransRequest.GetSignature();                             |
| GetSignatureAndSaveToFile        | Manually prompts for signature post transaction and saves it to a file. You can pass through a string to display a message when prompting. | string MySignature = TransRequest.GetSignatureAndSaveToFile(“Signature.png”); |

### Receipt <a href="#receipt" id="receipt"></a>

| Name                                 | Required | Description                                                                         | Sample Data |
| ------------------------------------ | -------- | ----------------------------------------------------------------------------------- | ----------- |
| Settings.Printer\_Name               | No       | Sends the transaction receipt to the printer.                                       | Adobe PDF   |
| Settings.Receipt\_Merchant\_Disabled | No       | <p>To disable the merchant receipt, set this to True.</p><p>True/False allowed.</p> | True        |
| Settings.Receipt\_Customer\_Disabled | No       | <p>To disable the customer receipt, set this to True.</p><p>True/False allowed.</p> | True        |

### Stored Account <a href="#stored-account" id="stored-account"></a>

| Name                       | Required                                                          | Description                                                                                                                                               | Sample Data                                                 |
| -------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| EnableStoredAccount        | No                                                                | <p>Enables the stored account option.<br></p><p>Card number and expiration date are required, and a token can also be used.</p><p>True/False allowed.</p> | True                                                        |
| StoredAccount\_Message     | <p>No\*</p><p>Required if EnableStoredAccount is set to True.</p> | Displays the message to show on the form for the user to select the stored account.                                                                       | StoredAccount\_Message = “Alt + \&W – Use Stored Card {1}”; |
| StoredAccount\_CustomerPin | No                                                                | <p>Asks the user for their account PIN.</p><p>The PIN will be whatever value is set here.</p>                                                             | StoredAccount\_CustomerPin = “2222”                         |

### Show Items <a href="#show-items" id="show-items"></a>

This is currently only supported for the Mx915 and Mx925. You can add xAmount and xTax to the request before “Device\_ShowItems“ so the user can see the total amount and tax of their order. This runs on a separate thread within the application.

| Name              | Description                                                     | Sample Data                                                                                                             |
| ----------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| UpdateItems       | Specify the items to show during the transaction (JSON or XML). | TransRequest.UpdateItems(“json”, “\[{‘xdescription’:’ItemABC’,’xupc’:558,’xqty’:3,’xunit’:’EA’,’xunitprice’:’5.99′}]”); |
| Device\_ShowItems | Show the items that were specified in “UpdateItems”.            | TransRequest.Device\_ShowItems();                                                                                       |

### Update Device <a href="#update-device" id="update-device"></a>

This is currently only supported on certain VeriFone devices.

| Name                            | Required | Description                                             | Sample Data                                                                    |
| ------------------------------- | -------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ |
| Device\_OsUpdateAvailable       | No       | Checks if there is an available device OS update.       | bool OsUpdateAvailable = TransRequest.Device\_OsUpdateAvailable();             |
| Device\_UpdateOS                | No       | Update the device OS.                                   | Device\_UpdateOS();                                                            |
| Device\_FirmwareUpdateAvailable | No       | Checks if there is an available device Firmware update. | bool FirmwareUpdateAvailable = TransRequest.Device\_FirmwareUpdateAvailable(); |
| Device\_UpdateFirmware          | No       | Update the device Firmware.                             | Device\_UpdateFirmware();                                                      |

### Additional Features <a href="#additional-features" id="additional-features"></a>

| Name                           | Required | Description                                                                                                                          | Sample Data |
| ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| EnableMultipleKeys             | No       | <p>Enable multiple keys on a computer so that Initialization will not be required when switching keys.</p><p>True/False allowed.</p> | True        |
| EnableCashback                 | No       | <p>Prompts the user if they want cash back.</p><p>True/False allowed.</p>                                                            | True        |
| ShowKeyPad                     | No       | <p>If the merchant’s system is touch enabled, set to True to display an on-screen keypad.</p><p>True/False allowed.</p>              | True        |
| EnableKeyedEntry               | No       | <p>To disable keyed entry, set to False.</p><p>True/False allowed.</p>                                                               | True        |
| ExitFormOnDeviceError          | No       | <p>To return control to the calling application after any device error, set to True.</p><p>True/False allowed.</p>                   | True        |
| EnableSilentMode               | No       | <p>To enable silent mode and prevent the payment screen from showing, set to True.</p><p>True/False allowed.</p>                     | True        |
| EnableAmountConfirmationPrompt | No       | <p>Prompts the user to confirm the transaction amount.</p><p>True/False allowed.</p>                                                 | True        |

### Show Forms <a href="#show-forms" id="show-forms"></a>

This is currently only supported on certain Verifone devices.

| Name                         | Description                                                                                             | Sample Data                                                     |
| ---------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| Device\_ShowMessage          | Show form with message of up to 4 lines. An exception will be thrown if the device does not support it. | Device\_ShowMessage(“Hello” ,”Welcome”,”Sola”,”Thank you!”);    |
| Device\_TryShowMessage       | Show form with message of up to 4 lines. This returns a boolean indicating if it was successful or not. | Device\_TryShowMessage(“Hello” ,”Welcome”,”Sola”,”Thank you!”); |
| Device\_ShowWelcomeScreen    | Show the welcome screen on the device. An exception will be thrown if the device does not support it.   | Device\_ShowWelcomeScreen();                                    |
| Device\_TryShowWelcomeScreen | Show the welcome screen on the device. This returns a boolean indicating if it was successful or not.   | Device\_TryShowWelcomeScreen();                                 |
| Device\_PromptForEmail       | Prompt the user for their email address.                                                                | Device\_PromptForEmail();                                       |
| Device\_PromptForPhone\_JSON | Prompt the user for their phone number.                                                                 | Device\_PromptForPhone\_JSON();                                 |
| Device\_PromptForZip         | Prompt the user for their ZIP code.                                                                     | Device\_PromptForZip();                                         |


# Transaction Workflow

## Language C#  <a href="#language-c" id="language-c"></a>

### Transaction Types <a href="#transaction-types" id="transaction-types"></a>

#### cc:sale <a href="#cc-sale" id="cc-sale"></a>

To submit a **cc:sale** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:sale";
MyRequest.xAmount = 1.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### cc:sale (in scope) <a href="#cc-sale-in-scope" id="cc-sale-in-scope"></a>

To submit a **cc:sale** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request()
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:sale";
MyRequest.xAmount = 1.23m;
MyRequest.xCardNum = "4444333322221111";
MyRequest.xExp = "1022";
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.Process();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### cc:void <a href="#cc-void" id="cc-void"></a>

To submit a **cc:void** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters and transaction-specific parameters.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:void";
MyRequest.xRefNum = "123456789";
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.Process();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### cc:refund

To submit a **cc:refund** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters and transaction-specific parameters.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:refund";
MyRequest.xRefNum = "123456789";
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.Process();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### cc:credit

To submit a **cc:credit** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction specific-parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:credit";
MyRequest.xAmount = 1.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse =
MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### cc:authonly <a href="#cc-authonly" id="cc-authonly"></a>

To submit a **cc:authonly** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:authonly";
MyRequest.xAmount = 1.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### cc:capture <a href="#cc-capture" id="cc-capture"></a>

To submit a **cc:capture** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters and transaction-specific parameters.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:capture";
MyRequest.xRefNum = "123456789"
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.Process();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### GetSignature <a href="#getsignature" id="getsignature"></a>

To submit a **GetSignature** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
string MySignature = MyRequest.GetSignature();
```

MySignature will contain the transaction signature.

#### Device\_ShowWelcomeScreen <a href="#device_showwelcomescreen" id="device_showwelcomescreen"></a>

To submit a **Device\_ShowWelcomeScreen** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
TransRequest.Device_ShowWelcomeScreen();
```

MySignature will contain the transaction signature.

#### ebtfs:sale <a href="#ebtfs-sale" id="ebtfs-sale"></a>

To submit a **ebtfs:sale** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "ebtfs:sale";
MyRequest.xAmount = 1.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### ebtfs:credit <a href="#ebtfs-credit" id="ebtfs-credit"></a>

To submit a **ebtfs:credit** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "ebtfs:credit";
MyRequest.xAmount = 1.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### ebtfs:balance <a href="#ebtfs-balance" id="ebtfs-balance"></a>

To submit a **ebtfs:balance** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:balance";
MyRequest.xAmount = 1.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult "A" will indicate that the transaction was approved, "E" or "D" will indicate that it was not approved, and xError will contain the reason.

#### Device\_ShowItems <a href="#device_showitems" id="device_showitems"></a>

To submit a **Device\_ShowItems** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
TransRequest.xTax = 1.26m;
TransRequest.xAmount = 19.23m;
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
TransRequest.UpdateItems("json", "[{'xdescription':'ItemABC','xupc':558,'xqty':3,'xunit':'EA','xunitprice':'5.99'}]");
TransRequest.Device_ShowItems();
```

The items will be shown to the user on the pin pad.

#### cc:encrypt <a href="#cc-encrypt" id="cc-encrypt"></a>

To submit a **cc:encrypt** transaction type, first initiate the request.

```csharp
PaymentEngine.xTransaction.Request MyRequest = new PaymentEngine.xTransaction.Request();
```

Next, specify the basic parameters, transaction-specific parameters, and device settings.

```csharp
MyRequest.xKey = "Your_Test_Key";
MyRequest.xVersion = "4.5.8";
MyRequest.xSoftwareName = "My Software";
MyRequest.xSoftwareVersion = "My Software Version 1.0";
MyRequest.xCommand = "cc:encrypt";
MyRequest.EnableDeviceInsertSwipeTap = True
MyRequest.Settings.Device_Set("Verifone_Mx915.4", "COM9", "115200", "N", "8");
```

Once this is done, initiate the transaction.

```csharp
PaymentEngine.xTransaction.Response MyResponse = MyRequest.ProcessOutOfScope();
```

MyResponse will contain the transaction response information, xResult ”S” will indicate that the request was processed successfully, and xEncryptedPayload will contain the encrypted card number. Once the system is back online submit a **cc:sale (in scope)** transaction or via API using the encrypted card number as xMagstripe there is no need to submit an expiration date since it is included with the encrypted card number.

<br>


# iOS SDK

## Overview

Sola iOS SDK is a mobile SDK targeted towards Swift mobile application developers; it allows developers to process transactions with the Sola [Transactions API](/api/transaction).

{% hint style="info" %}
*Due to the necessity of the API key in this integration method, we strongly recommend reserving these features for integrations to be used solely on merchant-owned devices.*
{% endhint %}

## Getting started

To start, download the SDK framework file:

* [Swift download](https://cdn.cardknox.com/sdk-ios/versions.html)

Integrate the framework file into your XCode project by referring to the [technical documentation](https://docs.cardknox.com/sdk/ios-sdk).

## Choose your integration path

The SDK offers developers a couple of ways to process transactions:

* In scope function
* Out of scope function
* Custom UI set of functions
* Payment Engine set of functions

### Out of scope

Use the out of scope function when the user needs to provide their credit card information. This function displays the SDK user interface, effectively giving the control over to the SDK to acquire the sensitive credit card data from the user. The user provides the sensitive information either via a form or via a credit card device, and then the SDK processes the transaction with the gateway.

### In scope

Use the in scope function when there is no need for the SDK to interact with the user through a user interface. The developer should either pass in a card number + an expiration date, or provide a tokenized card data via the xToken parameter to this function to quickly process the transaction and retrieve back the results.

### Custom UI

Custom-UI integration consists of a set of functions to control the card reader device via the SDK. Currently supported card reader device is a Bluetooth VP3300 card reader. This integration path is useful when the developer has an existing UI and wishes to use a card reader device to obtain users' card sensitive information and then process the transaction with the gateway. The SDK offers a set of functions to control the card reader device. The SDK takes care of processing with the gateway and notifying the Developer’s application with the processing results.

The SDK offers the following functions: “start scanning for devices”, “stop scanning for devices”, “connect to device”, “disconnect from device”, “start transaction”, “stop transaction”.

#### Payment Engine <a href="#payment-engine" id="payment-engine"></a>

The Payment Engine feature inside the SDK enables you to create transactions with a card reader over IP. The Payment Engine supports different card readers from Pax, Verifone, and Ingenico brands. See a full list of supported devices in the table below. The feature doesn't contain any UI. The developer provides device and transaction parameters to Payment Engine functions. The SDK takes care of communicating with the card reader and processing with the gateway. Finally, the SDK returns the device and transaction status and states.

| **Brand**                                  | **Model**            | **Suffix**                                | **Parameter value** |
| ------------------------------------------ | -------------------- | ----------------------------------------- | ------------------- |
| <p> </p><p> </p><p> </p><p> </p><p>Pax</p> | SP30                 | <p> </p><p> </p><p> </p><p> </p><p>.3</p> | Pax\_SP30.3         |
| S300                                       | Pax\_S300.3          |                                           |                     |
| S920                                       | Pax\_S920.3          |                                           |                     |
| A35                                        | Pax\_A35.3           |                                           |                     |
| A60                                        | Pax\_A60.3           |                                           |                     |
| A77                                        | Pax\_A773            |                                           |                     |
| A80                                        | Pax\_A80.3           |                                           |                     |
| A920                                       | Pax\_A920.3          |                                           |                     |
| PX5                                        | Pax\_PX5.3           |                                           |                     |
| PX7                                        | Pax\_PX7.3           |                                           |                     |
| D210                                       | Pax\_D210.3          |                                           |                     |
| D220                                       | Pax\_D22.3           |                                           |                     |
| Aries6                                     | Pax\_Aries6.3        |                                           |                     |
| Aries8                                     | Pax\_Aries8.3        |                                           |                     |
| <p> </p><p> </p><p> </p><p>Verifone</p>    | MX915                | <p> </p><p> </p><p> </p><p>.4</p>         | Verifone\_MX915.4   |
| MX925                                      | Verifone\_MX925.4    |                                           |                     |
| P200                                       | Verifone\_P200.4     |                                           |                     |
| P400                                       | Verifone\_P400.4     |                                           |                     |
| M400                                       | Verifone\_M400.4     |                                           |                     |
| E285                                       | Verifone\_E2854      |                                           |                     |
| <p> </p><p>Ingenico</p>                    | ICT250               | <p> </p><p>.2</p>                         | Ingenico\_ICT250.2  |
| Desk500                                    | Ingenico\_Desk5000.2 |                                           |                     |
| Move500                                    | Ingenico\_Move5000.2 |                                           |                     |

## Transaction workflows

Click here to view the transaction workflows online.

Download our sample application:

* [Swift with SwiftUI app](https://cdn.cardknox.com/sdk-ios/versions.html)

### Basic parameters

| **Name**      | **Required** | **Description**       | **Sample data**   |
| ------------- | ------------ | --------------------- | ----------------- |
| xKey          | Yes          | Sola account key      | SolaSupport\_Test |
| xVersion      | Yes          | Gateway version       | 4.5.9             |
| xSoftwareName | Yes          | Name of your software | My app            |

### Basic parameter functions

Prior to any processing, the Sola SDK needs to be configured with user’s metadata and the account key. These functions can be called anywhere in the application any number of times to change the metadata and/or current account key.

| **Function**     | **Description**                                                                                                                                                                                       |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| setxSoftwareName | Specifies the name of your software (xSoftwareName), version number of your software (xSoftwareVersion) and the gateway version (xVersion)                                                            |
|                  | **Sample data (Swift)**                                                                                                                                                                               |
|                  | <p>CardknoxSDK.setxSoftwareName("Your app name",<br>xSoftwareVersion: "Your app version, such as 1.0.0",<br>xVersion: "4.5.9");</p>                                                                   |
|                  | **Sample data (Objective C)**                                                                                                                                                                         |
|                  | <p>\[CardknoxSDK setxSoftwareName:@"Your app name"<br>xSoftwareVersion:@"Your app version, such as 1.0.0"<br>xVersion:@"4.5.9"];</p>                                                                  |
| setPrincipalKey  | <p>Accepts the xKey.</p><p>xKey is a Sola account key.</p><p>All transactions being processed after calling this function will be associated to the account that was passed in into the function.</p> |
|                  | **Sample data (Swift)**                                                                                                                                                                               |
|                  | CardknoxSDK.setPrincipalKey("Your xKey value")                                                                                                                                                        |
|                  | **Sample data (Objective C)**                                                                                                                                                                         |
|                  | \[CardknoxSDK setPrincipalKey:@"Your xKey value"];                                                                                                                                                    |

### Transaction required parameters

Each integration path has a “process” function that accepts a “transaction parameters” object. Developers specify required values for transaction processing through that object. Same object can be used to specify optional parameters to associate with a transaction; such as invoice numbers, billing address, etc.

| **Name** | **Description**       | **Sample data** |
| -------- | --------------------- | --------------- |
| xCommand | Sola transaction type | cc:sale         |

### Transaction optional parameters

Optional transaction parameters further complement the transaction processing. All the parameters are being sent to the Gateway during processing.

| **Name**                 | **Description**                                                                                                                                                                                                                                                                                                                                               | **Sample data**                                                                                                            |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| VP3300TransactionTimeout | <p>Start transaction timeout, in seconds.<br></p><p>Once the transaction with the VP3300 reader is started; the SDK times out if the card is not provided in the time frame specified by this timeout value.<br></p><p>This parameter is only applicable for SDK integrations that use a VP3300 card reader; such as CustomUI or OutOfScope integrations.</p> | Refer to the Custom UI flow or Out Of Scope flow for samples.                                                              |
| xCardNum                 | Card number                                                                                                                                                                                                                                                                                                                                                   | 4444333322221111                                                                                                           |
| xExpDate                 | <p>Card expiration date.</p><p>Expected format is MMYY where MM is a month, and YY are last 2 year digits</p>                                                                                                                                                                                                                                                 | <p>“1126” for (November 2026)</p><p>“0122” for “January 2022”</p>                                                          |
| xToken                   | <p>From <a href="/pages/g1gMqjuhO4qESS2Yro3k">Transaction API:</a></p><p>The Sola token that references a previously used payment method. When using a token, <code>xCardNum</code> <code>xExp</code> and <code>xMagstripe</code> should not be used.</p>                                                                                                     | 61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84                                                                         |
| xRefNum                  | Used to reference a previous transaction when doing a follow-up transaction, typically a refund, void, or capture.                                                                                                                                                                                                                                            | 12345678                                                                                                                   |
| xInvoice                 | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling.                                                                                                                                                                                                                                    | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling. |
| xPoNum                   | The merchant’s purchase order number for the transaction.                                                                                                                                                                                                                                                                                                     | 123485                                                                                                                     |
| xDescription             | This is a description                                                                                                                                                                                                                                                                                                                                         | This is a description                                                                                                      |
| xName                    | The cardholder’s name.                                                                                                                                                                                                                                                                                                                                        | John Doe                                                                                                                   |
| xBillFirstName           | The customer’s first name for their billing profile.                                                                                                                                                                                                                                                                                                          | John                                                                                                                       |
| xBillLastName            | The customer’s last/family name for their billing profile.                                                                                                                                                                                                                                                                                                    | Doe                                                                                                                        |
| xBillCompany             | The customer’s company name for their billing profile.                                                                                                                                                                                                                                                                                                        | Acme                                                                                                                       |
| xBillStreet              | The customer’s street address for their billing profile.                                                                                                                                                                                                                                                                                                      | 123 Any Street                                                                                                             |
| xBillStreet2             | The customer’s second street address for their billing profile.                                                                                                                                                                                                                                                                                               | 123 Any Street                                                                                                             |
| xBillCity                | The customer’s city for their billing profile.                                                                                                                                                                                                                                                                                                                | Anytown                                                                                                                    |
| xBillState               | The customer’s state for their billing profile.                                                                                                                                                                                                                                                                                                               | NY                                                                                                                         |
| xBillZip                 | The customer’s zip code for their billing profile.                                                                                                                                                                                                                                                                                                            | 12345                                                                                                                      |
| xBillCountry             | The customer’s phone number for their billing profile.                                                                                                                                                                                                                                                                                                        | USA                                                                                                                        |
| xBillPhone               | The customer’s phone number for their billing profile.                                                                                                                                                                                                                                                                                                        | 8005551212                                                                                                                 |
| xShipFirstName           | The customer’s last/family name for their shipping profile.                                                                                                                                                                                                                                                                                                   | John                                                                                                                       |
| xShipLastName            | The customer’s last/family name for their shipping profile.                                                                                                                                                                                                                                                                                                   | Doe                                                                                                                        |
| xShipCompany             | The customer’s company name for their shipping profile.                                                                                                                                                                                                                                                                                                       | Acme                                                                                                                       |
| xShipStreet              | The customer’s street address for their shipping profile.                                                                                                                                                                                                                                                                                                     | 123 Any Street                                                                                                             |
| xShipStreet2             | The customer’s second street address for their shipping profile.                                                                                                                                                                                                                                                                                              | 123 Any Street                                                                                                             |
| xShipCity                | The customer’s city for their shipping profile.                                                                                                                                                                                                                                                                                                               | Anytown                                                                                                                    |
| xShipState               | The customer’s state for their shipping profile.                                                                                                                                                                                                                                                                                                              | NY                                                                                                                         |
| xShipZip                 | The customer’s zip code for their shipping profile.                                                                                                                                                                                                                                                                                                           | 12345                                                                                                                      |
| xShipCountry             | The customer’s country for their shipping profile.                                                                                                                                                                                                                                                                                                            | USA                                                                                                                        |
| xShipPhone               | The customer’s phone number for their shipping profile.                                                                                                                                                                                                                                                                                                       | 1113333444                                                                                                                 |
| xCustom01                | Custom field 1. Use this for any additional data                                                                                                                                                                                                                                                                                                              |                                                                                                                            |
| xCustom02                | Custom field 2. Use this for any additional data                                                                                                                                                                                                                                                                                                              |                                                                                                                            |
| xCustom03                | Custom field 3. Use this for any additional data                                                                                                                                                                                                                                                                                                              |                                                                                                                            |
| xAuthCode                | xAuthCode is a verification number provided by the issuing bank to be used with the cc:postauth command.                                                                                                                                                                                                                                                      |                                                                                                                            |
| xAllowDuplicate          | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                                                                                                                                     | False                                                                                                                      |
| xCustReceipt             | True/False value indicating if the email address specified in xEmail should receive a receipt containing the transaction details.                                                                                                                                                                                                                             | False                                                                                                                      |
| xEmail                   | The customer’s email address.                                                                                                                                                                                                                                                                                                                                 | <test@example.com>                                                                                                         |

### Retrieving results with callbacks

The SDK can notify the application about various events during processing, such as about different card reader events during out of scope processing, or perhaps about a completed bluetooth device scan during custom UI processing.

Developers opt in to receive callbacks by subscribing to the NSNotificationCenter using one of its' methods, using a predefined value from the SDK for the “name” parameter.

The SDK uses the same “name” value to report results & various information back to subscribers.

Available callback types and integrations where they are applicable in are as follows:

| **Callback type**        | **Description**                                                                                                                                                                                                                                                                                                                                            | **Available in integration**        |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| Transaction result       | The SDK processes a payment with the Gateway and delivers an object containing all processed transaction details.                                                                                                                                                                                                                                          | <p>Out of scope</p><p>Custom UI</p> |
| Card reader event        | The SDK keeps informing the subscribers about various events taking place between the application and the card reader device; such as “connected”, “disconnected”, “transaction started”, “on bluetooth disabled error”, etc.                                                                                                                              | <p>Out of scope</p><p>Custom UI</p> |
| Scanned bluetooth device | <p>Trigger a bluetooth device scanning process with the “start scanning” function.</p><p>During the scanning process, the SDK keeps informing subscribers with objects that encapsulate all the information about each newly discovered Bluetooth device.</p><p>The SDK expects one of the objects as an argument in the “connect to device” function.</p> | Custom UI                           |
| Scan completed           | <p>Trigger a bluetooth device scanning process with the “start scanning” function.</p><p>Stop the process with a “stop scanning” function.</p><p>Once the scanning process is stopped, the SDK reports back a list of all scanned bluetooth devices.</p><p>The SDK expects one of the objects as an argument in the “connect to device” function.</p>      | Custom UI                           |
| Device status            | <p>The SDK is sending information to subscribers about the device initialization process and the actions that the device expects from the user of the card scanner.<br><br>For example, waiting for the insert or swipe of a credit card.</p>                                                                                                              | Payment Engine                      |
| Transaction status       | The transaction status sends information about the card scanning process.                                                                                                                                                                                                                                                                                  | Payment Engine                      |

### Callback subscriptions & result handling

Based on your integration path choice, choose an available callback type for that integration path and subscribe with the NSNotificationCenter to receive appropriate information back from the SDK.

#### Transaction result callback subscription

This callback delivers a “transaction processed response” object to the subscriber.

For Swift applications using Swift UI, subscription can be made in a View as follows:

```swift
import SwiftUI

struct ProcessOutOfScopeView: View 
{
  // Define a Publisher
  let transactionPublisher =
  NotificationCenter.default.publisher(for: NSNotification.Name(CardknoxSDK.transactionResultSubscription_NSNotificationCenterName()))

  var body: some View
  {
    VStack{}
    // Subscribe the Publisher with the NotificationCenter
    .onReceive(transactionPublisher, perform: transactionNotification)
  }
  
  // Define a function that accepts a Notification.
  // This method will be invoked when the SDK sends transaction processing results
  func transactionNotification(notif: Notification) {
  
    // Use the SDK's "response" object utility method to transform a Notification into a "response" object
    let response = PaymentTransactionResponse.unwrap(notif) as! PaymentTransactionResponse
  
    if response.isSuccess()
    {
        // Transaction successfully processed
        let errorMessage = response.errorMessage()!
        let refNum = response.xRefNum()!
        // ... other properties ...
    } else {
        // Transaction processing resulted in an error message which can be extracted from this property:
        let errorMessage = response.errorMessage()!
        let errorCode = response.xErrorCode()!
        let error = response.xError()!
    }
  }
}
```

#### Card reader event callback subscription

This callback delivers information about various events happening between the application & the card reader.

For example, while out-of-scope processing the SDK can report back error events related to bluetooth device pairing, such as “bluetooth not turned on” to indicate that the mobile device wanted to use the bluetooth service to find a near card reader device but the service is unavailable, or an error such as “waiting for device bluetooth response” to indicate that the mobile device found an eligible bluetooth card reader device, and is expecting the card reader to respond back with bluetooth data. This could mean that the bluetooth button on the card reader needs to be pressed.

After an established bluetooth pair, the SDK reports back events related to obtaining the card data via the card reader. For example, a “connected” event means that the mobile device & the card reader are connected and a card data transaction can start. A “transaction started” event means that the SDK initiated a card data transaction with the card reader and the physical card can be tapped onto the card reader.

For Swift applications using Swift UI, subscription can be made in a View as follows:

{% code lineNumbers="true" %}

```swift
import SwiftUI

struct ProcessOutOfScopeView: View 
{
  // Define a Publisher
  let cardReaderEventPublisher =
  NotificationCenter.default.publisher(for: NSNotification.Name(CardknoxSDK.cardreaderEventSubscription_NSNotificationCenterName()))
  
  var body: some View
  {
    VStack{}
    // Subscribe the Publisher with the NotificationCenter
    .onReceive(cardReaderEventPublisher, perform: cardReaderEventNotification)
  }
  
  // Define a function that accepts a Notification.
  // This method will be invoked when the SDK sends card reader events
  func cardReaderEventNotification(aNotification: Notification){
    // Use the SDK's "response" object utility method to transform a Notification into a "response" object
    let callback = CardknoxCardReaderCallback.unwrap(aNotification) as! CardknoxCardReaderCallback
    
    // Read the event code
    let code : Int32 = callback.code();
    // Read the event name
    let name: String = callback.name()!;
    
    NSLog(String(format: "Card reader - %@", name));
    
    // Match the non-error code
    if(code == CardknoxCardReaderCallbackType.connected())
    {
        NSLog("Connected!");
    }
    
    // Match the error code & get the message
    if(code == CardknoxCardReaderCallbackType.error())
    {
        let errorMessage : String = callback.message()!;
        NSLog(String(format: "Card reader - %@", errorMessage));
    }
  }
}
```

{% endcode %}

#### Card reader events <a href="#card-reader-events" id="card-reader-events"></a>

When a card reader event happens, the SDK delivers an object, of a type named similarly to “CardknoxCardReaderCallback”, back into the app.

The object encapsulates two things:

* an event integer code
* an event name; such as “connected”, “disconnected”, etc.

Event integer codes are enumerated in a type named similarly to "CardknoxCardReaderCallbackType".

Developer can match the received integer code value with the enumeration of interest to pinpoint a wanted event.

| **Event name**                        | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| connecting                            | <p>The Sola SDK calls into the card reader SDK to connect with the reader, in scenarios such as:</p><ul><li>“connect to device” method in the “custom ui” integration</li><li>when it presents its own UI in “process out of scope” integration</li></ul><p>The card reader SDK starts searching for nearby IDTech card readers & notifies the Sola SDK with a “connecting” event.</p><p>The Sola SDK raises a “connecting” callback which notifies the app.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| waitingForDeviceResponse              | <p>This event is raised whenever the Sola SDK scans for nearby card readers. Awake readers are usually auto connected straight away.</p><p>Asleep or not, this event is always raised from the SDK to indicate that some action is required on the device.</p><p>This event is raised in the “custom ui” integration when:</p><ul><li>a Developer calls the “start scanning” method and the underlying bluetooth adapter starts scanning</li><li>or when a Developer calls the “connect to device” method. Sola SDK will call the card reader SDk to “connect” and raise this event</li></ul><p>This event is raised in the “process out of scope” integration when:</p><ul><li>the Sola SDK presents its user interface; automatically starting a bluetooth scan for a nearby card reader, expecting a response back</li></ul>                                                                                                                          |
| connected                             | <p>Raised when the app & the card reader establish a bluetooth connection.</p><p>Bluetooth connection is established when the Sola SDK scans for card readers, and card readers respond back with some bluetooth payload.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| disconnected                          | <p>Card reader SDK sends this event to the Sola SDK whenever a bluetooth card reader goes to sleep.</p><p>This event is never raised explicitly by the Sola SDK.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| transactionStarting                   | <p>Informational event.</p><p>Sola SDK raises this event before it places a call to the underlying card reader SDK in order to start a transaction with the card reader.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| transactionStarted                    | <p>Sola SDK attempts a “start transaction” call with the card reader SDK.</p><p>Card reader SDK successfully starts the transaction and notifies the Sola SDK with this event.</p><p>Sola SDK calls back with this event to the app.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| transaction start error timeout       | <p>Sola SDK attempts a “start transaction” call with the card reader SDK.</p><p>The card reader never receives a card in a specified timeout frame window (about 10 seconds) and the transaction times out.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| transaction start device disconnected | Sola SDK wants to start the transaction with a disconnected device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| transactionCancelled                  | <p>Generally, this is raised whenever an error occurs at any point between starting a transaction with the reader and obtaining the card data.</p><p>See the “error” event for error examples.</p><p>The Sola SDK in cases of these errors preventively calls the “cancel any pending transactions” internally to clean up.</p><p>Specifically, this event is raised in the “custom ui” integration when:</p><ul><li>a “cancel transaction” method is called & the card reader SDK cancels all pending transactions between the app & the card reader</li></ul><p>Furthermore, this event is raised in the “process out of scope” integration when:</p><ul><li>the Sola SDK’s user interface is closed; either via a pull down gesture or via a “close” UI element; to clean things up</li><li>the charge amount gets modified via UI and becomes invalid, effectively invalidating any pending transactions between the app & the card reader</li></ul> |
| scanStop                              | <p>Indicates that the Sola SDK stopped its own bluetooth scanning.</p><p>Raised in the “custom ui” integration when:</p><ul><li>a Developer explicitly calls the “stop scanning” method</li><li>when the “start scanning” method was called with a timeout value and the timeout expired or was cancelled / interrupted</li><li>in the “disconnect from current device” call if the “connect to device” method was called beforehand but there is no connected device to disconnect from</li></ul><p>Raised in the “process out of scope” integration when:</p><ul><li>the SDK shows its' UI and automatically starts scanning for nearby readers. User can explicitly stop the scanning process</li></ul>                                                                                                                                                                                                                                               |
| scanStart                             | <p>Indicates that the Sola SDK started a bluetooth scanning process.</p><p>Raised in the “custom ui” integration when:</p><ul><li>the “start scanning” method was called, with or without a timeout value</li></ul><p>Raised in the “process out of scope” integration when:</p><ul><li>the SDK shows its' UI and automatically starts scanning for nearby readers</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| error                                 | <p>This is raised whenever an error occurs at any point between starting a transaction with the reader and obtaining the card data.</p><p>Things that might go wrong (not a complete list) are:</p><ul><li>transaction with the card reader failed to start</li><li>EMV card readings are corrupted</li><li>transaction started but the card was not tapped / swiped / inserted in time</li></ul><p>An descriptive error message is always accompanying this event.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

#### Scanned bluetooth device callback subscription

One of the Custom UI integration functions is a “start scanning” function. The function keeps scanning for nearby bluetooth devices until it is manually stopped with the “stop scanning” function or if it times out.

During the scanning process, for every scanned device the SDK sends a “scanned device” object that contains all the necessary metadata about the scanned device, such as the devices' display name or its internal name.

For Swift applications using Swift UI, subscription can be made in a View as follows:

{% code lineNumbers="true" %}

```swift
import SwiftUI

struct CustomUIView: View 
{
  // Track a scanned device
  @State private var scannedDevice : CardknoxSDKCustomUIScannedDevice!;
  
  // Define a Publisher
  let customUIscannedDeviceSubscription =
  NotificationCenter.default.publisher(for: NSNotification.Name(CardknoxSDKCustomUI.customUI_scannedDevice_Subscription_NSNotificationCenterName()))
  
  var body: some View
  {
    VStack{}
    // Subscribe the Publisher with the NotificationCenter
    .onReceive(customUIscannedDeviceSubscription, perform: customUIscannedDeviceSubscription)
}
  
  // Define a function that accepts a Notification.
  // This method will be invoked when the SDK sends scanned device information
  func customUIscannedDeviceSubscription(aNotification: Notification){
      // Use the SDK's "response" object utility method to transform a Notification into a "response" object
      scannedDevice = CardknoxSDKCustomUIScannedDevice.from(aNotification) as! CardknoxSDKCustomUIScannedDevice;
      let name = scannedDevice.name();
      let displayName = scannedDevice.displayName();
      let uuid = scannedDevice.uuid();
  }
}
```

{% endcode %}

#### Scan completed callback subscription

One of the Custom UI integration functions is a “start scanning” function. The function keeps scanning for nearby bluetooth devices until it is manually stopped with the “stop scanning” function or if it times out.

Once the scanning process ends, the SDK sends a list of scanned device objects to all subscribers. Any object in the retrieved list can be used as an argument to the “connect to device” method.

For Swift applications using Swift UI, subscription can be made in a View as follows:

{% code lineNumbers="true" %}

```swift
import SwiftUI

struct CustomUIView: View 
{
  // Track a scanned device
  @State private var scannedDevice : CardknoxSDKCustomUIScannedDevice!;
  
  // Define a Publisher
  let customUIscanCompletedSubscription =
  NotificationCenter.default.publisher(for: NSNotification.Name(CardknoxSDKCustomUI.customUI_scanCompleted_Subscription_NSNotificationCenterName()))
  
  var body: some View
  {
    VStack{}
    // Subscribe the Publisher with the NotificationCenter
    .onReceive(customUIscanCompletedSubscription, perform: customUIscanCompletedNotification(aNotification:))
  }
  
  // Define a function that accepts a Notification.
  // This method will be invoked when the SDK stops the scanning process and sends back all scanned devices
  func customUIscanCompletedNotification(aNotification: Notification){
      let scanCompleted = CardknoxSDKCustomUIScanCompleted.from(aNotification) as! CardknoxSDKCustomUIScanCompleted;
      let devices : Array<Any> = scanCompleted.scannedDevices();
      
      // Example to get a first scanned VP3300 device.
      // All VP3300 devices have their internal name start with IDTECH prefix
      if(devices != nil && devices.count > 0)
      {
          for dev in devices{
              let typedDevice = dev as! CardknoxSDKCustomUIScannedDevice
              let name = typedDevice.name()!;
              
              if name.hasPrefix("IDTECH")
              {
                  // Save the reference & use it with the "connect to device" method
                  scannedDevice = typedDevice;
                  break;
              }
          }
      }
  }
}
```

{% endcode %}

#### Device status callback subscription <a href="#device-status-callback-subscription" id="device-status-callback-subscription"></a>

This callback provides information about the status of the card reader. It sends information about the initialization process of the device, the connection process of the card reader, and the mobile device. It also sends notifications about the actions expected by the user of the credit card.

For Swift applications using Swift UI, subscription can be made in a View as follows:

```swift
import SwiftUI

struct PaymentEngineView: View 
{
    // Define a Publisher
    let deviceStatusSubscription =
      NotificationCenter.default.publisher(for:
      NSNotification.Name(CardknoxPaymentEngineSDK.deviceStatus_NSNotification_Name()))
    
    var body: some View
    {
      VStack{}
      // Subscribe the Publisher with the NotificationCenter
      .onReceive(deviceStatusSubscription, perform: deviceStatusNotification(aNotification:))
    }
    
    // Define a function that accepts a Notification.
    // This method will be invoked when the SDK sends information about card reader status   
    func deviceStatusNotification(aNotification: Notification)
    {
        // Use the SDK's "response" object utility method to transform a Notification into a "response" object
        let status = CardknoxPaymentEngineSDK.unwrapDeviceStatus(with: aNotification) as String;
    }
}
```

#### Transaction status callback subscription <a href="#transaction-status-callback-subscription" id="transaction-status-callback-subscription"></a>

The transaction status callback sends information about the card scanning process. This callback starts triggering when the user inserts or swipes the credit card and ends with the result of card scanning.

For Swift applications using Swift UI, subscription can be made in a View as follows:

```swift
import SwiftUI

struct PaymentEngineView: View 
{
    // Define a Publisher
    let transactionStatusSubscription =
    NotificationCenter.default.publisher(for:
    NSNotification.Name(CardknoxPaymentEngineSDK.transactionStatus_NSNotification_Name()))
    
    var body: some View
    {
      VStack{}
      // Subscribe the Publisher with the NotificationCenter
      .onReceive(transactionStatusSubscription, perform: transactionStatusNotification(aNotification:))
    }
    
      // Define a function that accepts a Notification.
    // This method will be invoked when the SDK sends information about card scanning
    func transactionStatusNotification(aNotification: Notification){
        // Use the SDK's "response" object utility method to transform a Notification into a "response" object
        let status = CardknoxPaymentEngineSDK.unwrapTransactionStatus(with: aNotification) as String;
        let line = "transaction status: " + status;
        addLineToOutput(line: line)
    }
}
```

### Out of scope integration

Out of scope processing feature allows the developer to show the Cardknox user interface for payment processing.

To show the user interface, create a request object that is capable of showing a user interface:

```swift
// Create the parameters object
let prms : TransactionParameters = TransactionParameters.init()
prms.xAmount = 1.23;
prms.xInvoice = "1234";
prms.xCommand = "cc:sale";
// ... other fields.

// Create the request object
let request = CardknoxSDK.create().getOutOfScope().createRequest(withParameters: prms) as! PaymentTransactionRequestUI
```

```swift
// Create the parameters object
TransactionParameters *prms = [[TransactionParameters alloc] init];
prms.xAmount = 1.23;
prms.xInvoice = @"1234";
prms.xCommand = @"cc:sale";
// ... other fields.

// Create the request object
PaymentTransactionRequestUI * request = [cardknoxUI createRequestWithParameters:prms];
```

Check if the request object is in a valid state. If it is, call the method to show the UI. Otherwise, inspect the validation errors to see what is incorrect in the request object:

```swift
let request = CardknoxSDK.create().getOutOfScope().createRequest(withParameters: prms) as! PaymentTransactionRequestUI

if(request.isValid){
  request.process()
}
else{
  let errors = request.validationErrors;
}
```

```swift
PaymentTransactionRequestUI * request = [cardknoxUI createRequestWithParameters:prms];

if([request IsValid]){
  [request process];
}
else{
  NSArray* errors = request.ValidationErrors;
}
```

#### Available user interfaces

The SDK’s user interface consists of two fullscreen parts - a manual entry screen and a card reader screen. Manual entry screen is also abbreviated as a “keyed” screen. The card reader screen is also abbreviated as a “swipe” screen.

Showing the SDK user interface via a Request object will either show one of the screens, or both. Which screen will be visible depends on the global SDK configuration state prior to showing the SDK user interface via a Request object.

Note that if the SDK is configured to allow access to both processing screens, one of them will be shown by default and both of them will have some kind of a visual way to navigate to the other one.

The following table shows available functions to control which screen will be visible & accessible:

| **Function**               | **Description**                                                                            |
| -------------------------- | ------------------------------------------------------------------------------------------ |
| EnableKeyedEntry           | Globally configures the SDK to show the keyed screen that allows manual input interaction. |
|                            | **Sample data**                                                                            |
|                            | CardknoxSDKUI.setEnableKeyedEntry(true);                                                   |
| EnableDeviceInsertSwipeTap | Globally configures the SDK to show the swipe screen that allows card reader interaction.  |
|                            | **Sample data**                                                                            |
|                            | CardknoxSDKUI.setEnableDeviceInsertSwipeTap(true);                                         |

The following mapping represents which screens will be available when the SDK shows its user interface:

| **EnableDeviceInsertSwipeTap** | **EnableKeyedEntry** | **Keyed screen available** | **Swipe screen available** |
| ------------------------------ | -------------------- | -------------------------- | -------------------------- |
| false                          | false                | Yes                        | No                         |
| true                           | false                | No                         | Yes                        |
| false                          | true                 | Yes                        | No                         |
| true                           | true                 | Yes                        | Yes                        |

<figure><img src="/files/UjZacSfI7F9tObaGSTE2" alt=""><figcaption><p>Example of a <strong>keyed</strong> user interface. Keyed screen has a top right corner icon to navigate to the <strong>swipe</strong> screen.</p></figcaption></figure>

<figure><img src="/files/CXWBq29lRtuFktcQfG8s" alt=""><figcaption><p>Example of a <strong>swipe</strong> user interface. The <strong>swipe</strong> screen contains a button on the bottom that navigates the user to the <strong>keyed</strong> user interface.</p></figcaption></figure>

The following mapping represents available Sola Transaction API commands on each user interface:

| **Keyed**                        | **Swipe**                                                                                                                                                                                                                                                                             |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Any Sola Transaction API command | <p>Any of the following credit card commands:</p><ul><li>cc:save</li><li>cc:credit</li><li>cc:authonly</li><li>cc:sale</li></ul><p>Reference: <a href="https://docs.solapayments.com/api/transaction/credit-card"><https://docs.solapayments.com/api/transaction/credit-card></a></p> |

**Pre processing options**

Developer using the Out Of Scope integration to process using the VP3300 card reader can specify a per-request transaction timeout value. The SDK will start a transaction with the VP3300 reader, and timeout in the specified time frame if the card is not tapped, swiped or inserted in that same time frame.

| **Function/property**    | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| VP3300TransactionTimeout | Start transaction value, in seconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                          | **Sample data (Swift)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                          | <p><strong>let</strong> ui = CardknoxSDKUI.create();</p><p><strong>let</strong> parameters : TransactionParameters = TransactionParameters.init()</p><p>parameters.vp3300TransactionTimeout = 13;</p><p><strong>let</strong> req = cardknoxSDKUI?.createRequest(withParameters: parameters) <strong>as</strong>! PaymentTransactionRequestUI</p><p>// Enable swipe screen in the Cardknox UI</p><p>CardknoxSDKUI.setEnableDeviceInsertSwipeTap(<strong>true</strong>)</p><p>// Show Cardknox UI</p><p>req.process();</p> |

#### Post processing options

After the out-of-scope function finishes with transaction processing, the SDK displays a popup containing a handful of information about the transaction.

SDK can be configured to auto close the user interface immediately after the transaction processing has completed; regardless if the transaction was approved or not.

| **Function**                     | **Description**                                                                                                                   |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| CloseSDKOnUIProcessedTransaction | <p>Globally configures the SDK to auto close the user interface after processing a transaction.</p><p>Default value is false.</p> |
|                                  | **Sample data (Swift)**                                                                                                           |
|                                  | CardknoxSDKUI.setCloseOnProcessedTransaction(true);                                                                               |

![Example of a success popup](/files/KHNWT02j3SOQvvfKO22y)

![Example of an error popup](/files/YAicwboSyehHeHQgs86p)

### In scope integration

In scope processing feature allows the developer to quickly process a payment and retrieve the response object.

To process directly, create a request object:

{% tabs %}
{% tab title="Swift" %}
{% code lineNumbers="true" %}

```swift
// Create the parameters object
let prms : TransactionParameters = TransactionParameters.init()
prms.xAmount = 1.23;
prms.xInvoice = "1234";
prms.xCommand = "cc:sale";
// ... other fields.

// Create the request object
let request = cardknoxDirect.createRequest(withParameters: prms) as! PaymentTransactionRequestDirect;
```

{% endcode %}
{% endtab %}
{% endtabs %}

```swift
// Create the parameters object
TransactionParameters *prms = [[TransactionParameters alloc] init];
prms.xAmount = 1.23;
prms.xInvoice = @"1234";
prms.xCommand = @"cc:sale";
// ... other fields.

// Create the request object
PaymentTransactionRequestDirect* request = [cardknoxDirect createRequestWithParameters:prms];
```

Check if the request object is in a valid state. If it is, call the method to process directly. Otherwise, inspect the validation errors to see what is incorrect in the request object:

{% tabs %}
{% tab title="Swift" %}

```swift
let request = cardknoxDirect.createRequest(withParameters: prms) as! PaymentTransactionRequestDirect;

if(request.isValid){
    let response : PaymentTransactionResponse = request.process() as! PaymentTransactionResponse;
    let isSuccess = response.isSuccess();
    let errorMessage = response.errorMessage();
    let errorCode = response.xErrorCode();
    let refNum = response.xRefNum();
}
else{
    let errors = request.validationErrors;
}
```

{% endtab %}
{% endtabs %}

```swift
PaymentTransactionRequestDirect* request = [cardknoxDirect createRequestWithParameters:prms];

if([request IsValid]){
    PaymentTransactionResponse * response = [request process];
    bool isSuccess = response.isSuccess;
    NSString * errorMessage = response.errorMessage;
    NSString * errorCode = response.xErrorCode;
    NSString * refNum = response.xRefNum;
}
else{
    NSArray* errors = request.ValidationErrors;
}
```

#### Available commands <a href="#available-commands" id="available-commands"></a>

* Check (ACH) commands
  * Reference: [Check (ACH)](https://docs.solapayments.com/api/transaction/check-ach)
* Credit Card commands
  * Reference: [Credit Card](https://docs.solapayments.com/api/transaction/credit-card)
* EBT Food Stamp commands
  * Reference: [EBT Food Stamp](https://docs.solapayments.com/api/transaction/ebt#ebt-food-stamp)
* EBT Cash Benefits
  * Reference: [EBT Cash Benefits](https://docs.solapayments.com/api/transaction/ebt#ebt-cash-benefits)
* EBT Wic
  * Reference: [EBT Wic](https://docs.solapayments.com/api/transaction/ebt#ebt-wic-ewic)
* Gift Card commands
  * Reference: [Gift Card](https://docs.solapayments.com/api/transaction/gift-card)

### Custom UI integration

Custom UI integration is similar to the “out of scope” integration in a way that the exact same methods that the “out of scope” is using under the hood for controlling the card reader, are exposed via the SDK for the Developer to use.

The Developer provides the user interface and orchestrates the entire flow for obtaining the card data via the card reader by calling appropriate Custom UI functions at specific times.

| **Function**                | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| StartScanning               | <p>Starts the “scan for nearby bluetooth devices” process.</p><p>If the timeout value is 0 or a negative number, the scanning never times out.<br><br>A card reader event similar to “waiting for device response” will be raised once the scanning starts. This usually means that the user needs to press the physical button in order for the card reader device to be visible to nearby scanners.</p>                                                                                                                                                                           |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | customUI.startScanning(withTimeout: 0);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| StopScanning                | <p>Attempts to stop the bluetooth device scanning process.</p><p>Raises a “stop scan” card reader event.</p><p>Doesn’t do anything if scanning is not in progress.</p><p>If the method stops the scanning process, the SDK reports all scanned devices via a callback.</p>                                                                                                                                                                                                                                                                                                          |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | customUI.stopScanning();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ConnectWithName             | <p>Accepts a device name.</p><p>Configures the SDK to be ready to establish a Bluetooth connection with the nearby VP3300 device with a name equal to the provided name.</p><p>After the call:</p><ul><li>The card reader & the app are not connected immediately but rather the SDK notifies the developer about various card reader events taking place after this method is called; such as “connecting” and “waiting for device response”</li><li>If the VP3300 devices’ bluetooth is not asleep when this method is called, the card reader auto connects to the app</li></ul> |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | <p>let scannedDevice : String = nil;</p><p><br>customUI.connect(toDevice: scannedDevice);</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ConnectwithUUID             | <p>Accepts an UUID in a string format.<br></p><p>Configures the SDK to be ready to establish a Bluetooth connection with the nearby VP3300 device with the internal identifier equal to the provided UUID value.<br></p><p>Note that on iOS, the CoreBluetooth framework generated internal identifiers are not unique across time.</p>                                                                                                                                                                                                                                             |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | <p>let uuid = "d1554880-56ac-11ed-9b6a-0242ac120002";</p><p><br>customUI.connect(withUUID: uuid);</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| DisconnectFromCurrentDevice | <p>Attempts to break the connection between the application & the card reader.<br></p><p>If the card reader is not connected to the app, a card reader event similar to “disconnected already” is raised.<br></p><p>Otherwise, the SDK attempts to disconnect the card reader. If successful, the “disconnected” card reader event is raised.</p>                                                                                                                                                                                                                                   |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | customUI.disconnectFromCurrentDevice();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| StartTransaction            | <p>Starts a transaction between an already connected application & the card reader.</p><p><br>Once the transaction starts, the card reader is ready to accept cards, either via swipe, tap or insert.<br><br>This method can timeout. Default value is 10 seconds. Developers can override this value via the “parameters” object.</p>                                                                                                                                                                                                                                              |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | <p><strong>let</strong> prms : TransactionParameters = TransactionParameters.init()</p><p>prms.xAmount = 1.23;</p><p>prms.xInvoice = "1234";</p><p>prms.xCommand = "cc:sale";</p><p>prms.vp3300TransactionTimeout = 13;</p><p>customUI.startTransaction(withArgs: prms);</p>                                                                                                                                                                                                                                                                                                        |
| CancelTransaction           | <p>Attempts to cancel an already started transaction between the application & the card reader.</p><p>If no transactions are started when this function is called, the function does not do anything.</p>                                                                                                                                                                                                                                                                                                                                                                           |
|                             | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                             | customUI.cancelTransaction();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

#### Available commands <a href="#available-commands.1" id="available-commands.1"></a>

Any of the following credit card commands are available for Custom UI:

* cc:save
* cc:credit
* cc:authonly
* cc:sale

Reference: [Transaction API](https://docs.solapayments.com/api/transaction/credit-card)

#### Custom UI flow

First, create a “custom ui” object to get access to all the Custom UI functions. Afterwards, subscribe to all the relevant callbacks for this integration path:

* transaction result callback - to receive the “response” object after the SDK has processed a transaction
* card reader event callback - to be notified about various events that take place between the application & the card reader
* scanned bluetooth device callback - to be notified about every new scanned bluetooth device during the “scan for devices” process
* scan completed callback - to be notified about all the scanned devices once the “scan for devices” process ends

Next step is to establish a connection between the app and the card reader device. Use one of the “connect” methods on the “custom ui” to initiate a connection; such as “connect with name” or “connect with UUID”.

Device name or the UUID can be obtained with the “scan for devices” flow. Initiate the “start scanning” function call, with or without a timeout.

![Start scanning flow](/files/yUB9VliAmuskSe71TKXx)

The scanning process stops with a call to the “stop scanning” function or when the “start scanning” function times out.

![Stop scanning flow](/files/Ziif9deUUWgH641FIzPd)

After establishing a connection with the card reader by calling one of the “connect” methods and receiving a “connected” card reader event via the NSNotificationCenter subscription, call the “start transaction” function to make the card reader ready for a card.

The SDK will report a “transaction starting” card reader event via a callback followed by the “transaction started” event if the transaction with the card reader was successfully started, otherwise an “error” card reader event is reported back. At this point the card can be tapped, swiped or inserted into the card reader. The SDK will read the card information, process a transaction & deliver the results to the application via a callback.

If no card is tapped, swiped or inserted after the transaction started - a “timeout” card reader is reported back. The default timeout value is about 10 seconds. The developer can override this value via the “transaction parameters” object.

### Payment engine integration <a href="#payment-engine-integration" id="payment-engine-integration"></a>

The Payment Engine won't show any UI. The developer provides the user interface and uses three payment engine functions to create transactions with a card reader over IP. Data that is required to create a transaction is passed by developers as parameters to those SDK functions. The messages and results of creating a transaction with the Payments engine are obtained by the developer from transaction result callback, device status callback, and transaction status.

| Device\_Initialize            | <p>This function makes sure that the mobile device can communicate with the card reader and saves data that is needed for connecting to the card reader.</p><p>The initialization process can take about 2 minutes. But it is sufficient to execute it once per card reader and IP address.</p>                                                                                                                                                                                                                                                                                   |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                               | <p>let settings : CardknoxPaymentEngineSDKSettings</p><p>CardknoxPaymentEngineSDKSettings.init();</p><p>settings.device\_Name = "Verifone\_P400.4";</p><p>settings.device\_IP\_Address = “127.21.2.7”;</p><p>settings.device\_IP\_Port = “9006”;</p><p>settings. device\_Timeout = 120 \* 1000; // seconds</p><p>CardknoxSDK.create().getPaymentEngine().device\_Initialize(withSettings: settings)</p>                                                                                                                                                                           |
| ProcessOutOfScopeWithSettings | <p>Attempts to create a transaction with a card reader over IP. </p><p>This function will perform the initialization process if initialization has not been performed for the specific card reader.</p>                                                                                                                                                                                                                                                                                                                                                                           |
|                               | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                               | <p>let settings : CardknoxPaymentEngineSDKSettings</p><p>CardknoxPaymentEngineSDKSettings.init();</p><p>settings.device\_Name = "Verifone\_P400.4";</p><p>settings.device\_IP\_Address = “127.21.2.7”;</p><p>settings.device\_IP\_Port = “9006”;</p><p>settings. device\_Timeout = 120 \* 1000; // seconds</p><p>let request : CardknoxPaymentEngineSDKRequest = CardknoxPaymentEngineSDKRequest.init();<br>request.xAmount = 1.23<br>request.xCommand = "cc:sale";</p><p>CardknoxSDK.create().getPaymentEngine().processOutOfScope(withSettings: settings, request: request)</p> |
| Device\_CancelTransaction     | <p>Attempts to cancel an already started transaction between the application & the card reader.</p><p>If no transactions are started when this function is called, the function does not do anything.</p>                                                                                                                                                                                                                                                                                                                                                                         |
|                               | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                               | CardknoxSDK.create().getPaymentEngine().device\_CancelTransaction();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### Versioning

Developers can call the “get version” API to obtain the SDK Semantic Versioning ([SemVer source](https://semver.org/))

| **Function** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getVersion   | <p>Reads the SDK version</p><p>Returns a “cardknox sdk version” object</p><ul><li>access to the Semantic Versioning “string” value</li><li>access to all individual parts: major, minor, patch, build</li></ul>                                                                                                                                                                                                                                                                                   |
|              | **Sample data (Swift)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|              | <p><strong>let</strong> ver = CardknoxSDK.getVersion() <strong>as</strong>! CardknoxSDKVersion</p><p>// Read the version in format "major.minor.patch.build"</p><p><strong>let</strong> semanticVersion = ver.description();</p><p>// Access individual parts as well</p><p><strong>let</strong> major : Int32 = ver.major;</p><p><strong>let</strong> minor : Int32 = ver.minor;</p><p><strong>let</strong> patch : Int32 = ver.patch;</p><p><strong>let</strong> build : Int32 = ver.build;</p> |
|              | **Sample data (Objective C)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|              | <p>CardknoxSDKVersion \*ver = \[CardknoxSDK getVersion];</p><p>// Read the version in format "major.minor.patch.build"</p><p>NSString \*semanticVersion = \[ver description];</p><p>// Access individual parts as well</p><p><strong>int</strong> major = \[ver major];</p><p><strong>int</strong> minor = \[ver minor];</p><p><strong>int</strong> patch = \[ver patch];</p><p><strong>int</strong> build = \[ver build];</p>                                                                    |

### Logging

SDK verbose logging can be enabled or disabled with a function call:

| **Function**  | **Description**                                                          |
| ------------- | ------------------------------------------------------------------------ |
| EnableLogging | <p>Accepts a boolean.</p><p>Enables or disabled the verbose logging.</p> |
|               | **Sample data (Swift)**                                                  |
|               | CardknoxSDK.enableLogging(**false**);                                    |
|               | **Sample data (Objective C)**                                            |
|               | \[CardknoxSDK enableLogging:**true**];                                   |

### FAQ

1. As a Sola SDK user, I want to process without an internet connection. What will happen?
   * The SDK will return a PaymentTransactionResponse object with a special xErrorCode value -1
2. As a Sola SDK user, I’ve encountered errors during transaction processing. What response can I expect?
   * The PaymentTransactionRequest object will encapsulate all relevant information in respective fields; for example the xErrorCode property will return a code from the Sola Transaction API documentation, the xErrorMessage and xError properties can be used for a descriptive error message while the xRefNum gives back a unique ref num to follow up with the customer support


# iOS SDK - Technical Guide

## Overview

This document helps developers to set up and integrate Cardknox Payments SDK into Swift projects. The document contains steps for framework integration, required settings setup and import of SDK headers.

## Technical Overview

* The SDK is distributed as a `.framework`
* `.framework` contains the `CardknoxPaymentsSDK` binary and `ObjectiveC` `.h` headers describing the SDK API
* The `CardknoxPaymentsSDK` does not contain `bitcode` and cannot be integrated with applications that require `bitcode`
* `.framework` only supports `arm64` 64-bit architecture for device builds. Simulator targets are not supported.
* SDK minimum deployment target is 14.0

## Framework File Integration

1. Obtain and place the downloaded `.framework` file to the root of your project (for example, alongside the `xcodeproj` file):<br>

   <figure><img src="/files/Ok2jnLIiLiSztPkjrOJJ" alt=""><figcaption></figcaption></figure>
2. Open the `General` under the application `Target`. Find the `Frameworks, Libraries, and Embedded Content` section. Click on the `+ icon` for adding a framework to the project.

   <figure><img src="/files/HZq15D9sicTnZf7AOU7V" alt=""><figcaption></figcaption></figure>
3. `+ icon` opens the dialog screen for adding framework. On dialog click on `Add Other` dropbox, which opens a menu. On the menu click on `Add files...`.\
   ![](/files/EwLjbiqJbI2Krfjb0va6)
4. `Add files...` opens `Choose frameworks and libraries to add` dialog. On dialog find the root folder of the project and select `CardknoxPaymentsSDK.framework` file.<br>

   <figure><img src="/files/OaTBXtQE6H3pcWPwC8GK" alt=""><figcaption></figcaption></figure>
5. After adding the framework, the `CardknoxPaymentsSDK.framework` must be in `the Frameworks, Libraries, and Embedded Content` section. Pay attention to the value in the `Embed` column. The value must be `Embed & Sign.` <br>

   <figure><img src="/files/8BbZxgpuRBH7Cr90LL1N" alt=""><figcaption></figcaption></figure>
6. Also after adding the framework, the `CardknoxPaymentsSDK.framework` must be in `Link Binary With Libraries` and `Embed Frameworks` sections. `Link Binary With Libraries` and `Embed Frameworks` sections are in the `Build Phases` tab, under the application `Target`.<br>

   <figure><img src="/files/Mx816j2IMQJfntpeysaW" alt=""><figcaption></figcaption></figure>

#### SkiaSharp dependency <a href="#id-3.1.-skiasharp-dependency" id="id-3.1.-skiasharp-dependency"></a>

The goal is to reference the `libSkiaSharp.framework`. It can be found in the `CardknoxPaymentsSDK.framework/Frameworks` folder. Repeat the same steps for `libSkiaSharp.framework` integration.

## Required Settings Setup

### Disabling Bitcode

The Cardknox SDK doesn’t support bitcode. To disable Bitcode, follow these steps:

1. Click on your application target. Choose `Build Settings` > `All`
2. Set the `Enable Bitcode` option to `No` in the `Build Options` section\
   ![](/files/ITY1VVubkpuP8pGSdOat)

### Info.plist merge

1. The `CardknoxPaymentsSDK` framework contains an `Info.plist` file which contains various key/value pairs that are required by the framework, for example, it defines a `NSBluetoothAlwaysUsageDescription` key with a value similar to “Bluetooth is required to find, connect to and transfer data between a card reader and the app"
2. The application that is using the `CardknoxPaymentsSDK` framework also defines an `Info.plist` file with its own key/value pairs
3. The goal is to merge the framework `Info.plist` file with the application `Info.plist` in order to avoid runtime errors in the `CardknoxPaymentsSDK` framework code due to missing key/values. `XCode` doesn't perform any merges automatically.
4. Note that if there are identical keys present in the application `Info.plist` and in the framework `Info.plist` files, such as the `NSBluetoothAlwaysUsageDescription` key; the value defined in the application Info.plist for that key will have priority during the merge; making it easy to override values in the framework `Info.plist`
5. To merge the two files, define a `Run Script` step in the `XCode` application Target's `Build Phases` section and run the `PlistBuddy` tool, as following:
   * Add a new `Run Script` step to `Build Phases`\
     ![](/files/UeQ0Whoz6i8YMfzr1dWa)
   * Make sure that the `Run Script` step is the last step, below other steps (`Compile Sources`, `Embed Frameworks`, etc.). You can reposition steps by dragging up and down:\
     ![](/files/OyBe5GBnUSY3qoeoS3K9)
   * Expand the `Run Script` step\
     ![](/files/kQhVUIGImGGF10UZP0K9)
   * Delete the `Type a script...` contents of the input box and add the following command
     * `/usr/libexec/PlistBuddy -c "merge CardknoxPaymentsSDK.framework/Info.plist" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"`\
       ![](/files/uu0yYLeuQaOmzsdBdWea)

Globalization File

1. The SDK contains a file icudt.dat. This file is used by the dotnet runtime to configure globalization. Our SDK is using the en-US culture to format currency symbols, amount delimiters, etc.. This means the SDK is “culture sensitive” or “culture variant”.
2. dotnet runtime will look for the icudt.dat file in the “main bundle” which is the Swift app where the SDK is a guest. Therefor our goal is to copy the icudt.dat into the final application archive in XCode, whenever the app builds.
3. Define a new Run Script phase for your application Target in XCode
4. Input the following code:

```
# Define source and destination paths
FRAMEWORK_NAME="CardknoxPaymentsSDK"
ICU_FILE_NAME="icudt.dat"
SRC_PATH="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${FRAMEWORK_NAME}.framework/${ICU_FILE_NAME}"
DST_PATH="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${ICU_FILE_NAME}"

echo "Copying ${ICU_FILE_NAME} from ${SRC_PATH} to ${DST_PATH}"

# Check if file exists
if [ -f "$SRC_PATH" ]; then
    cp "$SRC_PATH" "$DST_PATH"
    echo "✅ Successfully copied ${ICU_FILE_NAME} to main bundle"
else
    echo "❌ ICU file not found at: ${SRC_PATH}"
    exit 1
fi
```

## CardknoxPaymentsSDK headers import <a href="#id-5.-cardknoxpaymentssdk-headers-import" id="id-5.-cardknoxpaymentssdk-headers-import"></a>

This section shows how to use the `CardknoxPaymentsSDK` in Swift code. For Swift applications, an umbrella header needs to be created and referenced by your application `Target` in order to properly embed the framework into your app. To create the umbrella header, follow the steps:

1. Create a new header file in the `Target` folder via `File` menu > `New...` > `File from Template...` Choose `Header File` option; for example, the name might be: `iOS.Swift.SampleApp-Bridging-Header.h` <br>

   <figure><img src="/files/3kzX4RrwL1JVGSQh5OYz" alt=""><figcaption></figcaption></figure>
2. Clear all text in the header file
3. Add `#import "CardknoxPaymentsSDK/CardknoxPaymentsSDK.h"` into the header file.<br>

   <figure><img src="/files/q4A14qq1jdPvD3Sws5Gm" alt=""><figcaption></figcaption></figure>
4. Navigate to your target’s `Build Settings` > `All`.
5. Find the `Objective-C Bridging Header` option in the `Swift Compiler - General` section, and set its value to be the relative path to the header file. For example, an application target named `iOS.Swift.SampleApp` will have `iOS.Swift.SampleApp/iOS.Swift.SampleApp-Bridging-Header.h` path specified. The assumption here is that the header file is in the `Target` folder, alongside the `Info.plist` file.<br>

   <figure><img src="/files/s3arYqCDMvH7CYj3CSBT" alt=""><figcaption></figcaption></figure>


# Workflow

## Overview

{% tabs %}
{% tab title="In Scope" %}

* [Swift - SwiftUI](#swift-swiftui)
* [Swift - Storyboard](#swift-storyboard)
* [Objective C - Storyboard](#objective-c-storyboard)
  {% endtab %}

{% tab title="Out of Scope" %}

* [Swift - SwiftUI](#swift-swiftui-2)
* [Swift - Storyboard](#swift-storyboard-2)
* [Objective C - Storyboard](#objective-c-storyboard-2)
  {% endtab %}

{% tab title="Custom UI" %}
Coming soon.
{% endtab %}
{% endtabs %}

## Workflow Examples

{% tabs %}
{% tab title="In Scope Examples" %}
Example 1: [Swift, Storyboard, cc:sale](#in-scope-example-1)

Example 2: [Objective C, Storyboard, cc:refund](#in-scope-example-2)
{% endtab %}

{% tab title="Out of Scope Examples" %}
Example 1: [Swift, Storyboard, cc:sale](#out-of-scope-example-1)

Example 2: [Objective C, Storyboard, cc:sale](#out-of-scope-example-2)
{% endtab %}
{% endtabs %}

## In Scope

### Swift - SwiftUI

To submit a <mark style="color:red;">**\<xCommand>**</mark> request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
CardknoxSDK.setPrincipalKey("Your xKey value");
CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9");
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
func viewDidAppear()
{
  // Example of a "view appear" method in a SwiftUI View
  // Store the object instance as a @State in the View for later use
  let cardknoxSDKDirect = CardknoxSDKDirect.create() as? CardknoxSDKDirect;
}
```

{% endcode %}

Register the “view appear” method with the “body” parameter

```
struct InScopeView : View
{
  var body: some View
  {
    // Using NavigationView as a View example
    NavigationView{}
    .onAppear(perform: viewDidAppear)
  }
}
```

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code lineNumbers="true" %}

```
cardknoxSDKDirect.destroy();
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
let prms : TransactionParameters = TransactionParameters.init()
```

{% endcode %}

Specify the required parameters:

{% code lineNumbers="true" %}

```
prms.xCommand = "<xCommand>";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**CHANGE \<xCommand>**</mark>

Specify the additional parameters for the <mark style="color:red;">**\<xCommand>**</mark> transaction type:

**If selected Transaction type is&#x20;**<mark style="color:red;">**cc:sale, cc:credit, cc:authonly**</mark>

{% code lineNumbers="true" %}

```
prms.xCardNum = "4444333322221111";
prms.xExpDate = "1225"; // MMYY
```

{% endcode %}

**If selected Transaction type is&#x20;**<mark style="color:red;">**cc:capture**</mark>

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xRefNum = "123456789";
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = "123456";
prms.xBillFirstName = "Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
let request = cardknoxSDKDirect.createRequest(withParameters: prms) as! PaymentTransactionRequestDirect;

if(request.isValid)
{
  let respone = request.process() as! PaymentTransactionResponse
  
  if(response.isSuccess())
  {
    let refNum = respone.xRefNum();
    let status = respone.xStatus();
    let avs = respone.xAvsResult();
  }
  else
  {
    let refNum = response.xRefNum();
    let error = response.xError()!
    let errorCode = response.xErrorCode()!;
  }
}
else
{
  // Request could not be processed due to these errors
  let errors = request.validationErrors!
}
```

{% endcode %}

### Swift - Storyboard

To submit a <mark style="color:red;">**\<xCommand>**</mark> request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
CardknoxSDK.setPrincipalKey("Your xKey value");
CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9");
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
override func viewDidAppear(_ animated: Bool) 
{
  super.viewDidAppear(animated)
  let cardknoxSDKDirect = CardknoxSDKDirect.create() as? CardknoxSDKDirect
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code lineNumbers="true" %}

```
cardknoxSDKDirect.destroy();
```

{% endcode %}

Next, create a transaction parameters object:

{% code lineNumbers="true" %}

```
let prms = TransactionParameters();
```

{% endcode %}

Specify the required parameters:

{% code lineNumbers="true" %}

```
prms.xCommand = "<xCommand>";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**CHANGE \<xCommand>**</mark>

Specify the additional parameters for the <mark style="color:red;">**\<xCommand>**</mark> transaction type:

**If selected Transaction type is&#x20;**<mark style="color:red;">**cc:sale, cc:credit, cc:authonly**</mark>

{% code lineNumbers="true" %}

```
prms.xCardNum = "4444333322221111";
prms.xExpDate = "1225"; // MMYY
```

{% endcode %}

**If selected Transaction type is&#x20;**<mark style="color:red;">**cc:capture**</mark>

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xRefNum = "123456789";
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = "123456";
prms.xBillFirstName = "Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
let request = cardknoxSDKDirect.createRequest(withParameters: prms) as! PaymentTransactionRequestDirect;

if(request.isValid)
{
  let respone = request.process() as! PaymentTransactionResponse
  
  if(response.isSuccess())
  {
    let refNum = respone.xRefNum();
    let status = respone.xStatus();
    let avs = respone.xAvsResult();
  }
  else
  {
    let refNum = response.xRefNum();
    let error = response.xError()!
    let errorCode = response.xErrorCode()!;
  }
}
else
{
  // Request could not be processed due to these errors
  let errors = request.validationErrors!
}
```

{% endcode %}

### Objective C - Storyboard

To submit a <mark style="color:red;">**\<xCommand>**</mark> request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
[CardknoxSDK setPrincipalKey:@"Your xKey"];
[CardknoxSDK setxSoftwareName:@"Your app name" xSoftwareVersion:@"1.0.0" xVersion:@"4.5.9"];
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
- (void)viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];
  CardknoxSDKDirect* cardknoxSDKDirect = [CardknoxSDKDirect create];
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code lineNumbers="true" %}

```
[cardknoxSDKDirect destroy];
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
TransactionParameters *prms =[[TransactionParameters alloc] init];
```

{% endcode %}

Specify the required parameters:

{% code lineNumbers="true" %}

```
prms.xCommand = @"<xCommand>";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**CHANGE \<xCommand>**</mark>

Specify the additional parameters for the <mark style="color:red;">**\<xCommand>**</mark> transaction type:

**If selected Transaction type is&#x20;**<mark style="color:red;">**cc:sale, cc:credit, cc:authonly**</mark>

{% code lineNumbers="true" %}

```
prms.xCardNum = @"4444333322221111";
prms.xExpDate = @"1225"; // MMYY
```

{% endcode %}

**If selected Transaction type is&#x20;**<mark style="color:red;">**cc:capture**</mark>

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xRefNum = @"123456789";
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = @"123456";
prms.xBillFirstName = @"Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
PaymentTransactionRequestDirect *request = [cardknoxSDKDirect createRequestWithParameters:prms];

if([request IsValid])
{
  PaymentTransactionResponse * response = [request process];
 
  if(response.isSuccess)
  {
    NSString* refNum = response.xRefNum;
    NSString* status = response.xStatus;
    NSString* avs = response.xAvsResult; 
  }
  else
  {
    NSString* refNum = response.xRefNum;
    NSString* error = response.xError;
    NSString* errorCode = response.xErrorCode;
  } 
}
else
{
  // Request could not be processed due to these errors
  NSArray* errors = request.ValidationErrors;
}
```

{% endcode %}

## Out of Scope

### Swift - SwiftUI 2

To submit a <mark style="color:red;">**\<xCommand>**</mark> request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
CardknoxSDK.setPrincipalKey("Your xKey value");
CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9");
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
func viewDidAppear()
{
  // Example of a "view appear" method in a SwiftUI View
  // Store the object instance as a @State in the View for later use
  let cardknoxSDKUI = CardknoxSDKUI.create() as? CardknoxSDKUI
}
```

{% endcode %}

Register the “view appear” method with the “body” parameterde

{% code overflow="wrap" lineNumbers="true" %}

```
struct OutOfScopeView : View
{
  var body: some View
  {
    // Using NavigationView as a View example
    NavigationView{}
    .onAppear(perform: viewDidAppear)
  }
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code lineNumbers="true" %}

```
cardknoxSDKDirect.destroy();
```

{% endcode %}

Define a Publisher object that will deliver processed Transaction results in a Notification:

{% code overflow="wrap" lineNumbers="true" %}

```
let transactionResultSubscription =
NotificationCenter.default.publisher(for: NSNotification.Name(CardknoxSDK.transactionResultSubscription_NSNotificationCenterName()))
```

{% endcode %}

Define a Publisher object that will deliver Notifications about various card reader event taking place in the SDK:

{% code overflow="wrap" lineNumbers="true" %}

```
let cardreaderEventSubscription =
    NotificationCenter.default.publisher(for: NSNotification.Name(CardknoxSDK.cardreaderEventSubscription_NSNotificationCenterName()))
```

{% endcode %}

Define a method to run when the SDK processes a transaction and sends the processing results back:

{% code overflow="wrap" lineNumbers="true" %}

```
func transactionResultSubscription(aNotification: Notification)
{
    let response = PaymentTransactionResponse.unwrap(aNotification) as! PaymentTransactionResponse
    
    var message = ""
    if(response.isSuccess())
    {
        let refNum = response.xRefNum()!
        message = "Transaction success response! Ref num: " + refNum
    }
    else
    {
        let error = response.errorMessage()!
        message = "Transaction error response - " + error
    }
}
```

{% endcode %}

Afterwards, subscribe the method to receive results back from the SDK:

{% code overflow="wrap" lineNumbers="true" %}

```
struct OutOfScopeView : View
{
  var body: some View
  {
    // Using NavigationView as a View example
    NavigationView{}
    .onReceive(transactionResultSubscriptionPublisher, perform:  transactionResultSubscription(aNotification:))
  }
}
```

{% endcode %}

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

{% code overflow="wrap" lineNumbers="true" %}

```
func cardreaderEventSubscription(aNotification: Notification)
{
  let callback = CardknoxCardReaderCallback.unwrap(aNotification) as? CardknoxCardReaderCallback
  
  let code = callback?.code()
  let name = callback?.name()
  
  var errorMessage : String?;
  if(code == CardknoxCardReaderCallbackType.error()){
      errorMessage = callback?.message();
  }
}
```

{% endcode %}

Afterwards, subscribe the method to be notified about card reader events:

{% code overflow="wrap" lineNumbers="true" %}

```
struct OutOfScopeView : View
{
  var body: some View
  {
    // Using NavigationView as a View example
    NavigationView{}
    .onReceive(cardreaderEventSubscriptionPublisher, perform: cardreaderEventSubscription(aNotification:))
  }
}
```

{% endcode %}

Next, create a transaction parameters object:

{% code lineNumbers="true" %}

```
let prms = TransactionParameters();
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCommand = "<xCommand>";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**CHANGE \<xCommand> to value from Transaction Type dropdown**</mark>

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = "123456";
prms.xBillFirstName = "Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
// Define if a 'keyed' screen is available
CardknoxSDKUI.setEnableKeyedEntry(true);
// Define if a 'swipe' screen is available
CardknoxSDKUI.setEnableDeviceInsertSwipeTap(true);
// Define if the UI should auto close
CardknoxSDKUI.setCloseOnProcessedTransaction(true);

let request = cardknoxSDKUI.createRequest(withParameters: prms) as! PaymentTransactionRequestUI
if(request.isValid)
{
  // Show the Cardknox UI
  request.process()
}
else
{
  // Request could not be processed due to these errors
  let errors = request.validationErrors!
}
```

{% endcode %}

### Swift - Storyboard 2

To submit a <mark style="color:red;">**\<xCommand>**</mark> request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
CardknoxSDK.setPrincipalKey("Your xKey value");
CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9");
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
override func viewDidAppear(_ animated: Bool) 
{
  super.viewDidAppear(animated)
  let cardknoxSDKUI = CardknoxSDKUI.create() as? CardknoxSDKUI
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code lineNumbers="true" %}

```
cardknoxSDKDirect.destroy();
```

{% endcode %}

Define a method to run when the SDK processes a transaction and sends the processing results back:

{% code overflow="wrap" lineNumbers="true" %}

```
@objc func transactionResultSubscription(aNotification: Notification)
{
    let response = PaymentTransactionResponse.unwrap(aNotification) as! PaymentTransactionResponse
    
    var message = ""
    if(response.isSuccess())
    {
        let refNum = response.xRefNum()!
        message = "Transaction success response! Ref num: " + refNum
    }
    else
    {
        let error = response.errorMessage()!
        message = "Transaction error response - " + error
    }
}
```

{% endcode %}

Afterwards, subscribe the method to receive results back from the SDK:

{% code overflow="wrap" lineNumbers="true" %}

```
NotificationCenter.default.addObserver(self,
                                       selector: #selector(transactionResultSubscription(aNotification:)),
                                       name: Notification.Name( CardknoxSDK.transactionResultSubscription_NSNotificationCenterName()),
                                       object: nil)
```

{% endcode %}

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

{% code overflow="wrap" lineNumbers="true" %}

```
@objc func cardreaderEventSubscription(aNotification: Notification)
{
  let callback = CardknoxCardReaderCallback.unwrap(aNotification) as? CardknoxCardReaderCallback
  
  let code = callback?.code()
  let name = callback?.name()
  
  var errorMessage : String?;
  if(code == CardknoxCardReaderCallbackType.error()){
      errorMessage = callback?.message();
  }
}
```

{% endcode %}

Afterwards, subscribe the method to be notified about card reader events:

{% code overflow="wrap" lineNumbers="true" %}

```
NotificationCenter.default.addObserver(self,
                                       selector: #selector(cardreaderEventSubscription(aNotification:)),
                                       name: Notification.Name( CardknoxSDK.cardreaderEventSubscription_NSNotificationCenterName()),
                                       object: nil)
```

{% endcode %}

Next, create a transaction parameters object:

{% code lineNumbers="true" %}

```
let prms = TransactionParameters();
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCommand = "<xCommand>";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**CHANGE \<xCommand> to value from Transaction Type dropdown**</mark>

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = "123456";
prms.xBillFirstName = "Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
// Define if a 'keyed' screen is available
CardknoxSDKUI.setEnableKeyedEntry(true);
// Define if a 'swipe' screen is available
CardknoxSDKUI.setEnableDeviceInsertSwipeTap(true);
// Define if the UI should auto close
CardknoxSDKUI.setCloseOnProcessedTransaction(true);

let request = cardknoxSDKUI.createRequest(withParameters: prms) as! PaymentTransactionRequestUI
if(request.isValid)
{
  // Show the Cardknox UI
  request.process()
}
else
{
  // Request could not be processed due to these errors
  let errors = request.validationErrors!
}
```

{% endcode %}

### Objective C - Storyboard 2

To submit a <mark style="color:red;">**\<xCommand>**</mark> request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
[CardknoxSDK setPrincipalKey:@"Your xKey"];
[CardknoxSDK setxSoftwareName:@"Your app name" xSoftwareVersion:@"1.0.0" xVersion:@"4.5.9"];
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
- (void)viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];
  CardknoxSDKUI* cardknoxSDKUI = [CardknoxSDKUI create];
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code lineNumbers="true" %}

```
[cardknoxSDKUI destroy];
```

{% endcode %}

Define a method to run when the SDK processes a transaction and sends the processing results back:

{% code overflow="wrap" lineNumbers="true" %}

```
-(void)transactionResultSubscription:(NSNotification*)aNotification
{
    PaymentTransactionResponse * response = [PaymentTransactionResponse unwrap:aNotification];
    
    NSString *message;
    if(response.isSuccess)
    {
        NSString * refNum = response.xRefNum;
        message = [NSString stringWithFormat:@"Transaction success response! Ref num: %@", refNum];
    }
    else
    {
        NSString * error = response.errorMessage;
        message = [NSString stringWithFormat:@"Transaction error response - %@", error];
    }
}
```

{% endcode %}

Afterwards, subscribe the method to receive results back from the SDK:

{% code overflow="wrap" lineNumbers="true" %}

```
[[NSNotificationCenter defaultCenter] addObserver:self
                       selector:@selector(transactionResultSubscription:)
                           name:[CardknoxSDK transactionResultSubscription_NSNotificationCenterName]
                         object:nil];
```

{% endcode %}

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

{% code overflow="wrap" lineNumbers="true" %}

```
-(void)cardreaderEventSubscription:(NSNotification*)callbackNotification
{
    CardknoxCardReaderCallback* callback = [CardknoxCardReaderCallback unwrap:callbackNotification];
    
    int code = callback.code;
    NSString* name = callback.name;
    
    NSString* errorMessage;
    if(code == CardknoxCardReaderCallbackType.error){
        errorMessage = callback.message;
    }
}
```

{% endcode %}

Afterwards, subscribe the method to be notified about card reader events:

{% code overflow="wrap" lineNumbers="true" %}

```
NotificationCenter.default.addObserver(self,
                                       selector: #selector(cardreaderEventSubscription(aNotification:)),
                                       name: Notification.Name( CardknoxSDK.cardreaderEventSubscription_NSNotificationCenterName()),
                                       object: nil)
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
TransactionParameters *prms =[[TransactionParameters alloc] init];
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCommand = @"<xCommand>";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**CHANGE \<xCommand> to value from Transaction Type dropdown**</mark>

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = @"123456";
prms.xBillFirstName = @"Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
// Define if a 'keyed' screen is available
CardknoxSDKUI.EnableKeyedEntry = true;
// Define if a 'swipe' screen is available
CardknoxSDKUI.EnableDeviceInsertSwipeTap = true;
// Define if the UI should auto close
CardknoxSDKUI.CloseSDKUIOnProcessedTransaction = true;

PaymentTransactionRequestUI *request = [cardknoxSDKUI createRequestWithParameters:prms];
if(request.IsValid)
{
  // Show the Cardknox UI
  [request process];
}
else
{
  // Request could not be processed due to these errors
  NSArray* errors = request.ValidationErrors;
}
```

{% endcode %}

## Examples

### In Scope Example Processes

| Selections       | Example 1                               | Example 2                               |
| ---------------- | --------------------------------------- | --------------------------------------- |
| Integration      | In Scope                                | In Scope                                |
| Language         | Swift                                   | Objective C                             |
| UI Toolkit       | Storyboard                              | Storyboard                              |
| Transaction Type | cc:sale                                 | cc:refund                               |
|                  | [View the Example](#in-scope-example-1) | [View the Example](#in-scope-example-2) |

#### In Scope Example 1

<table data-header-hidden><thead><tr><th width="180">Role</th><th>Capabilities</th></tr></thead><tbody><tr><td>Integration</td><td>In Scope</td></tr><tr><td>Language</td><td>Swift</td></tr><tr><td>UI Toolkit</td><td>Storyboard</td></tr><tr><td>Transaction</td><td>cc:sale</td></tr></tbody></table>

Example 1 sets `xCardNum` & `xExpDate` into the parameters object as those 2 are required by the `cc:sale` command. Therefor example 1 has the `Specify the additional parameters for the "cc:sale" transaction type:` sample code

```
prms.xCardNum = "4444333322221111";
2prms.xExpDate = "1225"; // MMYY
```

To submit a **cc:sale** request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software, if any
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
CardknoxSDK.setPrincipalKey("Your xKey value");
CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9")
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
override func viewDidAppear(_ animated: Bool) 
{
  super.viewDidAppear(animated)
  let cardknoxSDKDirect = CardknoxSDKDirect.create() as? CardknoxSDKDirect
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code overflow="wrap" lineNumbers="true" %}

```
cardknoxSDKDirect.destroy();
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
let prms = TransactionParameters();
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCommand = "cc:sale";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**\[VARIES]**</mark> <mark style="color:red;">**REQUIRED FOR IN SCOPE CC:SALE**</mark>

Specify the additional parameters for the **“cc:sale”** transaction type:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCardNum = "4444333322221111";
prms.xExpDate = "1225"; // MMYY
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = "123456";
prms.xBillFirstName = "Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
let request = cardknoxSDKDirect.createRequest(withParameters: prms) as! PaymentTransactionRequestDirect;
if(request.isValid)
{
  let respone = request.process() as! PaymentTransactionResponse
  
  if(response.isSuccess())
  {
    let refNum = respone.xRefNum();
    let status = respone.xStatus();
    let avs = respone.xAvsResult();
  }
  else
  {
    let refNum = response.xRefNum();
    let error = response.xError()!
    let errorCode = response.xErrorCode()!;
  }
}
else
{
  // Request could not be processed due to these errors
  let errors = request.validationErrors!
}
```

{% endcode %}

#### In Scope Example 2

| Integration      | In Scope    |
| ---------------- | ----------- |
| Language         | Objective C |
| UI Toolkit       | Storyboard  |
| Transaction Type | cc:refund   |

Example 2 sets the xRefNum value required by the `cc:refund` command. Therefor example 2 has `Specify the additional parameters for the "cc:refund" transaction type:`

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xRefNum = @"123456789";
```

{% endcode %}

To submit a **cc:sale** request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software, if any
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
[CardknoxSDK setPrincipalKey:@"Your xKey"];
[CardknoxSDK setxSoftwareName:@"Your app name" xSoftwareVersion:@"1.0.0" xVersion:@"4.5.9"];
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
- (void)viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];
  CardknoxSDKDirect* cardknoxSDKDirect = [CardknoxSDKDirect create];
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code overflow="wrap" lineNumbers="true" %}

```
[cardknoxSDKDirect destroy];
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
TransactionParameters *prms =[[TransactionParameters alloc] init];
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCommand = @"cc:refund";
prms.xAmount = 1.23;
```

{% endcode %}

<mark style="color:red;">**\[VARIES]**</mark> <mark style="color:red;">**REQUIRED FOR IN SCOPE CC:REFUND**</mark>

Specify the additional parameters for the **“cc:refund”** transaction type:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xRefNum = @"123456789";
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = @"123456";
prms.xBillFirstName = @"Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
PaymentTransactionRequestDirect *request = [cardknoxSDKDirect createRequestWithParameters:prms];

if([request IsValid])
{
  PaymentTransactionResponse * response = [request process];
 
  if(response.isSuccess)
  {
    NSString* refNum = response.xRefNum;
    NSString* status = response.xStatus;
    NSString* avs = response.xAvsResult; 
  }
  else
  {
    NSString* refNum = response.xRefNum;
    NSString* error = response.xError;
    NSString* errorCode = response.xErrorCode;
  } 
}
else
{
  // Request could not be processed due to these errors
  NSArray* errors = request.ValidationErrors;
}
```

{% endcode %}

### Out of Scope Example Processes

| Selections       | Example 1                                   | Example 2                                   |
| ---------------- | ------------------------------------------- | ------------------------------------------- |
| Integration      | Out of Scope                                | Out of Scope                                |
| Language         | Swift                                       | Objective C                                 |
| UI Toolkit       | Storyboard                                  | Storyboard                                  |
| Transaction Type | cc:sale                                     | cc:sale                                     |
|                  | [View the Example](#out-of-scopr-example-1) | [View the Example](#out-of-scope-example-2) |

#### Out of Scope Example 1

<table data-header-hidden><thead><tr><th width="180">Role</th><th>Capabilities</th></tr></thead><tbody><tr><td>Integration</td><td>Out of Scope</td></tr><tr><td>Language</td><td>Swift</td></tr><tr><td>UI Toolkit</td><td>Storyboard</td></tr><tr><td>Transaction</td><td>cc:sale</td></tr></tbody></table>

To submit a **cc:sale** request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software, if any
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
CardknoxSDK.setPrincipalKey("Your xKey value");
CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9")
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
override func viewDidAppear(_ animated: Bool) 
{
  super.viewDidAppear(animated)
  let cardknoxSDKUI = CardknoxSDKUI.create() as? CardknoxSDKUI
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code overflow="wrap" lineNumbers="true" %}

```
cardknoxSDKDirect.destroy();
```

{% endcode %}

Define a method to run when the SDK processes a transaction and sends the processing results back:

{% code overflow="wrap" lineNumbers="true" %}

```
@objc func transactionResultSubscription(aNotification: Notification)
{
    let response = PaymentTransactionResponse.unwrap(aNotification) as? PaymentTransactionResponse
    
    var message = ""
    if((response?.isSuccess()) != nil)
    {
        let refNum = (response?.xRefNum())! as String
        message = "Transaction success response! Ref num: " + refNum
    }
    else
    {
        let error = (response?.errorMessage())! as String
        message = "Transaction error response - " + error            
    }
}
```

{% endcode %}

Afterwards, subscribe the method to receive results back from the SDK:

{% code overflow="wrap" lineNumbers="true" %}

```
NotificationCenter.default.addObserver(self,
                                       selector: #selector(transactionResultSubscription(aNotification:)),
                                       name: Notification.Name( CardknoxSDK.transactionResultSubscription_NSNotificationCenterName()),
                                       object: nil)
```

{% endcode %}

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

{% code overflow="wrap" lineNumbers="true" %}

```
@objc func cardreaderEventSubscription(aNotification: Notification)
{
  let callback = CardknoxCardReaderCallback.unwrap(aNotification) as? CardknoxCardReaderCallback
  
  let code = callback?.code()
  let name = callback?.name()
  
  var errorMessage : String?;
  if(code == CardknoxCardReaderCallbackType.error()){
      errorMessage = callback?.message();
  }
}
```

{% endcode %}

Afterwards, subscribe the method to be notified about card reader events:

{% code overflow="wrap" lineNumbers="true" %}

```
NotificationCenter.default.addObserver(self,
                                       selector: #selector(cardreaderEventSubscription(aNotification:)),
                                       name: Notification.Name( CardknoxSDK.cardreaderEventSubscription_NSNotificationCenterName()),
                                       object: nil)
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
let prms = TransactionParameters();
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms?.xCommand = "cc:sale";
2prms?.xAmount = 1.23;
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms?.xInvoice = "123456";
prms?.xBillFirstName = "Billing first name";
// ... etc. 
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
// Define if a 'keyed' screen is available
CardknoxSDKUI.setEnableKeyedEntry(true);
// Define if a 'swipe' screen is available
CardknoxSDKUI.setEnableDeviceInsertSwipeTap(true);
// Define if the UI should auto close
CardknoxSDKUI.setCloseOnProcessedTransaction(true);

let request = cardknoxSDKUI.createRequest(withParameters: prms) as! PaymentTransactionRequestUI
if(request.isValid)
{
  // Show the Cardknox UI
  request.process()
}
else
{
  // Request could not be processed due to these errors
  let errors = request.validationErrors!
}
```

{% endcode %}

#### Out of Scope Example 2

| Integration      | Out of Scope |
| ---------------- | ------------ |
| Language         | Objective C  |
| UI Toolkit       | Storyboard   |
| Transaction Type | cc:sale      |

To submit a **cc:sale** request, first configure the SDK with:

* an xKey value obtained from Cardknox
* a software name value; a short name for your application
* a software version value; the current version of your software, if any
* a version value; the current Cardknox Gateway version 4.5.9

{% code overflow="wrap" lineNumbers="true" %}

```
[CardknoxSDK setPrincipalKey:@"Your xKey"];
[CardknoxSDK setxSoftwareName:@"Your app name" xSoftwareVersion:@"1.0.0" xVersion:@"4.5.9"];
```

{% endcode %}

Create a Cardknox SDK object. A good place is the “view appear” method. This object will be used to create “request” objects.

{% code overflow="wrap" lineNumbers="true" %}

```
- (void)viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];
  CardknoxSDKUI* cardknoxSDKUI = [CardknoxSDKUI create];
}
```

{% endcode %}

Destroy the Cardknox SDK object to free resources when SDK will no longer be used:

{% code overflow="wrap" lineNumbers="true" %}

```
[cardknoxSDKUI destroy];
```

{% endcode %}

Define a method to run when the SDK processes a transaction and sends the processing results back:

{% code overflow="wrap" lineNumbers="true" %}

```
-(void)transactionResultSubscription:(NSNotification*)aNotification
{
    PaymentTransactionResponse * response = [PaymentTransactionResponse unwrap:aNotification];
    
    NSString *message;
    if(response.isSuccess)
    {
        NSString * refNum = response.xRefNum;
        message = [NSString stringWithFormat:@"Transaction success response! Ref num: %@", refNum];
    }
    else
    {
        NSString * error = response.errorMessage;
        message = [NSString stringWithFormat:@"Transaction error response - %@", error];
    }
}
```

{% endcode %}

Afterwards, subscribe the method to receive results back from the SDK:

{% code overflow="wrap" lineNumbers="true" %}

```
[[NSNotificationCenter defaultCenter] addObserver:self
                       selector:@selector(transactionResultSubscription:)
                           name:[CardknoxSDK transactionResultSubscription_NSNotificationCenterName]
                         object:nil];
```

{% endcode %}

SDK works with a card reader to accept a card. Various card reader events can happen during processing. Define a method to run whenever a new card reader event happens:

{% code overflow="wrap" lineNumbers="true" %}

```
-(void)cardreaderEventSubscription:(NSNotification*)callbackNotification
{
    CardknoxCardReaderCallback* callback = [CardknoxCardReaderCallback unwrap:callbackNotification];
    
    int code = callback.code;
    NSString* name = callback.name;
    
    NSString* errorMessage;
    if(code == CardknoxCardReaderCallbackType.error){
        errorMessage = callback.message;
    }
}
```

{% endcode %}

Afterwards, subscribe the method to be notified about card reader events:

{% code overflow="wrap" lineNumbers="true" %}

```
NotificationCenter.default.addObserver(self,
                                       selector: #selector(cardreaderEventSubscription(aNotification:)),
                                       name: Notification.Name( CardknoxSDK.cardreaderEventSubscription_NSNotificationCenterName()),
                                       object: nil)
```

{% endcode %}

Next, create a transaction parameters object:

{% code overflow="wrap" lineNumbers="true" %}

```
TransactionParameters *prms = [[TransactionParameters alloc] init];
```

{% endcode %}

Specify the required parameters:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xCommand = @"cc:sale";
prms.xAmount = 1.23;
```

{% endcode %}

Specify optional parameters, if any:

{% code overflow="wrap" lineNumbers="true" %}

```
prms.xInvoice = @"123456";
prms.xBillFirstName = @"Billing first name";
// ... etc.
```

{% endcode %}

Create a request object, check if the request object is valid, initiate a transaction & process the response:

{% code overflow="wrap" lineNumbers="true" %}

```
// Define if a 'keyed' screen is available
CardknoxSDKUI.EnableKeyedEntry = true;
// Define if a 'swipe' screen is available
CardknoxSDKUI.EnableDeviceInsertSwipeTap = true;
// Define if the UI should auto close
CardknoxSDKUI.CloseSDKUIOnProcessedTransaction = true;

PaymentTransactionRequestUI *request = [cardknoxSDKUI createRequestWithParameters:prms];
if(request.IsValid)
{
  // Show the Cardknox UI
  [request process];
}
else
{
  // Request could not be processed due to these errors
  NSArray* errors = request.ValidationErrors;
}
```

{% endcode %}


# Android SDK

## Overview

Sola (Cardknox) Android SDK is a mobile SDK targeted towards Android developers, allowing developers to process transactions with the [Sola Transactions API](https://docs.solapayments.com/api/transaction).

{% hint style="info" %}
*Due to the necessity of the API key in this integration method, we strongly recommend reserving these features for integrations to be used solely on merchant-owned devices.*
{% endhint %}

## Getting started

To start, download the SDK framework file from the CDN:

* [Android SDK download](https://cdn.cardknox.com/sdk-android/versions.html)

Integrate the SDK file into your Android Studio project by referring to the [technical documentation](/sdk/android-sdk/android-sdk-technical-guide).

## Choose your integration path

The SDK offers developers a couple of ways to process transactions:

* In scope function
* Out of scope function
* Custom UI set of functions
* Payment Engine set of functions

### Out of scope

Use the out of scope function when the user needs to provide their credit card information. This function displays the SDK user interface, effectively giving the control over to the SDK to acquire the sensitive credit card data from the user. The user provides the sensitive information either via a form or via a credit card device, and then the SDK processes the transaction with the gateway.

### In scope

Use the in scope function when there is no need for the SDK to interact with the user through a user interface. The developer should either pass in a card number + an expiration date, or provide a tokenized card data via the xToken parameter to this function to quickly process the transaction and retrieve back the results.

### Custom UI

Custom-UI integration consists of a set of functions to control the card reader device via the SDK. Currently supported card reader device is a Bluetooth VP3300 card reader and USB connection. This integration path is useful when the developer has an existing UI and wishes to use a card reader device to obtain users' card sensitive information and then process the transaction with the gateway. The SDK offers a set of functions to control the card reader device. The SDK takes care of processing with the gateway and notifying the Developer’s application with the processing results.

### Payment Engine <a href="#payment-engine" id="payment-engine"></a>

The Payment Engine feature inside the SDK enables you to create transactions with a card reader over IP. The Payment Engine supports different card readers from Pax, Verifone, and Ingenico brands. See a full list of supported devices in the table below. The feature doesn't contain any UI. The developer provides device and transaction parameters to Payment Engine functions. The SDK takes care of communicating with the card reader and processing with the gateway. Finally, the SDK returns the device and transaction status and states.

| **Brand**                                  | **Model**            | **Suffix**                                | **Parameter value** |
| ------------------------------------------ | -------------------- | ----------------------------------------- | ------------------- |
| <p> </p><p> </p><p> </p><p> </p><p>Pax</p> | SP30                 | <p> </p><p> </p><p> </p><p> </p><p>.3</p> | Pax\_SP30.3         |
| S300                                       | Pax\_S300.3          |                                           |                     |
| S920                                       | Pax\_S920.3          |                                           |                     |
| A35                                        | Pax\_A35.3           |                                           |                     |
| A60                                        | Pax\_A60.3           |                                           |                     |
| A77                                        | Pax\_A773            |                                           |                     |
| A80                                        | Pax\_A80.3           |                                           |                     |
| A920                                       | Pax\_A920.3          |                                           |                     |
| PX5                                        | Pax\_PX5.3           |                                           |                     |
| PX7                                        | Pax\_PX7.3           |                                           |                     |
| D210                                       | Pax\_D210.3          |                                           |                     |
| D220                                       | Pax\_D22.3           |                                           |                     |
| Aries6                                     | Pax\_Aries6.3        |                                           |                     |
| Aries8                                     | Pax\_Aries8.3        |                                           |                     |
| <p> </p><p> </p><p> </p><p>Verifone</p>    | MX915                | <p> </p><p> </p><p> </p><p>.4</p>         | Verifone\_MX915.4   |
| MX925                                      | Verifone\_MX925.4    |                                           |                     |
| P200                                       | Verifone\_P200.4     |                                           |                     |
| P400                                       | Verifone\_P400.4     |                                           |                     |
| M400                                       | Verifone\_M400.4     |                                           |                     |
| E285                                       | Verifone\_E2854      |                                           |                     |
| <p> </p><p>Ingenico</p>                    | ICT250               | <p> </p><p>.2</p>                         | Ingenico\_ICT250.2  |
| Desk500                                    | Ingenico\_Desk5000.2 |                                           |                     |
| Move500                                    | Ingenico\_Move5000.2 |                                           |                     |

## Transaction workflows

Download our sample applications:

* [Java sample app](https://cdn.cardknox.com/sdk-android/versions.html)

### Basic parameters

| **Name**         | **Required** | **Description**                 | **Sample data** |
| ---------------- | ------------ | ------------------------------- | --------------- |
| xKey             | Yes          | Sola account key                | Sola            |
| xVersion         | Yes          | Gateway version                 | 4.5.9           |
| xSoftwareName    | Yes          | Name of your software           | My app          |
| xSoftwareVersion | Yes          | Version number of your software | 1.0.0           |

### Basic parameter functions

Prior to any processing, the Sola SDK needs to be configured with user’s metadata and the account key. These functions can be called anywhere in the application any number of times to change the metadata and/or current account key.

| **Function**              | **Description**                                                                                                                                                                                       | **Sample data**                                                             |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| setSoftwareConfigurations | Specifies the name of your software (xSoftwareName), version number of your software (xSoftwareVersion) and the gateway version (xVersion)                                                            | `CardknoxSDK.setSoftwareConfigurations("Your app name", "0.0.1", "4.5.9");` |
| setPrincipalKey           | <p>Accepts the xKey.</p><p>xKey is a Sola account key.</p><p>All transactions being processed after calling this function will be associated to the account that was passed in into the function.</p> | `CardknoxSDK.setPrincipalKey("ps_demo_cardknox");`                          |

### Transaction required parameters

Each integration path has a “process” function that accepts a “transaction parameters” object. Developers specify required values for transaction processing through that object. The same object can be used to specify optional; parameters to associate with a transaction, such as invoice numbers, billing address, etc.

| **Name** | **Description**       | **Sample data** |
| -------- | --------------------- | --------------- |
| xCommand | Sola transaction type | cc:sale         |

### Transaction optional parameters

Optional transaction parameters further complement the transaction processing. All the parameters are sent to the Gateway during processing.

| **Name**                     | **Description**                                                                                                                                                                                                                                                                                                                                                           | **Sample data**                                                                                                                                                          |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| VP3300TransactionTimeout     | <p>Start transaction timeout, in seconds.</p><p>Once the transaction with the VP3300 reader is started; the SDK times out if the card is not provided in the time frame specified by this timeout value.</p><p> </p><p>This parameter is only applicable for SDK integrations that use a VP3300 card reader; such as CustomUI or OutOfScope integrations.</p>             | Refer to the Custom UI flow or Out Of Scope flow for samples.                                                                                                            |
| xCardNum                     | Card number                                                                                                                                                                                                                                                                                                                                                               | 4444333322221111                                                                                                                                                         |
| xExpDate                     | <p>Card expiration date.</p><p><br>Expected format is MMYY where MM is a month, and YY are last 2 year digits</p>                                                                                                                                                                                                                                                         | <p>“1126” for (November 2026)</p><p>“0122” for “January 2022”</p>                                                                                                        |
| xToken                       | <p>From <a href="/pages/g1gMqjuhO4qESS2Yro3k">Transaction API:</a></p><p>The Cardknox token that references a previously used payment method. When using a token, <code>xCardNum</code>, <code>xExp</code> and <code>xMagstripe</code> should not be used.</p>                                                                                                            | 61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84                                                                                                                       |
| xRefNum                      | Used to reference a previous transaction when doing a follow-up transaction, typically a refund, void, or capture.                                                                                                                                                                                                                                                        | 12345678                                                                                                                                                                 |
| xInvoice                     | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling.                                                                                                                                                                                                                                                | The merchant’s invoice number for the transaction. xInvoice is recommended when available for improved duplicate handling.                                               |
| xPoNum                       | The merchant’s purchase order number for the transaction.                                                                                                                                                                                                                                                                                                                 | 123485                                                                                                                                                                   |
| xDescription                 | This is a description                                                                                                                                                                                                                                                                                                                                                     | This is a description                                                                                                                                                    |
| xName                        | The cardholder’s name.                                                                                                                                                                                                                                                                                                                                                    | John Doe                                                                                                                                                                 |
| xBillFirstName               | The customer’s first name for their billing profile.                                                                                                                                                                                                                                                                                                                      | John                                                                                                                                                                     |
| xBillLastName                | The customer’s last/family name for their billing profile.                                                                                                                                                                                                                                                                                                                | Doe                                                                                                                                                                      |
| xBillCompany                 | The customer’s company name for their billing profile.                                                                                                                                                                                                                                                                                                                    | Acme                                                                                                                                                                     |
| xBillStreet                  | The customer’s street address for their billing profile.                                                                                                                                                                                                                                                                                                                  | 123 Any Street                                                                                                                                                           |
| xBillStreet2                 | The customer’s second street address for their billing profile.                                                                                                                                                                                                                                                                                                           | 123 Any Street                                                                                                                                                           |
| xBillCity                    | The customer’s city for their billing profile.                                                                                                                                                                                                                                                                                                                            | Anytown                                                                                                                                                                  |
| xBillState                   | The customer’s state for their billing profile.                                                                                                                                                                                                                                                                                                                           | NY                                                                                                                                                                       |
| xBillZip                     | The customer’s zip code for their billing profile.                                                                                                                                                                                                                                                                                                                        | 12345                                                                                                                                                                    |
| xBillCountry                 | The customer’s phone number for their billing profile.                                                                                                                                                                                                                                                                                                                    | USA                                                                                                                                                                      |
| xBillPhone                   | The customer’s phone number for their billing profile.                                                                                                                                                                                                                                                                                                                    | 8005551212                                                                                                                                                               |
| xShipFirstName               | The customer’s last/family name for their shipping profile.                                                                                                                                                                                                                                                                                                               | John                                                                                                                                                                     |
| xShipLastName                | The customer’s last/family name for their shipping profile.                                                                                                                                                                                                                                                                                                               | Doe                                                                                                                                                                      |
| xShipCompany                 | The customer’s company name for their shipping profile.                                                                                                                                                                                                                                                                                                                   | Acme                                                                                                                                                                     |
| xShipStreet                  | The customer’s street address for their shipping profile.                                                                                                                                                                                                                                                                                                                 | 123 Any Street                                                                                                                                                           |
| xShipStreet2                 | The customer’s second street address for their shipping profile.                                                                                                                                                                                                                                                                                                          | 123 Any Street                                                                                                                                                           |
| xShipCity                    | The customer’s city for their shipping profile.                                                                                                                                                                                                                                                                                                                           | Anytown                                                                                                                                                                  |
| xShipState                   | The customer’s state for their shipping profile.                                                                                                                                                                                                                                                                                                                          | NY                                                                                                                                                                       |
| xShipZip                     | The customer’s zip code for their shipping profile.                                                                                                                                                                                                                                                                                                                       | 12345                                                                                                                                                                    |
| xShipCountry                 | The customer’s country for their shipping profile.                                                                                                                                                                                                                                                                                                                        | USA                                                                                                                                                                      |
| xShipPhone                   | The customer’s phone number for their shipping profile.                                                                                                                                                                                                                                                                                                                   | 1113333444                                                                                                                                                               |
| xCustom01                    | Custom field 1. Use this for any additional data                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                          |
| xCustom02                    | Custom field 2. Use this for any additional data                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                          |
| xCustom03                    | Custom field 3. Use this for any additional data                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                          |
| xAuthCode                    | xAuthCode is a verification number provided by the issuing bank to be used with the cc:postauth command.                                                                                                                                                                                                                                                                  |                                                                                                                                                                          |
| xAllowDuplicate              | By default, Cardknox rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                                                                                                                                                                                             | False                                                                                                                                                                    |
| xCustReceipt                 | True/False value indicating if the email address specified in xEmail should receive a receipt containing the transaction details.                                                                                                                                                                                                                                         | False                                                                                                                                                                    |
| xEmail                       | The customer’s email address.                                                                                                                                                                                                                                                                                                                                             | <test@example.com>                                                                                                                                                       |
| Device\_name                 | PE device name                                                                                                                                                                                                                                                                                                                                                            | <p>Verifone\_P400.4</p><p>(The 4. column in Payment engine support device table)</p>                                                                                     |
| Device\_IP\_Address          | IP address of PE device                                                                                                                                                                                                                                                                                                                                                   | 172.21.2.7                                                                                                                                                               |
| Device\_Port                 | Port of PE device                                                                                                                                                                                                                                                                                                                                                         | 9006                                                                                                                                                                     |
| Device\_Timeout              | Timeout for PE device connecting                                                                                                                                                                                                                                                                                                                                          | 120                                                                                                                                                                      |
| VP3300StartTransactionMethod | <p>The card reader can scan a card in a few different ways: swipe, tap, or insert a card. This property defines how the card reader expects the card to be scanned.</p><p>See <a href="https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Custom-UI-with-USB">SetVP3300StartTransactionMethod in Custom UI with USB section</a>.</p> | <p></p><p>Possible values:</p><ul><li>CTLS - tap a card (NFC)</li><li>EMV - insert card</li><li>MSR - swipe card</li><li>DEVICE - swipe, insert and tap a card</li></ul> |
| EnableTipPrompt              | Prompts the user on the device to add a tip to the transaction. This functionality is only available when the device is enabled. The response to the transaction will include two parameters: "xTip" (the tip amount) and "xAuthAmount" (the final authorized amount on the card, including the tip amount).                                                              | Available in the Payment Engine integration.                                                                                                                             |

### Retrieving results with callbacks <a href="#retrieving-results-with-callbacks" id="retrieving-results-with-callbacks"></a>

The SDK can notify the application about various events during processing, such as about different card reader events during out of scope processing, or perhaps about a completed bluetooth device scan during custom UI processing.

Developers opt in to receive callbacks by registering BroadcastReceivers with IntentFilters, using a predefined value from the SDK for the “action” parameter.

The SDK uses the same “action” value to report results & various information back to subscribers.

Available callback types and integrations where they are applicable in are as follows:

| **Callback type**             | **Description**                                                                                                                                                                                                                                                                                                                                                    | **Available in integration**                          |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
| Transaction result            | The SDK processes a payment with the Gateway and delivers an object containing all processed transaction details.                                                                                                                                                                                                                                                  | <p>Out of scope</p><p>Custom UI<br>Payment Engine</p> |
| Card reader event             | The SDK keeps informing the subscribers about various events taking place between the application and the card reader device; such as “connected”, “disconnected”, “transaction started”, “on bluetooth disabled error”, etc.                                                                                                                                      | <p>Out of scope</p><p>Custom UI</p>                   |
| Scanned bluetooth device      | <p>Trigger a bluetooth device scanning process with the “start scanning” function.</p><p><br>During the scanning process, the SDK keeps informing subscribers with objects that encapsulate all the information about each newly discovered Bluetooth device.<br></p><p>The SDK expects one of the objects as an argument in the “connect to device” function.</p> | Custom UI                                             |
| Scan completed                | <p>Trigger a bluetooth device scanning process with the “start scanning” function.<br></p><p>Stop the process with a “stop scanning” function.<br></p><p>Once the scanning process is stopped, the SDK reports back a list of all scanned bluetooth devices.<br></p><p>The SDK expects one of the objects as an argument in the “connect to device” function.</p>  | Custom UI                                             |
| Device status                 | <p>The SDK is sending information to subscribers about the device initialization process and the actions that the device expects from the user of the card scanner. </p><p>For example, waiting for the insert or swipe of a credit card.</p>                                                                                                                      | Payment Engine                                        |
| Transaction status            | The transaction status sends information about the card scanning process.                                                                                                                                                                                                                                                                                          | Payment Engine                                        |
| Result as JSON                | The result of created transaction return in JSON format.                                                                                                                                                                                                                                                                                                           | Payment Engine                                        |
| Payment engine LogCat logging | The payment engine supports two types of event logging. One prints logs directly to the LogCat console, while the other delivers logs via callbacks, allowing the app to handle them programmatically.                                                                                                                                                             | Payment Engine                                        |

### Callback subscriptions & result handling

Based on your integration path choice, choose an available callback type for that integration path and register a BroadcastReceiver to receive appropriate information back from the SDK.

#### Transaction result callback subscription

This callback delivers a “transaction processed response” object to the subscriber.

Subscription can be made in the appropriate Fragment lifecycle method:

{% code lineNumbers="true" %}

```javascript
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxSDK;
import cardknox.payments.sdk.PaymentTransactionResponse;

public class TransactionResultExampleFragment extends Fragment {

    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        RegisterIntentFilters();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        UnregisterIntentFilters();
    }

    private void RegisterIntentFilters()
    {
        Context c = getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_TransactionProcessing, new IntentFilter(CardknoxSDK.TRANSACTION_CALLBACK_INTENTFILTER_ACTION()));
        }
    }

    private void UnregisterIntentFilters()
    {
        Context c = this.getContext();

        if(c != null)
        {
            c.unregisterReceiver(Receiver_TransactionProcessing);
        }
    }

    private final BroadcastReceiver Receiver_TransactionProcessing = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent)
        {
            String action = intent.getAction();

            // Verify that the Cardknox SDK broadcasted the Intent
            if(action.equals(CardknoxSDK.TRANSACTION_CALLBACK_INTENTFILTER_ACTION()))
            {
                String extraKey = CardknoxSDK.TRANSACTION_CALLBACK_INTENTFILTER_EXTRA();
                java.lang.Object extra = intent.getParcelableExtra(extraKey);

                // Cast the 'extra' to the Cardknox SDK response type
                PaymentTransactionResponse response = (PaymentTransactionResponse)extra;

                if(response.GetIsSuccess())
                {
                    // Transaction successfully processed
                    String xRefNum = response.GetxRefNum();
                    // approved, declined, ...
                    String xStatus = response.GetxStatus();
                    String cvv = response.GetxCvvResult();
                    String avs = response.GetxAvsResult();
                    // ... other properties ...

                    Output("Transaction approved. Ref num: " + xRefNum);
                }
                else
                {
                    // Transaction processing resulted in an error; message can be extracted from this property:
                    String errorMessage = response.GetErrorMessage();
                    String errorCode = response.GetxErrorCode();
                    String error = response.GetxError();

                    Output("Transaction declined/errored. Ref num: " + response.GetxRefNum());
                }
            }
        }
    };

    private void Output(String text)
    {
        android.util.Log.d("ExampleTag", text);
    }
}
```

{% endcode %}

#### Card reader event callback subscription

This callback delivers information about various events happening between the application & the card reader.

For example, while out-of-scope processing the SDK can report back error events related to bluetooth device pairing, such as “bluetooth not turned on” to indicate that the mobile device wanted to use the bluetooth service to find a nearby card reader device but the service is unavailable, or an error such as “waiting for device bluetooth response” to indicate that the mobile device found an eligible bluetooth card reader device and is expecting the card reader to respond back with bluetooth data. This could mean that the bluetooth button on the card reader needs to be pressed.

After a bluetooth pairing is established, the SDK reports back events related to obtaining the card data via the card reader. For example, a “connected” event means that the mobile device & the card reader are connected and a card data transaction can start. A “transaction started” event means that the SDK initiated a card data transaction with the card reader and the physical card can be tapped onto the card reader.

Subscription can be made in the appropriate Fragment lifecycle method:

{% code lineNumbers="true" %}

```javascript
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxCardReaderCallback;
import cardknox.payments.sdk.CardknoxCardReaderCallbackType;
import cardknox.payments.sdk.CardknoxSDK;

public class CardReaderEventsExampleFragment extends Fragment {
    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        RegisterIntentFilters();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        UnregisterIntentFilters();
    }

    private void RegisterIntentFilters()
    {
        Context c = getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_CardReaderEvents, new IntentFilter(CardknoxSDK.CARDREADER_CALLBACK_INTENTFILTER_ACTION()));
        }
    }

    private void UnregisterIntentFilters()
    {
        Context c = this.getContext();

        if(c != null)
        {
            c.unregisterReceiver(Receiver_CardReaderEvents);
        }
    }

    private final BroadcastReceiver Receiver_CardReaderEvents = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent)
        {
            String action = intent.getAction();

            // Verify that the Cardknox SDK broadcasted the Intent
            if(action.equals(CardknoxSDK.CARDREADER_CALLBACK_INTENTFILTER_ACTION()))
            {
                String extraKey = CardknoxSDK.CARDREADER_CALLBACK_INTENTFILTER_EXTRA();
                CardknoxCardReaderCallback callback = intent.getParcelableExtra(extraKey);

                // Read the event code
                int code = callback.GetCode();

                // Read the event name
                String name = callback.GetName();

                Output("Card reader event: " + name);

                // Match the non-error code; for example "connected"
                if(code == CardknoxCardReaderCallbackType.CONNECTED){
                    Output("Connected!");
                }

                // Extract the message when there's an error
                if(code == CardknoxCardReaderCallbackType.ERROR){
                    String message = callback.GetMessage();
                    Output("Card reader event: " + message);
                }
            }
        }
    };

    private void Output(String text)
    {
        android.util.Log.d("ExampleTag", text);
    }
}
```

{% endcode %}

#### Card reader events

When a card reader event happens, the SDK delivers an object, of a type named similarly to “`CardknoxCardReaderCallback`”, back into the app.

The object encapsulates two things:

* an event integer code
* an event name; such as “connected”, “disconnected”, etc.

Event integer codes are enumerated in a type named similarly to "`CardknoxCardReaderCallbackType`".

Developers can match the received integer code value with the enumeration of interest to pinpoint a wanted event.

| **Event name**                          | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| connecting                              | <p>The Cardknox SDK calls into the card reader SDK to connect with the reader, in scenarios such as:</p><ul><li>“connect to device” method in the “custom ui” integration</li><li>when it presents its own UI in “process out of scope” integration</li></ul><p>The card reader SDK starts searching for nearby IDTech card readers & notifies the Cardknox SDK with a “connecting” event.<br></p><p>The Cardknox SDK raises a “connecting” callback which notifies the app.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| waitingForDeviceResponse                | <p>This event is raised whenever the Cardknox SDK scans for nearby card readers. Awake readers are usually auto connected straight away.<br></p><p>Asleep or not, this event is always raised from the SDK to indicate that some action is required on the device.<br></p><p>This event is raised in the “custom ui” integration when:</p><ul><li>a developer calls the “start scanning” method and the underlying bluetooth adapter starts scanning</li><li>or when a Developer calls the “connect to device” method. Sola SDK will call the card reader SDK to “connect” and raise this event</li></ul><p>This event is raised in the “process out of scope” integration when:</p><ul><li>the Cardknox SDK presents its user interface; automatically starting a bluetooth scan for a nearby card reader, expecting a response back</li></ul>                                                                                                                          |
| connected                               | <p>Raised when the app & the card reader establish a bluetooth connection.</p><p>Bluetooth connection is established when the Cardknox SDK scans for card readers, and card readers respond back with some bluetooth payload.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| disconnected                            | <p>Card reader SDK sends this event to the Cardknox SDK whenever a bluetooth card reader goes to sleep.<br></p><p>This event is never raised explicitly by the Cardknox SDK.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| transactionStarting                     | <p>Informational event.<br></p><p>Cardknox SDK raises this event before it places a call to the underlying card reader SDK in order to start a transaction with the card reader.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| transactionStarted                      | <p>Cardknox SDK attempts a “start transaction” call with the card reader SDK.<br></p><p>Card reader SDK successfully starts the transaction and notifies the Cardknox SDK with this event.<br></p><p>Cardknox SDK calls back with this event to the app.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| transactionStartErrorTimeout            | <p>Cardknox SDK attempts a “start transaction” call with the card reader SDK.</p><p><br>The card reader never receives a card in a specified timeout frame window (about 20 seconds) and the transaction times out.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| transactionStartDeviceDisconnected      | Cardknox SDK wants to start the transaction with a disconnected device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| transactionCancelled                    | <p>Generally, this is raised whenever an error occurs at any point between starting a transaction with the reader and obtaining the card data.<br></p><p>See the “error” event for error examples.<br></p><p>The Cardknox SDK in cases of these errors preventively calls the “cancel any pending transactions” internally to clean up.</p><p>Specifically, this event is raised in the “custom ui” integration when:</p><ul><li>a “cancel transaction” method is called & the card reader SDK cancels all pending transactions between the app & the card reader</li></ul><p>Furthermore, this event is raised in the “process out of scope” integration when:</p><ul><li>the Cardknox SDK’s user interface is closed; either via a pull down gesture or via a “close” UI element; to clean things up</li><li>the charge amount gets modified via UI and becomes invalid, effectively invalidating any pending transactions between the app & the card reader</li></ul> |
| scanStop                                | <p>Indicates that the Cardknox SDK stopped its own bluetooth scanning.</p><p>Raised in the “custom ui” integration when:</p><ul><li>a Developer explicitly calls the “stop scanning” method</li><li>when the “start scanning” method was called with a timeout value and the timeout expired or was cancelled / interrupted</li><li>in the “disconnect from current device” call if the “connect to device” method was called beforehand but there is no connected device to disconnect from</li></ul><p>Raised in the “process out of scope” integration when:</p><ul><li>the SDK shows its' UI and automatically starts scanning for nearby readers. User can explicitly stop the scanning process</li></ul>                                                                                                                                                                                                                                                           |
| scanStart                               | <p>Indicates that the Cardknox SDK started a bluetooth scanning process.</p><p>Raised in the “custom ui” integration when:</p><ul><li>the “start scanning” method was called, with or without a timeout value</li></ul><p>Raised in the “process out of scope” integration when:</p><ul><li>the SDK shows its' UI and automatically starts scanning for nearby readers</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| error                                   | <p>This is raised whenever an error occurs at any point between starting a transaction with the reader and obtaining the card data.</p><p>Things that could go wrong (list is not exhaustive) are:</p><ul><li>transaction with the card reader failed to start</li><li>emv card readings are corrupted</li><li>transaction started but the card was not tapped / swiped / inserted in time</li></ul><p>A descriptive error message is always accompanying this event.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| swipe says use chip reader              | This card reader event is raised when the card with a chip is swiped, to indicate that a “fallback Swipe” was blocked. Reach out to Sola support to consult about “fallback Swipe”.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| card inserted when ctls swipe requested | in some scenarios, the VP3300 will expect a Swipe, but will receive a card Insert. In such cases this event is raised.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| contactless in msr card read event      | this event is raised when a Contactless MSD transaction is performed on a VP3300 device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| USB detached                            | <p>This event occurs when the USB cable is unplugged, causing the connection between the mobile device and the card reader to be interrupted. As a result, any ongoing communication or data transfer between the two devices is immediately stopped.</p><p> </p><p>Note: Only available for <a href="https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Custom-UI-with-USB">Custom UI with USB integration</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| USB device not found                    | <p>This is raised when you try to connect to the card reader that's not plugged in with a USB cable.</p><p> </p><p>Note: Only available for <a href="https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Custom-UI-with-USB">Custom UI with USB integration</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| USB unsupported product                 | <p>This means that the connected USB device is not supported by the system or the driver.</p><p> </p><p>Note: Only available for <a href="https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Custom-UI-with-USB">Custom UI with USB integration</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| USB permission not granted              | <p>This error occurs when the application does not have the necessary permission to access the connected USB device. The user must explicitly grant permission for the device to be recognized and used.</p><p> </p><p>Note: Only available for <a href="https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Custom-UI-with-USB">Custom UI with USB integration</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

#### Scanned bluetooth device callback subscription

One of the Custom UI integration functions is a “start scanning” function. The function keeps scanning for nearby bluetooth devices until it is manually stopped with the “stop scanning” function or if it times out.

During the scanning process, for every scanned device the SDK sends a “scanned device” object that contains all the necessary metadata about the scanned device, such as the devices' display name or its internal name.

Subscription can be made in the appropriate Fragment lifecycle method:

{% code lineNumbers="true" %}

```javascript
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxSDKCustomUI;
import cardknox.payments.sdk.CardknoxSDKCustomUIScannedDevice;

public class ScannedDeviceExampleFragment extends Fragment {
    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        RegisterIntentFilters();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        UnregisterIntentFilters();
    }

    private void RegisterIntentFilters()
    {
        Context c = getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_ScannedDevice, new IntentFilter(CardknoxSDKCustomUI.SCANNED_DEVICE_INTENTFILTER_ACTION()));
        }
    }

    private void UnregisterIntentFilters()
    {
        Context c = this.getContext();

        if(c != null)
        {
            c.unregisterReceiver(Receiver_ScannedDevice);
        }
    }

    private final BroadcastReceiver Receiver_ScannedDevice = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent)
        {
            String action = intent.getAction();

            // Verify that the Cardknox SDK broadcasted the Intent
            if(action.equals(CardknoxSDKCustomUI.SCANNED_DEVICE_INTENTFILTER_ACTION()))
            {
                String extraKey = CardknoxSDKCustomUI.SCANNED_DEVICE_INTENTFILTER_EXTRA();
                java.lang.Object extra = intent.getParcelableExtra(extraKey);

                CardknoxSDKCustomUIScannedDevice device = (CardknoxSDKCustomUIScannedDevice) extra;
                // Can be used with a 'connect' method, like so:
                String address = device.GetAddress();
                CardknoxSDKCustomUI example = null;
                example.connectWithAddress(address);
                
                // Output various data about the device
                Output("Scanned device name: " + device.GetName());
                Output("Scanned device display name: " + device.GetDisplayName());
                Output("Scanned device address: " + device.GetAddress());
            }
        }
    };

    private void Output(String text)
    {
        android.util.Log.d("ExampleTag", text);
    }
}
```

{% endcode %}

#### Scan completed callback subscription

One of the Custom UI integration functions is a “start scanning” function. The function keeps scanning for nearby bluetooth devices until it is manually stopped with the “stop scanning” function or if it times out.

Once the scanning process ends, the SDK sends a list of scanned device objects to all subscribers. Any object in the retrieved list can be used as an argument to the “connect to device” method.

Subscription can be made in the appropriate Fragment lifecycle method:

{% code lineNumbers="true" %}

```javascript
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxSDKCustomUI;
import cardknox.payments.sdk.CardknoxSDKCustomUIScanCompleted;
import cardknox.payments.sdk.CardknoxSDKCustomUIScannedDevice;

public class ScanCompletedExampleFragment extends Fragment {
    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        RegisterIntentFilters();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        UnregisterIntentFilters();
    }

    private void RegisterIntentFilters()
    {
        Context c = getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_ScanCompleted, new IntentFilter(CardknoxSDKCustomUI.SCAN_COMPLETED_INTENTFILTER_ACTION()));
        }
    }

    private void UnregisterIntentFilters()
    {
        Context c = this.getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_ScanCompleted, new IntentFilter(CardknoxSDKCustomUI.SCAN_COMPLETED_INTENTFILTER_ACTION()));
        }
    }

    private final BroadcastReceiver Receiver_ScanCompleted = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent)
        {
            String action = intent.getAction();

            // Verify that the Cardknox SDK broadcasted the Intent
            if(action.equals(CardknoxSDKCustomUI.SCAN_COMPLETED_INTENTFILTER_ACTION()))
            {
                String extraKey = CardknoxSDKCustomUI.SCAN_COMPLETED_INTENTFILTER_EXTRA();
                java.lang.Object extra = intent.getParcelableExtra(extraKey);
                CardknoxSDKCustomUIScanCompleted scanCompleted = (CardknoxSDKCustomUIScanCompleted) extra;

                if(scanCompleted != null && scanCompleted.scannedDevices() != null &&
                        scanCompleted.scannedDevices().size() > 0)
                {
                    for (Object device : scanCompleted.scannedDevices()) {
                        CardknoxSDKCustomUIScannedDevice device = (CardknoxSDKCustomUIScannedDevice)d;

                        // Can be used with a 'connect' method, like so:
                        String address = device.GetAddress();
                        CardknoxSDKCustomUI example = null;
                        example.connectWithAddress(address);

                        // Output various data about the device
                        Output("Scanned device name: " + device.GetName());
                        Output("Scanned device display name: " + device.GetDisplayName());
                        Output("Scanned device address: " + device.GetAddress());
                    }
                }
            }
        }
    };

    private void Output(String text)
    {
        android.util.Log.d("ExampleTag", text);
    }
}
```

{% endcode %}

#### Device status callback subscription

This callback provides information about the status of the card reader. It sends information about the initialization process of the device, the connection process of the card reader, and the mobile device. It also sends notifications about the actions expected by the user of the credit card.

```java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxPaymentEngineSDK;

public class DeviceStatusExampleFragment extends Fragment {

    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        RegisterIntentFilters();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        UnregisterIntentFilters();
    }

    private void RegisterIntentFilters()
    {
        Context c = getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_DeviceStatus, new IntentFilter(CardknoxPaymentEngineSDK.DEVICE_STATUS_INTENTFILTER_ACTION()));
        }
    }

    private void UnregisterIntentFilters()
    {
        Context c = this.getContext();

        if(c != null)
        {
            c.unregisterReceiver(Receiver_DeviceStatus);
        }
    }

    private final BroadcastReceiver Receiver_DeviceStatus = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();

            // Verify that the Cardknox SDK broadcasted the event
            if(action.equals(CardknoxPaymentEngineSDK.DEVICE_STATUS_INTENTFILTER_ACTION()))
            {
                String extraKey = CardknoxPaymentEngineSDK.DEVICE_STATUS_INTENTFILTER_EXTRA();
                String deviceStatus = intent.getStringExtra(extraKey);
                Output(deviceStatus);
            }
        }
    };

    private void Output(String text)
    {
        android.util.Log.d("ExampleTag", text);
    }
}
```

#### Transaction status callback subscription <a href="#transaction-status-callback-subscription" id="transaction-status-callback-subscription"></a>

The transaction status callback sends information about the card scanning process. This callback starts triggering when the user inserts or swipes the credit card and ends with the result of card scanning.

```java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxPaymentEngineSDK;

public class TransactionStatusExampleFragment extends Fragment {

    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        RegisterIntentFilters();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        UnregisterIntentFilters();
    }

    private void RegisterIntentFilters()
    {
        Context c = getContext();

        if(c != null)
        {
            c.registerReceiver(Receiver_TransactionStatus, new IntentFilter(CardknoxPaymentEngineSDK.TRANSACTION_STATUS_INTENTFILTER_ACTION));
        }
    }

    private void UnregisterIntentFilters()
    {
        Context c = this.getContext();

        if(c != null)
        {
            c.unregisterReceiver(Receiver_TransactionStatus);
        }
    }

    private final BroadcastReceiver Receiver_TransactionStatus = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();

            // Verify that the Cardknox SDK broadcasted the event
            if(action.equals(CardknoxPaymentEngineSDK.TRANSACTION_STATUS_INTENTFILTER_ACTION()))
            {
                String extraKey = CardknoxPaymentEngineSDK.TRANSACTION_STATUS_INTENTFILTER_EXTRA();
                String deviceStatus = intent.getStringExtra(extraKey);
                Output(deviceStatus);
            }
        }
    };

    private void Output(String text)
    {
        android.util.Log.d("ExampleTag", text);
    }
}
```

#### Result as JSON callback subscription <a href="#result-as-json-callback-subscription" id="result-as-json-callback-subscription"></a>

The callback for a basic processed transaction response returns information about the transaction as an object with properties. Each property of the object corresponds to a specific piece of transaction data. However, the payment engine has an additional callback for the transaction result, which is returned as JSON. In this callback, instead of returning the transaction as an object, the processed transaction is provided as a text representation of a JSON object.

To receive the transaction response as JSON using this callback, you must call the `SetSendResponseAsJSON(true)` method on `CardknoxPaymentEngineSDK`object . Otherwise, the transaction result will return the response as an object. The transaction response can only be received through a single callback at any given time. This means that only one callback handler is allowed to process the response for a specific transaction, ensuring consistency and avoiding potential conflicts or duplicate processing.

```java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxPaymentEngineSDK;
import cardknox.payments.sdk.CardknoxPaymentEngineSDKRequest;
import cardknox.payments.sdk.CardknoxPaymentEngineSDKResponseJSON;
import cardknox.payments.sdk.CardknoxPaymentEngineSDKSettings;
import cardknox.payments.sdk.CardknoxSDK;

public class PaymentEngineExampleFragment extends Fragment {

    private void SetupReceivePaymentEngineResponseAsJSON(){
        Context applicationContext = null;
        CardknoxSDK.create().getPaymentEngine().SetSendResponseaAsJSON(true);
        try { applicationContext.unregisterReceiver(Result_PaymentEngineResponseAsJSON);} catch(Exception e) {}
        applicationContext.registerReceiver(Result_PaymentEngineResponseAsJSON, new IntentFilter(CardknoxPaymentEngineSDK.PAYMENTENGINE_JSON_INTENTFILTER_ACTION()));
    }

    private final BroadcastReceiver Result_PaymentEngineResponseAsJSON = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {

            String action = intent.getAction();
            // Verify that the Cardknox SDK broadcasted the Intent
            if (action != null && action.equals(CardknoxPaymentEngineSDK.PAYMENTENGINE_JSON_INTENTFILTER_ACTION())) {

                String extraKey = CardknoxPaymentEngineSDK.PAYMENTENGINE_JSON_INTENTFILTER_EXTRA();
                java.lang.Object extra = intent.getParcelableExtra(extraKey);
                // Cast
                CardknoxPaymentEngineSDKResponseJSON response = (CardknoxPaymentEngineSDKResponseJSON) extra;
                String json = response.GetJSON();
            }
        }
    };

    private void SetupPaymentEngineBroadcastsLogCatMessages(){
        Context context = null;
        CardknoxPaymentEngineSDK paymentEngine = CardknoxSDK.create().getPaymentEngine();
        // PaymentEngine logging, 2 options:
        // 1. SDK writes the PE log to LogCat directly
        // 2. SDK sends the PE log it wants to write to this app (via BroadcastReceiver)
        // Note: calling 1 method negates the other one
        boolean broadcast = false;
        boolean writeDirectly = true;
        if(broadcast && writeDirectly)
            throw new RuntimeException("PE logs can either be directly written to LogCat or broadcasted back to this app, not both");

        if(writeDirectly){
            paymentEngine.enableLogCatOutput("LogCatTag");
        }
        else if(broadcast){
            paymentEngine.enableLogCatBroadcasts(true);
            // subscribe to logcat broadcasts
            try { context.unregisterReceiver(Receiver_LogcatMessages);} catch(Exception e) {}
            context.registerReceiver(Receiver_LogcatMessages, new IntentFilter(CardknoxPaymentEngineSDK.LOGGER_INTENTFILTER_ACTION()));
        }
    }

    private final BroadcastReceiver Receiver_LogcatMessages = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if(intent != null) {
                String action = intent.getAction();
                if (action != null && action.equals(CardknoxPaymentEngineSDK.LOGGER_INTENTFILTER_ACTION())) {
                    String logcatMessage = "unknown";

                    String extraKey= CardknoxPaymentEngineSDK.LOGGER_INTENTFILTER_EXTRA();
                    if(intent.hasExtra(extraKey))
                        logcatMessage = intent.getStringExtra(extraKey);

                    android.util.Log.d("SomeTag", logcatMessage);
                }
            }
        }
    };


    private void Device_ReprintReceipt_Example(){
        CardknoxPaymentEngineSDKSettings settings = new CardknoxPaymentEngineSDKSettings();
        settings.SetDevice_IP_Address("specify IP");
        settings.SetDevice_IP_Port("specify port");
        settings.SetDevice_Name("specify device name, such as PAX_A77.3");
        settings.SetDevice_Timeout(5 * 1000); /* milliseconds to seconds */

        CardknoxPaymentEngineSDKRequest request = new CardknoxPaymentEngineSDKRequest();
        request.SetxAuthCode("add auth code here");

        String response = CardknoxSDK.create().getPaymentEngine().Device_ReprintReceipt(settings, request);
        boolean success = response.equals("OK");
    }

} 
```

#### Payment engine LogCat logging callback subscription <a href="#payment-engine-logcat-logging-callback-subscription" id="payment-engine-logcat-logging-callback-subscription"></a>

LogCat callback logging is a feature that allows the payment engine to send log messages directly to the application through callbacks. When enabled—by setting the `EnableLogcatBroadcasts` property to true—the app receives log events programmatically instead of relying only on the standard LogCat console output.

This method gives developers more control over how logs are used. Logs can be captured, filtered, stored, or forwarded to external monitoring systems, making it especially useful in production environments where console access is limited. It also enables building custom logging tools within the app for advanced debugging and diagnostics.

```java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import androidx.fragment.app.Fragment;

import cardknox.payments.sdk.CardknoxPaymentEngineSDK;
import cardknox.payments.sdk.CardknoxPaymentEngineSDKRequest;
import cardknox.payments.sdk.CardknoxPaymentEngineSDKResponseJSON;
import cardknox.payments.sdk.CardknoxPaymentEngineSDKSettings;
import cardknox.payments.sdk.CardknoxSDK;

public class PaymentEngineExampleFragment extends Fragment {

    private void SetupPaymentEngineBroadcastsLogCatMessages(){
        Context context = null;
        CardknoxPaymentEngineSDK paymentEngine = CardknoxSDK.create().getPaymentEngine();
        // PaymentEngine logging, 2 options:
        // 1. SDK writes the PE log to LogCat directly
        // 2. SDK sends the PE log it wants to write to this app (via BroadcastReceiver)
        // Note: calling 1 method negates the other one
        boolean broadcast = false;
        boolean writeDirectly = true;
        if(broadcast && writeDirectly)
            throw new RuntimeException("PE logs can either be directly written to LogCat or broadcasted back to this app, not both");

        if(writeDirectly){
            paymentEngine.enableLogCatOutput("LogCatTag");
        }
        else if(broadcast){
            paymentEngine.enableLogCatBroadcasts(true);
            // subscribe to logcat broadcasts
            try { context.unregisterReceiver(Receiver_LogcatMessages);} catch(Exception e) {}
            context.registerReceiver(Receiver_LogcatMessages, new IntentFilter(CardknoxPaymentEngineSDK.LOGGER_INTENTFILTER_ACTION()));
        }
    }

    private final BroadcastReceiver Receiver_LogcatMessages = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if(intent != null) {
                String action = intent.getAction();
                if (action != null && action.equals(CardknoxPaymentEngineSDK.LOGGER_INTENTFILTER_ACTION())) {
                    String logcatMessage = "unknown";

                    String extraKey= CardknoxPaymentEngineSDK.LOGGER_INTENTFILTER_EXTRA();
                    if(intent.hasExtra(extraKey))
                        logcatMessage = intent.getStringExtra(extraKey);

                    android.util.Log.d("SomeTag", logcatMessage);
                }
            }
        }
    };
}
```

### Out of scope integration

Out of scope processing feature allows the developer to show the Cardknox user interface for payment processing.

To show the user interface, create a request object that is capable of showing a user interface:

```javascript
// Create the parameters object
TransactionParameters parameters = new TransactionParameters()
{
    {
        // Required parameters
        // 1. command to use. One of the Cardknox Transaction API commands
        SetxCommand("cc:sale");
        // 2. amount
        SetxAmount(1.23);

        // Supplementary parameters
        // 1. card number - will be prefilled on the keyed form
        SetxCardNum("4444333322221111");

        // 2. expiration date - will be prefilled on the keyed form
        // Format "MMYY"
        // For example: December 2024
        SetxExp("1224");

        // Optional parameters to supplement the transaction
        // All of the available parameters will be sent to the gateway
        SetxInvoice("1234");
        SetxBillCity("New York");
        // ... other optional parameters.
    }
};

PaymentTransactionRequestUI request = cardknoxSDKUI.createRequestWithParameters(parameters);
```

Check if the request object is in a valid state. If it is, call the method to show the UI. Otherwise, inspect the validation errors to see what is incorrect in the request object:

```javascript
PaymentTransactionRequestUI request = cardknoxSDKUI.createRequestWithParameters(parameters);

if(request.GetIsValid()){
    // Supply the Activity reference here.
    // In fragments, that might be a 'getActivity()' call.
    android.app.Activity activity = null;
    
    // Show Cardknox SDK UI
    request.process(activity);
} else {
    // Extract all validation errors that block
    // the request object from showing the SDK UI
    String[] validationErrors = request.GetValidationErrors();
}
```

#### Available user interfaces

The SDK’s user interface consists of two fullscreen parts - a manual entry screen and a card reader screen. Manual entry screen is also abbreviated as a “keyed” screen. The card reader screen is also abbreviated as a “swipe” screen.

Showing the SDK user interface via a Request object will either show one of the screens, or both. Which screen will be visible depends on the global SDK configuration state prior to showing the SDK user interface via a Request object.

Note that if the SDK is configured to allow access to both processing screens, one of them will be shown by default and both of them will have some kind of a visual way to navigate to the other one.

The following table shows available functions to control which screen will be visible & accessible:

| **Function**               | **Description**                                                                            | **Sample data**                                      |
| -------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------- |
| EnableDeviceInsertSwipeTap | Globally configures the SDK to show the keyed screen that allows manual input interaction. | `CardknoxSDKUI.SetEnableDeviceInsertSwipeTap(true);` |
| EnableKeyedEntry           | Globally configures the SDK to show the swipe screen that allows card reader interaction.  | `CardknoxSDKUI.SetEnableKeyedEntry(true);`           |

The following mapping represents which screens will be available when the SDK shows its user interface:

| **EnableDeviceInsertSwipeTap** | **EnableKeyedEntry** | **Keyed screen available** | **Swipe screen available** |
| ------------------------------ | -------------------- | -------------------------- | -------------------------- |
| false                          | false                | Yes                        | No                         |
| true                           | false                | No                         | Yes                        |
| false                          | true                 | Yes                        | No                         |
| true                           | true                 | Yes                        | Yes                        |

<div align="left"><figure><img src="/files/FEvwxBIOfH35ATgx5Z5M" alt=""><figcaption><p>Example of a <strong>keyed</strong> user interface. Keyed screen has a top right corner icon to navigate to the <strong>swipe</strong> screen.</p></figcaption></figure></div>

<figure><img src="/files/KE1DnjaROdKT2kwWq6Ya" alt=""><figcaption><p>Example of a <strong>swipe</strong> user interface. The <strong>swipe</strong> screen contains a button on the bottom that navigates the user to the <strong>keyed</strong> user interface.</p></figcaption></figure>

The following mapping represents available Cardknox Transaction API commands on each user interface

| **Keyed**                            | **Swipe**                                                                                                                                                                                                                             |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Any Cardknox Transaction API command | <p>Any of the following credit card commands:</p><ul><li>cc:save</li><li>cc:credit</li><li>cc:authonly</li><li>cc:sale</li></ul><p>Reference: <a href="https://docs.cardknox.com/api/transaction#credit-card">Transaction API</a></p> |

#### Pre processing options

Developer using the Out Of Scope integration to process using the VP3300 card reader can specify a per-request transaction timeout value. The SDK will start a transaction with the VP3300 reader, and timeout in the specified time frame if the card is not tapped, swiped or inserted in that same time frame.

<table data-header-hidden><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Function/property</strong></td><td><strong>Description</strong></td><td><strong>Sample data</strong></td></tr><tr><td>VP3300TransactionTimeout</td><td>Start transaction value, in seconds.</td><td><pre><code>CardknoxSDKUI ui = CardknoxSDKUI.create();
TransactionParameters parameters = new TransactionParameters();
parameters.SetVP3300TransactionTimeout(13);
PaymentTransactionRequestUI req = ui.createRequestWithParameters(parameters);
// Enable swipe screen in the Cardknox UI
CardknoxSDKUI.SetEnableDeviceInsertSwipeTap(true);
// Show Cardknox UI
Activity activity = null; // Obtain an Activity reference
req.process(activity);
</code></pre></td></tr></tbody></table>

#### Post processing options

After the out-of-scope function finishes with transaction processing, the SDK displays a popup containing a handful of information about the transaction.

The SDK can be configured to auto close the user interface immediately after the transaction processing has completed; regardless if the transaction was approved or not.

| **Function**                     | **Description**                                                                                                                   | **Sample data**                                           |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| CloseSDKUIOnProcessedTransaction | <p>Globally configures the SDK to auto close the user interface after processing a transaction.</p><p>Default value is false.</p> | CardknoxSDKUI.SetCloseSDKUIOnProcessedTransaction(false); |

<figure><img src="/files/2GtQAet3gMJUpjhvJYjl" alt=""><figcaption><p>Example of a <strong>success</strong> popup.</p></figcaption></figure>

<figure><img src="/files/Eea6WRwIoJPmOJZYmhue" alt=""><figcaption><p>Example of an <strong>error</strong> popup.</p></figcaption></figure>

#### In scope integration

In scope processing feature allows the developer to quickly process a payment and retrieve the response object.

To process directly, create a request object:

```javascript
// Create the parameters object
TransactionParameters parameters = new TransactionParameters()
{
    {
        // Required parameters
        SetxCommand("cc:sale");
        SetxAmount(1.23);
        SetxCardNum("4444333322221111");
        // Format "MMYY"
        // For example: December 2024
        SetxExp("1224");

        // Optional parameters to supplement the transaction
        SetxInvoice("1234");
    }
};

// Create the request object
PaymentTransactionRequestDirect request = cardknoxSDKDirect.createRequestWithParameters(parameters);
```

Check if the request object is in a valid state. If it is, call the method to process directly. Otherwise, inspect the validation errors to see what is incorrect in the request object:

```javascript
PaymentTransactionRequestDirect request = cardknoxSDKDirect.createRequestWithParameters(parameters);

if(request.GetIsValid()) {
    PaymentTransactionResponse response = request.process();

    boolean isSuccess = response.GetIsSuccess();
    String errorMessage = response.GetErrorMessage();
    String errorCode = response.GetxErrorCode();
    String refNum = response.GetxRefNum();
} 
else {
    String[] errors = request.GetValidationErrors();  
}
```

#### Available commands

* Check (ACH) commands
  * Reference: [Check (ACH)](/api/transaction/check-ach)
* Credit Card commands
  * Reference: [Credit Card](/api/transaction/credit-card)
* EBT Food Stamp commands
  * Reference: [EBT Food Stamp](/api/transaction/ebt#ebt-food-stamp)
* EBT Cash Benefits
  * Reference: [EBT Cash Benefits](/api/transaction/ebt#ebt-cash-benefits)
* EBT Wic
  * Reference: [EBT Wic](/api/transaction/ebt#ebt-wic-ewic)
* Gift Card commands
  * Reference: [Gift Card](/api/transaction/gift-card)

### Custom UI integration

Custom UI integration is similar to the “out of scope” integration in a way that the exact same methods that the “out of scope” is using under the hood for controlling the card reader, are exposed via the SDK for the Developer to use.

The Developer can choose and use two connection methods to create a transaction with the card reader device, the Bluetooth and USB. Bluetooth is a wireless method of communication between a card reader and a mobile device. To use Bluetooth, the mobile device must have Bluetooth capability and must have Bluetooth permissions enabled. The SDK takes care of the availability of Bluetooth and Bluetooth permissions. On the other hand, the USB connection method uses a wire for communication between the card reader and the mobile device. The USB method is the simplest and most direct method, as the connection between the card reader and the mobile phone is a strong connection. This means that the mobile device does not need to scan to find and communicate with the card reader. The USB method is also not affected by the card reader's sleep feature, while with Bluetooth, the connection is lost when the reader goes into sleep mode.

The SDK cannot automatically recognize what connection methods card reader supports and cannot automatically initiate communication between the reader and the mobile device. Therefore, the Developer must decide which connection method to use and for which card reader. The `CardknoxSDK` object has two different functions that return an instance of communication manager for card readers based on communication method. The `getCustomUIBluetooth()` for Custom UI with Bluetooth and `getCustomUIUSB()`for Custom UI with USB. Both Bluetooth and USB only support the VP3300 device.

The Developer provides the user interface and orchestrates the entire flow for obtaining the card data via the card reader by calling appropriate Custom UI functions at specific times.

#### Custom UI with Bluetooth <a href="#custom-ui-with-bluetooth" id="custom-ui-with-bluetooth"></a>

The `CardknoxSDK`type provides a function to obtain the Custom UI manager:

| `CardknoxSDK.create().getCustomUIBluetooth();` |
| ---------------------------------------------- |

<table data-header-hidden><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Function</strong></td><td><strong>Description</strong></td><td><strong>Sample data</strong></td></tr><tr><td>StartScanningWithTimeout</td><td><p>Starts the “scan for nearby bluetooth devices” process.</p><p>If the timeout value is 0 or a negative number, the scanning never times out.</p><p><br>A card reader event similar to “waiting for device response” will be raised once the scanning starts. <br>This usually means that the user needs to press the physical button in order for the card reader device to be visible to nearby scanners.</p></td><td><pre><code>// Indefinite scan until stopped 
CardknoxSDK.create().getCustomUIBluetooth().startScanningWithTimeout(0);

// Scan with a timeout
CardknoxSDK.create().getCustomUIBluetooth().startScanningWithTimeout(20); </code></pre></td></tr><tr><td>StopScanning</td><td><p>Attempts to stop the bluetooth device scanning process.<br></p><p>Raises a “stop scan” card reader event.<br></p><p>Doesn’t do anything if scanning is not in progress.<br></p><p>If the method stops the scanning process, the SDK reports all scanned devices via a callback.</p></td><td><pre><code>CardknoxSDK.create().getCustomUIBluetooth().stopScanning(); </code></pre></td></tr><tr><td>ConnectWithName</td><td><p>Accepts a device name.</p><p>Configures the SDK to be ready to establish a Bluetooth connection with the nearby VP3300 device with a name equal to the provided name.</p><p>After the call:</p><ul><li>the card reader & the app are not connected immediately but rather the SDK notifies the developer about various card reader events taking place after this method is called; such as “connecting” and “waiting for device response”</li><li>if the VP3300 devices’ bluetooth is not asleep when this method is called, the card reader auto connects to the app</li></ul></td><td><pre><code>String deviceName = "IDTECH-VP3300-12345";
CardknoxSDK.create().getCustomUIBluetooth().connectWithName(deviceName); </code></pre></td></tr><tr><td>ConnectWithAddress</td><td><p>Accepts a MAC address.</p><p>Configures the SDK to be ready to establish a Bluetooth connection with the nearby VP3300 device with the internal MAC address equal to the provided value.</p></td><td><pre><code>String addr = "00:1C:97:1D:EA:50";
CardknoxSDK.create().getCustomUIBluetooth().connectWithAddress(addr); </code></pre></td></tr><tr><td>DisconnectFromCurrentDevice</td><td><p>Attempts to break the connection between the application & the card reader.<br><br>If the card reader is not connected to the app, a card reader event similar to “disconnected already” is raised.</p><p>Otherwise, the SDK attempts to disconnect the card reader. If successful, the “disconnected” card reader event is raised.</p></td><td><pre><code>CardknoxSDK.create().getCustomUIBluetooth().disconnectFromCurrentDevice(); </code></pre></td></tr><tr><td>StartTransaction</td><td><p>Starts a transaction between an already connected application & the card reader.</p><p>Once the transaction starts, the card reader is ready to accept cards, either via swipe, tap or insert.</p><p> </p><p>This method can timeout. Default value is 10 seconds. Developers can override this value via the “parameters” object.</p></td><td><pre><code>Activity activity = null; // Provide this
TransactionParameters prms = new TransactionParameters();
prms.SetxAmount(1.23);
prms.SetxInvoice("1234");
prms.SetxCommand("cc:sale");
prms.SetVP3300TransactionTimeout(13);
CardknoxSDK.create().getCustomUIBluetooth().startTransactionWithArgs(prms); </code></pre></td></tr><tr><td>CancelTransaction</td><td><p>Attempts to cancel an already started transaction between the application & the card reader.<br></p><p>If no transactions are started when this function is called, the function does not do anything.</p></td><td><pre><code>CardknoxSDKCustomUI customUI = null; /\* created object beforehand \*/

customUI.cancelTransaction(); </code></pre></td></tr></tbody></table>

#### Custom UI with USB <a href="#androidsdkusermanual-availablecommands.1" id="androidsdkusermanual-availablecommands.1"></a>

The `CardknoxSDK` object contains instance for connecting card reader with USB. Management of the card reader is done using the functions contained in the USB instance.

```
CardknoxSDK.create().getCustomUIUSB()
```

| **Function**                    | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ConnectVP3300                   | It tries to establish a communication channel between the application and the VP3300 card reader.                                                                                                                                                                                                                                                                                                                                                                                                                  | `CardknoxSDK.create().getCustomUIUSB().connectVP3300();`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| DisconnectFromCurrentDevice     | Termination of the communication channel between the currently connected card reader and the mobile device.                                                                                                                                                                                                                                                                                                                                                                                                        | `CardknoxSDK.create().getCustomUIUSB().disconnectFromCurrentDevice();`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| SetVP3300StartTransactionMethod | <p>The SetVP3300StartTransactionMethod function is a method of the <code>TransactionParameters</code> object used to configure how a card reader initiates a card transaction. It accepts a parameter of type <code>VP3300StartTransactionMethod</code>, which defines the scanning method the card reader should use.</p><p>By calling this method, developers can control the specific way in which the reader should prompt and process a card during a transaction, depending on the desired input method.</p> | <p>The <code>VP3300StartTransactionMethod</code> parameter is an enumerated type that supports the following constant values:</p><ul><li><code>CTLS</code> – Contactless card transaction</li><li><code>EMV</code> – Chip (contact) card transaction</li><li><code>MSR</code> – Magnetic stripe card transaction</li><li><code>DEVICE</code> – Default or device-specific scanning behaviour.</li></ul><p><code>TransactionParameters prms = new TransactionParameters(); prms.SetVP3300StartTransactionMethod(VP3300StartTransactionMethod.MSR); CardknoxSDK.create().getCustomUIUSB().startTransactionWithArgs(prms);</code></p> |
| StartTransactionWithArgs        | <p>Starts a transaction between an already connected application & the card reader.</p><p>Once the transaction starts, the card reader is ready to accept cards, either via swipe, tap or insert.</p><p>Developers can override this value via the “parameters” object.</p>                                                                                                                                                                                                                                        | `TransactionParameters prms = new TransactionParameters(); prms.SetxAmount(1.23); prms.SetxInvoice("1234"); prms.SetxCommand("cc:sale"); prms.SetVP3300TransactionTimeout(13); CardknoxSDK.create().getCustomUIUSB().startTransactionWithArgs(prms);`                                                                                                                                                                                                                                                                                                                                                                              |
| CancelTransaction               | <p>Attempts to cancel an already started transaction between the application & the card reader.</p><p>If no transactions are started when this function is called, the function does not do anything.</p>                                                                                                                                                                                                                                                                                                          | `CardknoxSDK.create().getCustomUIUSB().cancelTransaction();`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

#### Available commands <a href="#androidsdkusermanual-availablecommands.1" id="androidsdkusermanual-availablecommands.1"></a>

Any of the following credit card commands are available for Custom UI:

* cc:save
* cc:credit
* cc:authonly
* cc:sale

Reference: [Credit Card](/api/transaction/credit-card)

#### Custom UI flow

First, create a “custom ui” object to get access to all the Custom UI functions. Afterwards, subscribe to all the relevant callbacks for this integration path:

* transaction result callback - to receive the “response” object after the SDK has processed a transaction
* card reader event callback - to be notified about various events that take place between the application & the card reader
* scanned bluetooth device callback - to be notified about every new scanned bluetooth device during the “scan for devices” process
* scan completed callback - to be notified about all the scanned devices once the “scan for devices” process ends

Next step is to establish a connection between the app and the card reader device. Use one of the “connect” methods on the “custom ui” to initiate a connection; such as “connect with name” or “connect with address”.

Device name or the MAC address can be obtained with the “scan for devices” flow. Initiate the “start scanning” function call, with or without a timeout.

<figure><img src="/files/41evHseOsy6uA6sNuate" alt=""><figcaption><p>Start scanning flow</p></figcaption></figure>

The scanning process stops with a call to the “stop scanning” function or when the “start scanning” function times out.

<figure><img src="/files/a40ISCpLNtp1asxqNZ8h" alt=""><figcaption><p>Stop scanning flow</p></figcaption></figure>

After establishing a connection with the card reader by calling one of the “connect” methods and receiving a “connected” card reader event via the BroadcastReceiver subscription, call the “start transaction” function to make the card reader ready for a card.

The SDK will report a “transaction started” event if the transaction with the card reader was successfully started, otherwise an “error” card reader event is reported back. At this point the card can be tapped, swiped or inserted into the card reader. The SDK will read the card information, process a transaction & deliver the results to the application via a callback.

If no card is tapped, swiped or inserted after the transaction started - a “timeout” card reader is reported back. The default timeout value is about 10 seconds. The developer can override this value via the “transaction parameters” object.

### Payment engine integration <a href="#payment-engine-integration" id="payment-engine-integration"></a>

The Payment Engine won't show any UI. The developer provides the user interface and uses three payment engine functions to create transactions with a card reader over IP. Data that is required to create a transaction is passed by developers as parameters to those SDK functions. The messages and results of creating a transaction with the Payments engine are obtained by the developer from transaction result callback, device status callback, and transaction status.

| **Function**                  | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Device\_Initialize            | <p>This function makes sure that the mobile device can communicate with the card reader and saves data that is needed for connecting to the card reader.</p><p>The initialization process can take about 2 minutes. But it is sufficient to execute it once per card reader and IP address.</p>                                                                                                                                                                                                                                                        | `CardknoxPaymentEngineSDKSettings settings = new CardknoxPaymentEngineSDKSettings(); settings.SetDevice_IP_Port("9001"); settings.SetDevice_IP_Address("127.21.2.7"); settings.SetDevice_Name("Verifone_P400.4"); settings.SetDevice_Timeout(120 * 1000); // 120 seconds; CardknoxSDK.create().getPaymentEngine().Device_Initialize(settings);`                                                                                                                                                                                                                                                 |
| ProcessOutOfScopeWithSettings | <p>Attempts to create a transaction with a card reader over IP. </p><p>This function will perform the initialization process if initialization has not been performed for the specific card reader.</p>                                                                                                                                                                                                                                                                                                                                                | `CardknoxPaymentEngineSDKSettings settings = new CardknoxPaymentEngineSDKSettings(); settings.SetDevice_IP_Port("9001"); settings.SetDevice_IP_Address("127.21.2.7"); settings.SetDevice_Name("Verifone_P400.4"); settings.SetDevice_Timeout(120 * 1000); // 120 seconds; CardknoxPaymentEngineSDKRequest request = new CardknoxPaymentEngineSDKRequest(); request.SetxCommand("cc:sale"); request.SetxAmount(1.23); CardknoxSDK.create().getPaymentEngine().ProcessOutOfScope(settings, request);`                                                                                             |
| Device\_CancelTransaction     | <p>Attempts to cancel an already started transaction between the application & the card reader.</p><p>If no transactions are started when this function is called, the function does not do anything.</p>                                                                                                                                                                                                                                                                                                                                              | `CardknoxSDK.create().getPaymentEngine().Device_CancelTransaction();`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| SetSendResponseaAsJSON        | This function configures the SDK for Payment Engine integration. When the value is set to `true`, the SDK returns a processed transaction response via the [Result as JSON callback](https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Result-as-JSON-callback-subscription). Otherwise, the transaction response is provided through the basic [Transaction Result callback](https://cardknox.atlassian.net/wiki/spaces/MOB/pages/2661711873/Android+SDK+User+Manual#Transaction-result-callback-subscription). | `CardknoxSDK.create().getPaymentEngine().SetSendResponseaAsJSON(true);`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| EnableLogcatBroadcasts        | The EnableLogcatBroadcasts property enables log delivery via callbacks. When set to true, the payment engine sends logs to the app instead of just printing them to the LogCat console, allowing custom handling of log messages.                                                                                                                                                                                                                                                                                                                      | `CardknoxSDK.create().getPaymentEngine().enableLogCatBroadcasts(true);`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Device\_ReprintReceipt        | This method is used to reprint a transaction receipt from the card reader. This function allows users to reprint receipts for any previous transaction. It is useful in situations where a receipt was not printed correctly, was lost, or when a customer requests a duplicate or previous transaction receipt                                                                                                                                                                                                                                        | `CardknoxPaymentEngineSDKSettings settings = new CardknoxPaymentEngineSDKSettings(); settings.SetDevice_IP_Address("specify IP"); settings.SetDevice_IP_Port("specify port"); settings.SetDevice_Name("specify device name, such as PAX_A77.3"); settings.SetDevice_Timeout(5 * 1000); /* milliseconds to seconds */ CardknoxPaymentEngineSDKRequest request = new CardknoxPaymentEngineSDKRequest(); request.SetxAuthCode("add auth code here"); String response = CardknoxSDK.create().getPaymentEngine().Device_ReprintReceipt(settings, request); boolean success = response.equals("OK");` |

### Versioning

Developers can read from the `cardknox.payments.sdk.BuildConfig` class, properties are:

| `VERSION_NAME` | Major SDK version                       |
| -------------- | --------------------------------------- |
| `VERSION_CODE` | Release number in the major SDK version |
| `GIT_HASH`     | Git tag for troubleshooting             |

### Logging

SDK verbose logging can be enabled or disabled with a function call:

| **Function**  | **Description**                                                      | **Sample data**                   |
| ------------- | -------------------------------------------------------------------- | --------------------------------- |
| EnableLogging | <p>Accepts a boolean.</p><p>Enables or disables verbose logging.</p> | CardknoxSDK.enableLogging(false); |

### FAQ

1. As a Cardknox SDK user, I want to process without an internet connection. What will happen?
   * The SDK will return a `PaymentTransactionResponse` object with a special `xErrorCode` value `-1`
2. As a Cardknox SDK user, I’ve encountered errors during transaction processing. What response can I expect?
   * the `PaymentTransactionRequest` object will encapsulate all relevant information in respective fields; for example the `xErrorCode` property will return a code from the Cardknox Transaction API documentation, the `xErrorMessage` and `xError` properties can be used for a descriptive error message while the `xRefNum` gives back a unique ref num to follow up with the customer support


# Android SDK - Technical Guide

## Overview

This document helps developers to integrate the Cardknox Payments SDK with an Android app project using the gradle build system.

## Technical Overview

* The SDK is distributed as an `.aar`
* SDK expects to be provided the `androidx.cardview` package externally, such as via the gradle rule `implementation 'androidx.cardview:cardview:1.0.0'`
* App launch specifics:
  * `AndroidManifest.xml` file registers a `mono.MonoRuntimeProvider` `ContentProvider`, responsible for loading the Mono runtime on app launch
* Supported architectures:
  * `arm64-v8a`
  * `armeabi-v7a`
* Package name is `cardknox.payments.sdk`

## Getting started

To start:

1. Add the obtained `aar` file to your `Android Studio` project, for example into the `app` module `libs` folder; and register the `.aar` in the app's `build.gradle`
2. Provide the `androidx.cardview` dependency either explicitly or as a transitive dependency of some other package, such as `com.google.android.material`

{% code title="CardknoxPaymentsSDK aar registration" %}

```javascript
dependencies {
  implementation fileTree(dir: 'libs', include: ['Cardknox.Payments.SDK.aar'])
  
  // Option 1: explicitly provide the androidx.cardview dependency for the SDK
  implementation 'androidx.cardview:cardview:1.0.0'
  
  // Option 2: implicitly provide the androidx.cardview dependency via the google.material package
  implementation 'com.google.android.material:material:1.5.0'
}
```

{% endcode %}

## LogCat logging

To capture the SDK Logcat logs, filter with the following tag:

* `(Cardknox_DroidSDKLogger|IDT_Event)`

<figure><img src="/files/WCgnzUguizPa9VRQ5gfy" alt=""><figcaption></figcaption></figure>


# 3D Secure 2.0

### **Overview**

3-D (Three-Domain) Secure is an e-commerce security protocol that adds a layer of protection to the checkout process by authenticating the cardholder's identity in real-time — resulting in a reduced rate of fraud and fraud-related chargebacks. Authenticated transactions are very unlikely to be fraudulent, and they cannot be disputed by the cardholder as fraudulent.

While the original 3DS technology effectively reduced rates of fraud, it also introduced friction to the checkout experience because customers were often redirected to their issuing bank’s website to verify their identity. Additionally, the original 3DS is not compatible with mobile payments since it was developed before mobile payment usage became mainstream.

To address the drawbacks of 3DS, EMVco developed 3-D Secure 2.0 in 2016. The updated technology improves upon the original 3DS in several key ways:

* **Utilizes a Greater Number of Data Points to Authenticate Transactions** \
  3DS2 relies upon a much greater number of transaction-specific data points than the original 3DS, which improves the reliability of authentication and limits customer involvement.
* **Embedded, Frictionless Authentication** \
  In the event that the customer does have to verify their identity, they will no longer be redirected to a third-party page — instead, they can verify their identity with a passcode or biometric scan right from the checkout page.
* **Compatible With Mobile Commerce** \
  The new 3-D Secure offers support for iOS and Android SDKs so that merchants can provide a seamless and secure mobile checkout experience.

### Contents

* [Client Side Integration](/products/ifields#ifields-with-3d-secure-authentication)
* [Server Side Integration](/api/transaction/3ds)


# Server-Side Integration

#### Transaction Components

1. Submit a payment transaction on an account that has 3DS 2.x enabled. See the following request fields in addition to [standard required fields for cc:sale and cc:authonly](/api/transaction/credit-card#sale):
   1. Endpoint <https://x1.cardknox.com/gateway> - accepts the parameters as querystring values or application/x-www-form-urlencoded
   2. Endpoint <https://x1.cardknox.com/gatewayJSON> - accepts the payload in JSON format

| **Field Name**       | **Required** | **Description**                                                                                                |
| -------------------- | ------------ | -------------------------------------------------------------------------------------------------------------- |
| x3dsReferenceId      | Yes          | This is the ck3DS.referenceId.                                                                                 |
| x3dsInitializeStatus | Yes          | This is the ck3DS.initializeStatus.                                                                            |
| x3dsError            | No           | This is the ck3DS.error                                                                                        |
| xBillFirstName       | Yes          |                                                                                                                |
| xBillLastName        | Yes          |                                                                                                                |
| xBillStreet          | Yes          |                                                                                                                |
| xBillCity            | Yes          |                                                                                                                |
| xBillState           | Yes          | ISO state or province code in 2-digit alpha format.                                                            |
| xBillZip             | Yes          |                                                                                                                |
| xBillCountry         | Recommended  | ISO country code in 2- or 3- digit alpha format. This will default to US if an unsupported value is submitted. |
| xBillMobile          | Yes          |                                                                                                                |
| xBillPhone           | Recommended  | This will default to the value submitted in xBillMobile if not submitted.                                      |
| xEmail               | Yes          |                                                                                                                |
| xShipFirstName       | Recommended  |                                                                                                                |
| xShipLastName        | Recommended  |                                                                                                                |
| xShipStreet          | Recommended  |                                                                                                                |
| xShipCity            | Recommended  |                                                                                                                |
| xShipState           | Recommended  | ISO state or province code in 2-digit alpha format.                                                            |
| xShipZip             | Recommended  |                                                                                                                |
| xShipCountry         | Recommended  | ISO country code in 2- or 3- digit alpha format. This will default to US if an unsupported value is submitted. |

Possible xStatus responses:

* Approved/Declined/Error
  * The transaction is complete and no further action is necessary. Jump to [3ds response fields](#response-fields).

To configure behavior on non-authenticated 3DS responses, contact Support.

* Verify
  * Pass the response object to the client. (The client will call ck3DS.verifyTrans with the response as a parameter to continue the 3DS authentication.) This transaction response contains the 3DS fields necessary for the website to complete the authentication: xVerifyURL, xVerifyPayload, xInternalID, xRefnum, x3dsActionCode

1. \[Conditional: If previous step returned

xStatusofVerify] Submit verification request to complete the 3DS authentication and process the payment with the bank. In addition to [standard required fields for cc:sale and cc:authonly](/api/transaction/credit-card#sale), the following fields may be required:

a. Endpoint <https://x1.cardknox.com/verify> - accepts the parameters as query string values or application/x-www-form-URL encoded

b. Endpoint <https://x1.cardknox.com/verifyJSON> - accepts the payload in JSON format

| **Field Name**                  | **Required** | **Description**                                                                                                                              |
| ------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| x3dsActionCode                  | Yes          | This is the action code passed as the first parameter to ck3DS.configuration.onVerifyComplete.                                               |
| xVersion                        | Yes          | Cardknox version (current version is 5.0.0)                                                                                                  |
| xCavv                           | Conditional  | Required if x3dsActionCode=SUCCESS. This is the cavv passed as the second parameter to ck3DS.configuration.onVerifyComplete.                 |
| xEci                            | Conditional  | Required if x3dsActionCode=SUCCESS. This is the eci flag passed as the third parameter tock3DS.configuration.onVerifyComplete.               |
| xRefnum                         | Yes          | This is the cardknox xRefNum passed as the fourth parameter tock3DS.configuration.onVerifyComplete.                                          |
| x3dsAuthenticationStatus        | Conditional  | Required if x3dsActionCode=SUCCESS. This is the authenticate status passed as the fifth parameter tock3DS.configuration.onVerifyComplete.    |
| x3dsSignatureVerificationStatus | Conditional  | Required if x3dsActionCode=SUCCESS. This is the signature verification passed as the sixth parameter tock3DS.configuration.onVerifyComplete. |
| x3dsError                       | No           | This is the ck3DS.error and will contain additional info in case of any errors.                                                              |

The transaction response xStatus will be Approved or Declined, and the payment is now complete. [3ds response fields](#response-fields) below.

#### Response fields

Present on a completed cc:sale / cc:authonly.

| **Field Name** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xReviewed      | <p>Y: Transaction was authenticated by 3ds. If authentication was submitted to the bank, the merchant will have fraud chargeback protection.<br></p><p>N: Transaction was not able to achieve 3ds authentication. The merchant will not have 3ds fraud chargeback protection.<br></p><p>F: The 3ds authentication process completed but the bank response indicated that the results were invalid. The merchant will not have fraud chargeback protection.</p> |
| x3dsSubmitted  | This will be “1” if the bank request included 3ds data elements.                                                                                                                                                                                                                                                                                                                                                                                               |


# Client-Side Integration (Non-iFields)

This is the Non-iFields Client-Side Integration document for 3D Secure 2.0.

For the iFields client-side 3DS 2.0 integration, refer to [iFields](/products/ifields#ifields-with-3d-secure-authentication).

**Configuration Properties**

The javascript object exposes the following properties:

| **Property**                       | **Description**                                                                                                                                    | **Allowed Values/Comments**                                                  |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| configuration.enableConsoleLogging | Can be set by the user to turn console logging on for debugging purposes or off to remove extra console writes. Defaults to true.                  | true/false                                                                   |
| configuration.onVerifyComplete     | Should be set by the user - this is a function handler that will be called when a challenge (step-up) is completed (see below for sample function) | name of your javascript function that will handle the transaction completion |
| referenceId                        | Set by the internal code, this property will contain the 3DS reference id for the current transaction                                              | Passed to gateway as part of transaction                                     |
| initializeStatus                   | Set by the internal code, this property will contain the status of initialization                                                                  | Passed to gateway as part of transaction                                     |
| error                              | Set by the internal code, this will contain any error information relevant to the 3DS process                                                      | Passed to gateway as part of transaction                                     |

**Methods**

| **Method name** | **Description**                                                                                                                    | **Parameters**                                                                                                                                  |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| initialize3DS   | To be called on the page load, to set up the environment for processing a 3DS authentication transaction                           | threeDSEnvironment - string - set to either “prod” or “staging”                                                                                 |
| profileBin      | To be called before submitting the initial transaction                                                                             | bin - 9 digit card bin                                                                                                                          |
| verifyTrans     | To be called if the initial transaction response status is “V”, indicating that a challenge/step-up is required for authentication | <p>A javascript object with the following values from the Cardknox gateway response:<br>{xRefNum, xVerifyURL, xVerifyPayload, xInternalID }</p> |

#### Implementation Steps

**Import the Library**

Add the following JS file reference to your web page in your page header:

```
<script src="https://cdn.cardknox.com/sdk-3ds/1.2.2601.2902/cardknox-3ds.min.js" type="text/javascript"></script>
```

**Create JavaScript handler for verification**

When a 3DS 2.0 step-up authentication flow occurs, you must handle this by sending the verification results to the payment gateway. Create a JavaScript function on your page to do this. The ck3DS object will call this function automatically when a step-up verification completes. The function will receive the verification results as input parameters.

The order of parameters is as shown in the following code sample:

```
function handle3DSResults(actionCode, xCavv, xEciFlag, 
        xRefNum, xAuthenticateStatus, xSignatureVerification) 
{
    alert('submitting verify form with verification results');
    
    var url = "_some_url_of_your_server_to_handle_the_response_and_post_to_gateway";
    var postData = {
        xRefNum: xRefNum,
        xCavv: xCavv,
        xEci: xEciFlag,
        xAuthenticateStatus: xAuthenticateStatus,
        xSignatureVerification: xSignatureVerification,
        x3dsActionCode: actionCode,
        x3dsError: ck3DS.error
    };
    
    $.ajax({
        method: "POST",
        url: url,
        data: postData
    }).done(function (jsonResp) {
        log(jsonResp);
        if (jsonResp.Status == 'S') {
            // handle success, eg. show receipt
        }
        else {
            // handle error
        }
    })
    .fail(function (xhr, status, err) {
        var errorMessage = xhr.status + ': ' + xhr.statusText;
        // handle failure
    });
}
```

**Configure the 3DS object**

In your page load, add the initialization code:

```
$( document ).ready(function() {
  // set up configuration
  ck3DS.configuration.enableConsoleLogging = true;
  
  // Below can be used to conditionally turn off 3DS handling 
  // ck3DS.configuration.process3DS = true; 
  
  // name of function that was set up in step #2
  ck3DS.configuration.onVerifyComplete = handle3DSResults; 
  
  var environment = "staging"; // supported values: staging, production
  ck3DS.initialize3DS(environment);
});
```

**Add 3DS profiling and submit results with the initial payment request**

In the form submit handler, before submitting the payment, add the 3DS values to the data to be sent on to the gateway, using whatever submit mechanism is being used on your page. For example, the code below sets the hidden fields on the page to the corresponding values and then submits the form:

```
ck3DS.profileBin(_9_DIGIT_CARD_BIN_HERE_)
  .then((binProfilingResult) =>
  {      
      // Set the 3DS response fields 
      $("#x3dsReferenceId").val(ck3DS.referenceId);
      $("#x3dsInitializeStatus").val(ck3DS.initializeStatus);
      $("#x3dsError").val(ck3DS.error);
      var form_data = $("#payment_form").serialize();
      
      $.ajax({
        method: "POST",
        url: url,
        data: form_data
      }).done(function (jsonResp) {          
          // handle response
      })
      .fail(function (xhr, status, err) {
          var errorMessage = xhr.status + ': ' + xhr.statusText;
          // handle failure
      });
  });    
```

**Handle 3DS Challenge**

Modify the above code (line 15 in the sample snippet above) to correctly handle the server response. If the response from Cardknox had a status of V / Verify, call the verifyTrans function. The parameters this function needs are returned as part of the gateway response object and should just be passed along:

```
if (jsonResp.xResult === 'A') {
    // handle approval, eg. show receipt
}
else if (jsonResp.xResult === 'V'){
  ck3DS.verifyTrans(jsonResp);
}
else {
    // handle other responses....
}
```

When 3DS verification is complete, the onVerifyComplete handler (created in step 2 and "hooked up" in step 3) will be called with the response fields that should be passed to your server.


# Account Updater

## Overview <a href="#accountupdater-howitworks" id="accountupdater-howitworks"></a>

Sola Account Updater identifies customer cards that have expired or are inactive, and then obtains the new card information from the bank. This information is returned to Sola within 10 days of the initial request, at which point it is stored and applied towards any subsequent transactions that are attempted using the previous card (using either the actual data or a Cardknox token).

When a subsequent transaction is processed using updated card information, Sola will indicate this by including `xIsUpdatedCard = True` in the transaction responses. The data returned in `xMaskedCardNumber` and `xExp` will also reflect the updated information, when applicable.

## Recurring Billing <a href="#recurring-billing" id="recurring-billing"></a>

Because Account Updater does not provide updated card information instantaneously, we recommend that Merchants wait 5-10 days before retrying a declined transaction in order to ensure that the updated card information is available. In the case of a recurring payment, note that declined recurring payments are retried once a day for 5 consecutive days, and it's very likely that updated card information will be received and successfully retried within this timeframe.

## Reporting <a href="#accountupdater-reporting" id="accountupdater-reporting"></a>

When a transaction utilizes Account updater, this is indicated in the reporting in the `xCardSource` field (as `xIsUpdatedCard = True`).

`xCardSource = incoming` represents transactions processed with original card data.&#x20;

`xCardSource = account` represents transactions that were processed using updated card info from Account Updater.


# Batch Processing

## Overview

Sola's batch processing tool allows you to process a large volume of transactions in a single batch, all at once. Batches can be processed for a single account or multiple accounts.

{% hint style="warning" %}
The batch processing tool requires SFTP. Please reach out to <support@solapayments.com> for access.
{% endhint %}

### Conventions <a href="#batchprocessing-conventions" id="batchprocessing-conventions"></a>

**x** = Incrementing Sequence Number

* Numbers can be skipped but they must always be greater than the previous file.
* Files with older or invalid sequence numbers are ignored.
* Sequence Number Max Value = 999999999 (9 digits).

**KVP** = URL Encoded Key-Value-Pair

* Sample: `xName=John%20Smith&xAmount=1`
* **Note**: Ensure that all values are URL encoded.

## Batch Upload Lifecycle <a href="#batchprocessing-batchuploadlifecycle" id="batchprocessing-batchuploadlifecycle"></a>

### Request <a href="#batchprocessing-request" id="batchprocessing-request"></a>

1. Client uploads Request/REQUEST\_X.KVP
2. Client uploads Request/PROCESS\_X.KVP
3. Batch process is triggered when Request/PROCESS\_X.KVP is received

### Response <a href="#batchprocessing-response" id="batchprocessing-response"></a>

1. Gateway saves Response/RESPONSE\_X.KVP
2. Gateway saves Response/COMPLETE\_X.KVP
3. Client polls and parses Response/COMPLETE\_X.KVP
4. If `xStatus`=Success, then client downloads and parses Response/RESPONSE\_X.KVP
5. Client deletes all files from Response folder

## File Formats <a href="#batchprocessing-fileformats" id="batchprocessing-fileformats"></a>

### Request Data File <a href="#batchprocessing-requestdatafile" id="batchprocessing-requestdatafile"></a>

**Filename Format:** REQUEST\_X.KVP

* Each line contains an individual transaction in KVP format. Any transaction that can be executed via the standard API can be submitted in the Request Data File.

**Required Variables:**

| **Value**                      | **Description**                                               | **Sample Data**                                                                                                               |
| ------------------------------ | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `xIndex`                       | The zero-based index number of each row.                      | `xIndex=0&xSequenceNumber=99999&xKey=&xVersion=&xSoftwareNa me=&xSoftwareVersion=&xCommand=&xCardNum=&xExp=&xName=& xAmount=` |
| `xSequenceNumber`              | Must match the Incrementing Sequence Number in the file name. | `xIndex=0&xSequenceNumber=99999&xKey=&xVersion=&xSoftwareNa me=&xSoftwareVersion=&xCommand=&xCardNum=&xExp=&xName=& xAmount=` |
| Standard API request variables | See [iFields](/products/ifields).                             | `xIndex=0&xSequenceNumber=99999&xKey=&xVersion=&xSoftwareNa me=&xSoftwareVersion=&xCommand=&xCardNum=&xExp=&xName=& xAmount=` |

### Request Metadata File <a href="#batchprocessing-requestmetadatafile" id="batchprocessing-requestmetadatafile"></a>

**Filename Format:** PROCESS\_X.KVP\
**Required Variables:**

| **Value**         | **Description**                                              | **Sample Data**                                               |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------- |
| `xKey`            | Batch upload credential (not the merchant credential).       | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=99999` |
| `xSubmittedCount` | Count of transactions in the Request File.                   | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=99999` |
| `xFormat`         | KVP.                                                         | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=99999` |
| `xSequenceNumber` | Must match the incrementing sequence number in the file name | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=99999` |

### Response Data File <a href="#batchprocessing-responsedatafile" id="batchprocessing-responsedatafile"></a>

**Filename Format:** RESPONSE\_X.KVP

* Each line contains an individual response in KVP format.

**Required Variables:**

| **Value**                       | **Description**                                      | **Sample Data**                                                                                                                    |
| ------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `xIndex`                        | Corresponds to the xIndex in the request.            | `xIndex=0&xSequenceNumber=99999&xResult=&xStatus=&xError=&xRe fNum=&xAuthCode=&xAuthAmount=&xToken=&xMaskedCardNumber= &xInvoice=` |
| `xSequenceNumber`               | Corresponds to the `xSequenceNumber` in the request. | `xIndex=0&xSequenceNumber=99999&xResult=&xStatus=&xError=&xRe fNum=&xAuthCode=&xAuthAmount=&xToken=&xMaskedCardNumber= &xInvoice=` |
| Standard API response variables | See [API Docs](/api/transaction/credit-card).        | `xIndex=0&xSequenceNumber=99999&xResult=&xStatus=&xError=&xRe fNum=&xAuthCode=&xAuthAmount=&xToken=&xMaskedCardNumber= &xInvoice=` |

### Response Metadata File <a href="#batchprocessing-responsemetadatafile" id="batchprocessing-responsemetadatafile"></a>

**Filename Format:** COMPLETE\_X.KVP

**Required Variables:**

| **Value**         | **Description**                                                       | **Sample Data**                                                                                           |
| ----------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `xResult`         | <p>Status of the batch upload process.</p><p>Success/Error value.</p> | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=9999 9&xResult=&xStatus=&xError=&xProcessedCount=` |
| `xStatus`         | <p>Status of the batch upload process.</p><p>Success/Error value.</p> | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=9999 9&xResult=&xStatus=&xError=&xProcessedCount=` |
| `xError`          | If `xStatus` = Error, this variable contains the error message.       | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=9999 9&xResult=&xStatus=&xError=&xProcessedCount=` |
| `xProcessedCount` | Count of the processed transactions.                                  | `xKey=&xSubmittedCount=500&xFormat=KVP&xSequenceNumber=9999 9&xResult=&xStatus=&xError=&xProcessedCount=` |


# Browser-Based POS systems (BBPOS)

The Sola solution for browser-based POS systems (BBPOS) is a tray application that runs in the background of your computer. It acts as a local server, allowing a POS application operating out of a browser to accept chip-based EMV (Europay, MasterCard, Visa) payments while remaining out of PCI scope. Our BBPOS solution supports all major terminals including PAX, Verifone, and, Ingenico, and ID TECH. See <https://solapayments.com/devices/> for a full list of our supported devices.

{% hint style="info" %}
In order to use BBPOS, it must be activated on your account. To request activation, please contact support.
{% endhint %}

## Configuration

To configure the BBPOS application:

1. Download and install Sola BBPOS (PaymentEngineExt) from the provided link.\
   [BBPOS download](https://cdn.cardknox.com/dl/bbpos.exe)
2. Follow the installation prompts.
3. When asked for the "Software name," enter "BBPOS."
4. Provide your Sola key when prompted.
5. BBPOS will now run in the background and can be found in the system tray ![](/files/ME2GefXt56GPpdwBTKLV)

## Transaction Flow <a href="#transaction-flow" id="transaction-flow"></a>

1. The POS sends an HTTP POST request containing transaction information, such as the transaction amount, to the local host [https://localemv.com:8887](https://localemv.com:8887/).\
   **Note**: Transaction details should be in URL encoded Key-Value Pairs (KVP).
2. Our BBPOS application receives the request and communicates with either the terminal or a pop-up window on the screen.
3. The customer inserts their credit card into the terminal or keys the card number into the pop-up window.
4. The transaction data is transmitted to the Sola gateway for authorization.
5. When the transaction is complete, our BBPOS application sends back the transaction authorization details to your browser in the HTTP response through a redirect URL or AJAX. Transaction results are returned in the HTTP response in KVP format unless otherwise using `xResponseFormat`. See the **Transaction Settings Table** for more information.
6. To cancel a currently processing transaction, send xCancel=1 to host [https://localemv.com:8887](https://localemv.com:8887/).
7. You can find available and required commands and parameters [here](/api/transaction). See the **Custom Device Commands Table** for BBPOS specific commands.
8. The transaction can be redirected to a URL specified in `xRedirectURL`. See the **Transaction Settings Table** for more information.
9. Go to <https://www.cardknox.com/bbpos/request-redirect.htm> for a sample implementation using a redirect.
10. Go to <https://solapayments.com/bbpos/request-ajax.htm> for a sample implementation using AJAX.

![](/files/0fFUdU2BFC0jRUU4MBGD)

## Transaction Settings <a href="#transaction-settings" id="transaction-settings"></a>

You can configure transaction setting in the application setting file (right-click on Payment Engine in the system tray and choose options), or in a transaction request. In the case of a conflict, settings that are applied in the transaction request will override settings applied in the setting file. Use 1 and 0 for Boolean variables.

| Settings File Name             | Transaction Request Name        | Parameter Description                                                                                              |
| ------------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| xKey                           | xKey                            | Sola API key                                                                                                       |
| DeviceName                     | xDeviceName                     | Name of device (see list of device names [here](https://docs.cardknox.com/sdk/payment-engine-sdk#device-settings)) |
| DeviceCOMPort                  | xDeviceComPort                  | USB COM port assigned to device                                                                                    |
| DeviceBaud                     | xDeviceComBaud                  | Device baud rate                                                                                                   |
| DeviceParity                   | xDeviceComParity                | Device parity                                                                                                      |
| DeviceDataBits                 | xDeviceComDataBits              | Device data bit                                                                                                    |
| DeviceIP                       | xDeviceIPAddress                | IP address assigned to device                                                                                      |
| DevicePort                     | xDeviceIPPort                   | IP port assigned to device                                                                                         |
| Device\_Timeout                | xDeviceTimeOut                  | Set amount of time to wait from transaction                                                                        |
| RequireAVS                     | xRequireAVS                     | Forces user to enter cardholder to enter AVS info for keyed transactions (Windows Only)                            |
| RequireCVV                     | xRequireCVV                     | Forces user to enter cardholder to enter card CVV for keyed transactions (Windows Only)                            |
| EnableDeviceInsertSwipeTap     | xEnableDeviceSwipe              | Enables device transactions                                                                                        |
| RequirePin                     | xRequirePin                     | Requires a PIN for debit enabled cards                                                                             |
| RequireSignature               | xRequireSignature               | Requires a signature                                                                                               |
| EnableWelcomeScreen            | xEnableWelcomeScreen            | If set to false, will disable device welcome screen                                                                |
| PrinterName                    | N/A                             | Sets printer to which receipts will be sent                                                                        |
| ExitFormIfApproved             | xExitFormIfApproved             | Exits payment form after transaction approval without user interaction (Windows only)                              |
| ExitFormIfNotApproved          | xExitFormIfNotApproved          | Exits payment form after transaction decline without user interaction (Windows Only)                               |
| ExitFormOnDeviceError          | xExitFormOnDeviceError          | Exits payment form after transaction error without user interaction (Windows Only)                                 |
| EnableSilentMode               | xEnableSilentMode               | Payment form will not appear. Transaction will be handled solely on device.                                        |
| EnableKeyedEntry               | xEnableKeyedEntry               | Disables keyed transaction on payment form, but does show form. Transaction will be handled solely on device.      |
| EnableAmountConfirmationPrompt | xEnableAmountConfirmationPrompt | The device will prompt for a confirmation with the amount,                                                         |
| N/A                            | xResponseFormat                 | Specifies response format. Available formats are KVP, JSON, XML.                                                   |
| N/A                            | xRedirectURL                    | Species a URL to which user will be redirected to upon completion of the transaction.                              |
| CloseApplicationOnSessionEnd   | N/A                             | Closes the application and prevents the application from running when screen is locked                             |

## Custom Device Commands <a href="#custom-device-commands" id="custom-device-commands"></a>

These commands can be used to transport custom data to or from the device. They should be sent in the xCommand variable. These are standalone commands and are not used during a transaction. Appropriate device variables (xDeviceName, xIP, etc.) must be sent in. For commands that expect a payload, send in the payload as an xDeviceData variable.

| Command Name              | Description                                                                                                                                                                                                                                                                                                  |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Device\_ShowWelcomeScreen | Displays welcome screen on the device                                                                                                                                                                                                                                                                        |
| Device\_SendData          | Sends data to device. Does not expect a response.                                                                                                                                                                                                                                                            |
| Device\_GetData           | Requests data from device                                                                                                                                                                                                                                                                                    |
| Device\_GetFormEvent      | Requests form data from the device                                                                                                                                                                                                                                                                           |
| Device\_GetSignature      | Displays signature prompt on device. Returns Base64 encoded string. `xDeviceData` can be used to specify a location where signature will be stored as PNG file. `xSignatureMessage` can be used to display a signature message.                                                                              |
| Device\_ShowItems         | <p>Show the items during a transaction.<br>Required fields <code>xSerializationType=JSON</code>, <code>xAmount</code> and <code>xData</code> with items in JSON format. Ex <code>\[{'xdescription':'Apples','xqty':1,'xunitprice':'.40'}, {'xdescription':'Oranges','xqty':2,'xunitprice':'.50'}]</code></p> |
| Device\_GetSignatureData  |                                                                                                                                                                                                                                                                                                              |
| Device\_GetScreenshot     |                                                                                                                                                                                                                                                                                                              |
| Device\_Download          |                                                                                                                                                                                                                                                                                                              |

## BBPOS test sites <a href="#bbpos-test-sites" id="bbpos-test-sites"></a>

(Note: in order to use the test site, you will need to first download and run our application.)

<https://www.cardknox.com/bbpos/request-redirect.htm>\
<https://solapayments.com/bbpos/request-ajax.htm>

## Offline Transactions <a href="#offline-transactions" id="offline-transactions"></a>

Use the following integration when you are offline or cannot reach Cardknox:

1. Send the following command to BBPOS ([https://localemv.com:8887](https://localemv.com:8887/)) to initiate an offline transaction on the device `xCommand=cc:encrypt`&#x20;
2. Complete the transaction on the device or on the Payment Engine form
3. If successful, you should receive a response as follows:\
   `"xCardNum": "4444330000001111;enc_1_1_Yu2tZUHL2ucliZwKaq5NMKBY5QDArSh8BcroZg4qT6sc39O8fLgRlBxVMQH1jpv+42s9IFTu2cSEi73j6qgtaLkQ5O8gZ2sPBgWnWjDjg6hvYeDJBBTjKh/ms6h6hAhgrfMD+3+ibgrt7OT2Ks2KHQ==_TThACh9hOhTiKte+qU9jRke7f08aAnrsNqjuToWyuP2onSh/ksQN5JOn3yWF2ECMIIrM/uT1MeC3HZxojDV+XDa7+4qJiuKgRh2yyNyAooBtyAh63IzhYd7gaIosEb2U7laOO5d6Zt2HJ4+br7P9hHIEbvElYH2O7uIaQN004c1pki1cJcs0n1ugPLvPpFwUMaUOYUi7z0RuEwX+n/bc9bLHyvYQAt1vo+Z0xteVifT/B0PrNLmGbpElRnwRNpf4koSV05HH363NH/Y4Yu2rnZnCjtOzn1NCPWkt41fUqiVTF1f9ZWCvU7iWR2cLd61Q7OwuT2VLP/c0WnMRbPXDEg==?", "xResult": "S", "xStatus": "Success", "xCommand": "cc:encrypt", "xAuthAmount": "1.99", "xSignatureRequired": "True", "xTransactionMode": "Unknown Entry Mode", "CVM": "Signature" }`
4. Store the xCardnum data locally until you have a connection, and then submit the data as xCardnum or xMagStripe
   1. xCardNum data needs to be URL encoded Key-Value Pairs (KVP)


# CloudIM Developer Guide

### **Table of Contents**

1. [**Quick Start**](#id-1.-quick-start)
2. [**Authentication Flow**](#id-2.-authentication-flow-using-your-api-key)
3. [**Before You Start - Device Setup**](#id-3.-before-you-start-device-setup)
4. [**Transaction Flow**](#id-4.-transaction-flow)
5. [**Schemas**](#id-5.-schemas)
6. [**Troubleshooting & Common Issues**](#id-6.-troubleshooting-and-common-issues)
7. [**FAQs**](#id-7.-faqs)

***

## **1. Quick Start**

**Overview**

CloudIM (CIM) enables seamless integration with **Sola devices** via cloud-based APIs, eliminating the need for physical connections, drivers, or local SDKs. This setup allows you to manage transactions remotely using simple REST API calls once the device is connected to the merchant’s network (either via LAN or Wi-Fi).

Currently, only **credit card** (swipe, tap, and dip) and **gift cards** **transactions** are supported.

* cc:sale
* cc:authonly
* cc:credit
* gift:balance
* gift:issue
* gift:redeem
* gift:activate

**Debit** and **EBT transactions** are not supported at this time.

{% hint style="info" %}
In order to use CloudIM, it must be activated on your account. To request activation, please contact support.
{% endhint %}

**Step-by-Step Quick Start**

1. **Sign Up**: Create a Sola account
2. **Authentication**: Use the **API Key** from the merchant dashboard.
3. **Create Device**: Before initiating transactions, you need a **Device ID**. Follow the instructions below to create and obtain the device ID.
4. **Make Your First API Call**: Start by making a simple **payment request** via the `POST /payments` endpoint.
5. **Test in Swagger UI**: Use **Swagger UI** to test the API directly in your browser. This is a quick way to familiarize yourself with the API and see how it responds.

***

## **2. Authentication Flow (Using Your API Key)**

**Create API Key**

Once registered, your **API Key** will be available in your Sola account dashboard.

Portal > Sola Account Settings > Keys > Create a Key - [**Link**](https://portal.solapayments.com/)

Once the **API Key** is obtained, include it in the **Authorization header** of all requests.

***

## **3. Before You Start - Device Setup**

**Required:** Currently CloudIM is only available for certain Pax A series devices (A77, A35, A80, A920 and A920 Pro).

To start initiating transactions, you need a **Device ID**. Here’s how you can get the device ID and ensure that your device is ready:

**Step 1: Check Device Status**

Before initiating any transactions, ensure that **CloudIM** is running on the device.

* **Check for the "Running…" Notification**: Swipe down from the top of the terminal to verify that the CloudIM service is active. If you don’t see the "Running..." notification, reboot the terminal.
* Wait for a minute until the notification appears indicating that CloudIM is up and running.

**Step 2: Create Device**

Once CloudIM is running, you need to create a **Device ID**. To do this, send a **POST** request to the /v1/Device endpoint. This requires the device’s **serial number**, **device make**, and a **friendly name** (a name of your choosing for easier reference).

* **Endpoint**: POST /v1/Device
* **Required parameters**: Serial number, device make, friendly name.

**Example Request**:

```
POST <https://device.cardknox.com/v1/Device>
Content-Type: application/json
Authorization: API Key

{
  "xDeviceserialNumber": "1234567890",
  "xDeviceMake": "pax",
  "xDeviceFriendlyName": "Terminal 1"
}
```

**Response**:

```
{
	"xDeviceId": "16fbd30d7-2e86-4ddc-8e52-442e9332be0e",
	"xRefnum": "cim111003924",
	"xResult": "S"
}
```

**Step 3: Verify Device Status**

Now that you have a **Device ID**, you can check the device’s status using the **GET /v1/Device/{xDeviceId}** endpoint.

* **Endpoint**: GET /v1/Device/{xDeviceId}
* **Status**: The response will indicate whether the device is **CONNECTED** or **DISCONNECTED**. You can only initiate transactions once the device status is **CONNECTED**.

**Example Request**:

```
GET <https://device.cardknox.com/v1/Device/xDeviceId123>
Authorization: API Key
```

**Response**:

```
{
  "xDeviceId": "xDeviceId123",
  "xDeviceName": "Terminal 1",
  "xStatus": "CONNECTED"
}
```

***

## **4. Transaction Flow**

### **Asynchronous Transactions**

Once your device is connected and ready to go, you can start processing transactions. The transaction flow involves the following key steps:

**Step 1: Initiate the Transaction**

You will initiate the transaction via the **POST /v2/session/async** API. This request starts the transaction on the terminal, which then requests the card details from the user.

CloudIM currently only supports the following parameters, additional parameters will be supported in the future:

| xAmount            | Yes | Numeric | The total amount to be charged, including any tips.                          | e.g., "10.00"                                                                                        |
| ------------------ | --- | ------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| xCommand           | Yes | String  | Specifies the transaction type to execute.                                   | cc:sale, cc:authonly, cc:credit                                                                      |
| xEnableTipPrompt   | No  | Boolean | Enables tip prompt on the device during the transaction.                     | true, false                                                                                          |
| xExternalRequestId | Yes | String  | <p>A unique identifier for the transaction, defined by the merchant.<br></p> | <p>Any unique string<br><br><strong>Note:</strong> This field only supports up to 32 characters.</p> |
| xInvoice           | No  | String  | Invoice number associated with the transaction.                              | <p>Any alphanumeric string<br><br><strong>Note:</strong> This field supports 20 characters</p>       |
| xSoftwareName      | Yes | String  | Name of the software initiating the transaction.                             | e.g., "My Software"                                                                                  |
| xSoftwareVersion   | Yes | String  | Version of the software initiating the transaction.                          | e.g., "1.0.0"                                                                                        |
| xStreet            | No  | String  | Cardholder's billing street address.                                         | e.g., "123 Main St.”                                                                                 |
| xTip               | No  | Numeric | Tip amount to be added to the transaction.                                   | e.g., "1.00”                                                                                         |
| xZip               | No  | String  | Cardholder's billing ZIP or postal code.                                     | e.g., "12345”                                                                                        |

**Endpoint:** POST /v2/session/async

**Example Request**:

```
POST <https://device.cardknox.com/v2/Session/Async>
Content-Type: application/json
Authorization: API Key

{
  "xPayload": {
    "xCommand": "cc:sale",
		 "xAmount": "0.01",
    "xEnableTipPrompt": true,
    "xExternalRequestId": "1234654",
    "xSoftwareName": "MySoftware",
    "xSoftwareVersion": "1.0.0"
  },
  "xDeviceId": "1ac25fc88-da3a-44ba-9b8f-0db642613cb7"
}
```

**Response**:

```
{
	"xSessionId": "session111004629",
	"xRefnum": "cim111004629",
	"xResult": "S"
}
```

**Step 2: Process the Transaction on the Terminal**

* The **terminal** will now prompt for the card information (swipe, tap, or dip).
* The terminal processes the transaction and sends back an **approved**, **timeout**, or **error** response to the API.

**Step 3: Poll for the Session Status**

After initiating the transaction, the **POS system** will need to ping the API to get the **transaction status**.

The possible status results are:&#x20;

* INITIATING - Before the session is acknowledged by the device&#x20;
* PROCESSING - Acknowledged and in progress&#x20;
* COMPLETED - Completed successfully&#x20;
* TIMEOUT - Timeout&#x20;
* USER\_CANCELLED - Cancel button on device&#x20;
* API\_CANCELLED - Cancel API call&#x20;
* ERROR - Other error (Including decline)&#x20;

**Endpoint**: GET /v1/Session/{xSessionId}

**Example Request**:

```
GET <https://device.cardknox.com/v1/Session/session12345>
Authorization: API Key
```

**Response** (for an approved transaction):

```
{
	"xSessionStatus": "COMPLETED",
	"xGatewayRefnum": "10204219792",
	"xGatewayStatus": "Approved",
	"xTransactionResult": {},
	"xRefnum": "cim111008282",
	"xResult": "S"
}
```

**Step 4: Retrieve Additional Transaction Details (Optional)**

After the transaction has been completed successfully, you can retrieve additional details from the **Gateway Reporting API** using the **xRefNum** provided.

### Synchronous Transactions

**Step 1: Initiate the Transaction**

You will initiate the transaction via the **\[POST]/v2/Session** API. This request starts the transaction on the terminal, which then requests the card details from the user.

CloudIM currently only supports the following parameters, additional parameters will be supported in the future:

| **Field Name**     | **Required** | **Type** | **Description**                                                   | **Possible Values**                                                                                                                                        |
| ------------------ | ------------ | -------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xAmount            | Yes          | Numeric  | The total amount to be charged, including any tips.               | e.g., "10.00"                                                                                                                                              |
| xCommand           | Yes          | String   | Specifies the transaction type to execute.                        | cc:sale, cc:authonly, cc:credit                                                                                                                            |
| xEnableTipPrompt   | No           | Boolean  | Enables tip prompt on the device during the transaction.          | true, false                                                                                                                                                |
| xExternalRequestId | Yes          | String   | A unique identifier for the transaction, defined by the merchant. | <p>Any unique string</p><p><strong>Note:</strong> This field currently only supports up to 32 chars. (64-char support will be available in the future)</p> |
| xInvoice           | No           | String   | Invoice number associated with the transaction.                   | <p>Any alphanumeric string</p><p><strong>Note:</strong> This field supports 20 characters.</p>                                                             |
| xSoftwareName      | Yes          | String   | Name of the software initiating the transaction.                  | e.g., "My Software"                                                                                                                                        |
| xSoftwareVersion   | Yes          | String   | Version of the software initiating the transaction.               | e.g., "1.0.0"                                                                                                                                              |
| xStreet            | No           | String   | Cardholder's billing street address.                              | e.g., "123 Main St.”                                                                                                                                       |
| xTip               | No           | Numeric  | Tip amount to be added to the transaction.                        | e.g., "1.00”                                                                                                                                               |
| xZip               | No           | String   | Cardholder's billing ZIP or postal code.                          | e.g., "12345”                                                                                                                                              |

**Endpoint**: POST **v2/session (***Initiate synchronous* *transaction***)**

**Example Request**:

```json
POST <https://device.cardknox.com/v2/session>
Content-Type: application/json
{
	"xKey": "<Api Key>",
    "xDeviceId": "1ac25fc88-da3a-44ba-9b8f-0db642613cb7",
    "xWebhookId": "whk1xxxxxxxxxx",	
    "xSoftwareName": "MySoftware",
    "xSoftwareVersion": "1.0.0",
    "xCommand": "cc:sale",
    "xAmount": "1.91",
    "xExternalRequestId": "xxxyyyzzzxxxxxxxxxxxxx"
}
```

**Response**:

```json
{
	"xAID": "A0000000041010",
	"xAuthAmount": "1.91",
	"xAuthCode": "35955A",
	"xAvsResultCode": "NNN",
	"xBatch": "41426273",
	"xCardType": "MasterCard",
	"xDate": "1/21/2026 2:09:52 PM",
	"xEntryMethod": "Contactless_EMV",
	"xExp": "1029",
	"xErrorCode": "0",
	"xIAD": "0110A04001220000000000000000000000FF",
	"xIsEMV": true,
	"xMaskedCardNumber": "5xxxxxxxxxxx7387",
	"xToken": "6q3xxxxxxx",
	"xTSI": "0000",
	"xTVR": "0000008001",
	"xVoid": false,
	"xVoidable": true,
	"xRefnum": "10802216860",
	"xResult": "A",
	"xStatus": "Approved"
}
```

**Step 2: Process the Transaction on the Terminal**

* The **terminal** will now prompt for the card information (swipe, tap, or dip).
* The terminal processes the transaction and sends back an **approved**, **timeout**, or **error** response to the API.

**Step 3: Check the Transaction status for asynchronous transaction**

**Endpoint**: POST **v2/session/result**

* By SessionId

**Example Request**:

```
POST <https://device.cardknox.com/v2/session/result>
Content-Type: application/json
{
    "xKey": "<Api Key>",
    "xSessionId": "session504979965"
}
```

* By ExternalRequestId

```
POST <https://device.cardknox.com/v2/session/result>
Content-Type: application/json
{
    "xKey": "<Api Key>",
    "xExternalRequestId": "<Your External Request Id>"
}
```

**Response**:

```json
{
	"xAID": "A0000000041010",
	"xAuthAmount": "1.91",
	"xAuthCode": "35955A",
	"xAvsResultCode": "NNN",
	"xBatch": "41426273",
	"xCardType": "MasterCard",
	"xDate": "1/21/2026 2:09:52 PM",
	"xEntryMethod": "Contactless_EMV",
	"xExp": "1029",
	"xErrorCode": "0",
	"xIAD": "0110A04001220000000000000000000000FF",
	"xIsEMV": true,
	"xMaskedCardNumber": "5xxxxxxxxxxx7387",
	"xToken": "6q3xxxxxxx",
	"xTSI": "0000",
	"xTVR": "0000008001",
	"xVoid": false,
	"xVoidable": true,
	"xRefnum": "10802216860",
	"xResult": "A",
	"xStatus": "Approved"
}
```

***

## **5. Schemas**

This section describes the common schemas used in the Sola API. These schemas define the structure of the request and response payloads for key API endpoints such as device management, session initiation, and transaction result retrieval.

In the Sola API, schemas are used for both **request** and **response** bodies. When interacting with various endpoints such as device management, session initiation, and transaction result retrieval, you will often need to send data in the formats described in the schemas above. Similarly, the responses you receive from the API will follow the structures defined in these schemas, helping you to parse and process the returned data accordingly.

By following these schema definitions, developers can ensure that they send and receive data in the correct format, which reduces errors and improves the overall experience when integrating with the Sola API.

***

**A. Device Schema**

The **Device Schema** represents the structure of a device object used within the system. Devices are registered on the platform and are assigned unique device IDs to facilitate transactions.

**Request Payload (For device creation):**

When creating a device, you need to provide the device’s serial number, make, and a friendly name.

```
{
  "xDeviceSerialNumber": "SN987654321",
  "xDeviceMake": "PAX",
  "xDeviceFriendlyName": "POS-Terminal-01"
}
```

**Response Example:**

The API will respond with a unique device ID and the status of the device.

```
{
  "xDeviceId": "12345",
  "xDeviceSerialNumber": "SN987654321",
  "xDeviceMake": "PAX",
  "xDeviceFriendlyName": "POS-Terminal-01",
  "xStatus": "CONNECTED"
}
```

* xDeviceId: Unique identifier for the device.
* xDeviceSerialNumber: Serial number of the device.
* xDeviceMake: The manufacturer or model of the device.
* xDeviceFriendlyName: A custom name for the device.
* xStatus: The current state of the device (e.g., "CONNECTED", "DISCONNECTED").

***

**B. Session Schema**

The **Session Schema** is used when initiating a transaction. It tracks the session ID and associated details such as the transaction type, amount, and status.

**Request Payload (For session initiation):**

When initiating a transaction, you need to provide the device ID, transaction type, and amount.

```
{
  "xDeviceId": "12345",
  "xTransactionType": "cc:sale",
  "xAmount": 100.00
}
```

**Response Example:**

The API responds with the session ID and status of the initiated transaction.

```
{
  "xSessionId": "abc123",
  "xDeviceId": "12345",
  "xTransactionType": "cc:sale",
  "xAmount": 100.00,
  "xStatus": "IN_PROGRESS",
  "xResponseCode": "00",
  "xRefNum": "X123456789"
}
```

* xSessionId: A unique identifier for the session.
* xDeviceId: The ID of the device associated with this session.
* xTransactionType: The type of transaction (e.g., cc:sale, cc:credit).
* xAmount: The amount of the transaction.
* xStatus: The current status of the session (e.g., "IN\_PROGRESS", "COMPLETED").
* xResponseCode: The response code from the payment processor (e.g., "00" for success).
* xRefNum: Cross-reference number for reporting and future use.

***

**C. Transaction Result Schema**

The **Transaction Result Schema** is used when retrieving the details of a completed transaction. It includes the transaction status, reference number, and other relevant details.

**Response Example (Transaction Result):**

After polling the session status, you can retrieve the transaction details.

* xRefNum: Cross-reference number used for reports and follow-up transactions.
* xTransactionType: The type of transaction (e.g., cc:sale, cc:credit).
* xAmount: The total amount processed in the transaction.
* xStatus: The status of the transaction (e.g., "approved", "declined").
* xApprovalCode: The authorization code returned from the payment processor.
* xDate: The date and time when the transaction was completed.

***

**D. Error Response Schema**

In the event of an error, the API will return an error message describing what went wrong. The structure of an error response is as follows:

**Error Response Example:**

```
{
	"xError": "dynamic error code",
	"xRefnum": "cim123456",
	"xResult": "E"
}
```

Common error codes might include:

* INVALID\_REQUEST: Missing required fields or invalid data.
* UNAUTHORIZED: Invalid or expired API key.
* DEVICE\_NOT\_FOUND: The device ID provided does not exist in the system.
* TRANSACTION\_FAILED: The transaction could not be processed.
* Session\_not\_found: The session ID is incorrect.

***

## **6. Troubleshooting & Common Issues**

If you encounter issues, the following steps can help you troubleshoot effectively:

**Invalid API Key**

If you receive an **Authentication error**, make sure the **API Key** is still valid.

**Device Not Responding**

1. Ensure the device is connected to the internet.
2. Restart the app or reboot the terminal.
3. If the problem persists, contact support with the necessary details (e.g., device serial number, connection status).

**Device Status Not CONNECTED**

If the device status is not **CONNECTED**, ensure the device is correctly registered and the **Cloud IM** app is installed and active.

**Session Not Completing**

If the transaction session does not complete, check the terminal for errors, and ensure it is connected to the internet. Review the session logs for more details.

**Canceling a Transaction/Session**

If you would like to cancel a Transaction/Session please perform the following:

<div align="left"><figure><img src="/files/Xcquyj5jR00goR27D1dh" alt=""><figcaption></figcaption></figure></div>

***

## **7. FAQs**

**Q. How do I activate Cloud IM on my terminal?**\
A. Cloud IM starts up automatically when the terminal is booted. No user action is required.

**Q. How do connect my Pax device to the network?**\
A. You can tap the 4 corners of a the device while turned on to access the device. Password is todays date MMDDYYYY, exit the apps settings. Then choose appropriate wifi or CIM network from your android device settings.

**Q. How do I know if Cloud IM is running?**\
A. Look for the "Running..." notification at the top of the terminal screen. If it’s not there even after waiting a few minutes, reboot the terminal.

**Q. My device is not responding. What should I do?**\
A. Ensure the device is connected to the internet. If it is, reboot the terminal. If issues persist, contact support.

**Q. Where can I find the Swagger API docs?**\
A. <https://device.cardknox.com/api/v1/swagger/index.html>

***


# Deep Linking

## Overview <a href="#deeplinking-1.overview" id="deeplinking-1.overview"></a>

* Deep link feature allows a third-party (in further text referred to as a Developer) to use a predefined URL to open up the pre-installed Sola mobile application in order to process a transaction.
* The Developer provides a number of required query parameters alongside any optional query parameters.
* The Sola app will use xRedirectURL with the required parameter to deliver the results of the processed transaction back to the caller. Results are provided as query parameters, appended onto the value provided by the xRedirectURL parameter. This is a GET request.

{% hint style="info" %}
*Due to the necessity of the API key in this integration method, we strongly recommend reserving these features for integrations to be used solely on merchant-owned devices.*
{% endhint %}

## 2. Glossary <a href="#deeplinking-2.glossary" id="deeplinking-2.glossary"></a>

A list of phrases, words, and synonyms that appear in this document; along with their meaning

**Sola API**

Refers to the Sola Transaction API, which can be found at <https://docs.solapayments.com/api/transaction>

**Command**

A combination of a Payment type and a Transaction type, delimited by a semicolon. For example, cc:sale denotes a Credit Card Payment type and a sale transaction type.

**Payment type**

A type of payment, such as Credit Card (further abbreviated as “cc”), Check (further abbreviated as “check”). More payment types can be found on the Sola API site.

**Transaction type**

A type of transaction; such as Sale, AuthOnly, Capture etc. More transaction types can be found on the Sola API site.

## 3. Getting Started <a href="#deeplinking-3.gettingstarted" id="deeplinking-3.gettingstarted"></a>

Bare minimum, to integrate a mobile application capable of reacting to deep links with a website, is that the website should implement the logic that does the following:

1. Checks whether the application is installed on the mobile device or not.
2. If it’s not installed, the user is taken to the respective app store (AppStore for iOS or Google Play Store for Android).
3. if the software is installed, the target application is started.

Points 2 and 3 differ in the URLs that need to be invoked in order to achieve the described result (take the user to an app store or open the target application). Mobile browsers don’t offer an out-of-the-box API to detect if an application is installed on the device or not. As such, point 1 is the responsibility of the Developer to implement. This document assumes that the Sola app is preinstalled on a mobile device during the integration.

The Sola mobile app can be installed here:

a) Android: <https://play.google.com/store/apps/details?id=com.gateway.cardknox.android>

b) iOS: <https://apps.apple.com/us/app/cardknox-payments/id1358857120>

## 4. Deep Link Activation and Flow <a href="#deeplinking-4.deeplinkactivationandflow" id="deeplinking-4.deeplinkactivationandflow"></a>

The Sola app predefined URL is:

`dck://app.cardknox.com/transaction`

A Developer can use the predefined URL to open the Sola app in 2 ways:

1. Manually, by navigating to a predefined URL through a browser on a mobile device.
2. By having a website with an `HTML` element that can handle URLs and specifying the predefined URL on that HTML element.

> Android only - `adb` tool can be used to deep link into the app with the following code:

```
adb shell am start -a android.intent.action.VIEW -d "dck://portal.cardknox.com/cardknoxdeeplink" com.gateway.cardknox.android
```

A developer is required to pass in a couple of required parameters. These required parameters are first URL decoded and then validated by the application. Optionally, a number of optional parameters can be passed in in order to prefil the transaction process form:

```
dck://app.cardknox.com/transaction?xAmount=1.0&xKey=CardknoxSupport_Test&xRedirectURL=https://www.test.com/&xCommand=cc:sale
```

Example URL with all the required parameters and no optional parameters

### 4.1 Validation <a href="#deeplinking-4.1.validation" id="deeplinking-4.1.validation"></a>

Validation is performed on the required and optional arguments. A failing required parameters validation results in an error screen displaying which one of the required arguments is missing or is invalid.

Optional arguments are also validated, but the application will not present an error screen describing which optional parameter failed the validation. For example, the app expects the `xCVV` optional parameter to be an `int`. The app will read a query parameter named `xCVV` and try to convert its value to an `int`. Passing a `double` might break the conversion to an `int`, in which case 0 is used as the `int` default value.

Validation is done in 3 steps, where each step yields a different user interface:

1. The xRedirectURL is invalid - User is presented with a UI that indicates that the xRedirectURL is missing or the provided value is not a valid URL.
2. At least one of the required parameters is invalid - User is presented with a UI that indicates which parameter failed validation.
3. All required parameters are valid - User is presented with a UI to process a transaction.

![](/files/awsNQIoXba7IHqExoPuq)

![](/files/WDobUEXyLOQ6zDDVVuiV)

```
https://www.test.com/?xError=Required+parameter%3a+xKey&xResult=E&xStatus=Error
```

Response URL invoked by the app when only the xRedirectURL required parameter is supplied.&#x20;

![](/files/V1rTt7Z8bxz7tGtyUKBJ)

```
https://www.test.com/?xError=Required+parameter%3a+xAmount&xResult=E&xStatus=Error
```

Response URL invoked by the app when the `xRedirectURL` and `xKey` required parameters are supplied. Note that supplying the `xCommand`parameter here will not make the app validate the `xCommand` parameter as it’s being validated after `xAmount.`

![](/files/AJB7PUlVO8KX1YexbQie)

```
https://www.test.com/?xError=Required+parameter%3a+xCommand&xResult=E&xStatus=Error
```

Response URL invoked by the app when the `xRedirectURL`, `xKey` and `xAmount` required parameters are supplied.

### 4.2 Processing interface type options <a href="#id-4.2.-processing-interface-type-options" id="id-4.2.-processing-interface-type-options"></a>

The Sola app supports two user interfaces for transaction processing - one form interface (further abbreviated as “keyed screen”) and one card reader interface (further abbreviated as “swipe screen”).

Keyed screen allows processing with a card number, expiration date, cvv and other card specific information.

Swipe screen allows bluetooth pairing to a physical VP3300 card reader device, and transaction processing with card reader data readings; either with a card swipe (MSR / magnetic stripe cards) or by using the card with a chip (EMV card). The EMV card can be either tapped onto (“contactless”) or inserted into (“contact”) the VP3300 reader.

&#x20;

The app supports two **optional** query parameters to control which one, or both, of the two interfaces will be available once the app is invoked with a deep link:

* `EnableDeviceInsertSwipeTap`
  * controls the availability of the **swipe** screen
  * value type: boolean
  * possible values: **true**, **false**
  * example: `EnableDeviceInsertSwipeTap=true`
* `EnableKeyedEntry` - controls the availability of the keyed screen
  * controls the availability of the **keyed** screen
  * value type: boolean
  * possible values: **true**, **false**
  * example: `EnableKeyedEntry=true`

> When the parameter values are not parseable to an expected value type, the app treats the parameter as not being provided at all

Presence of query parameters in the deep link URL and their value controls which user interfaces should be presented, as per the following mapping:

| **EnableDeviceInsertSwipeTap** | **EnableKeyedEntry** | **Keyed UI available** | **Swipe UI available** |
| ------------------------------ | -------------------- | ---------------------- | ---------------------- |
| -                              | -                    | x                      |                        |
| true                           | -                    | x                      | x                      |
| false                          | -                    | x                      |                        |
| -                              | true                 | x                      |                        |
| -                              | false                | x                      |                        |
| true                           | true                 | x                      | x                      |
| true                           | false                |                        | x                      |
| false                          | true                 | x                      |                        |
| false                          | false                | x                      |                        |

Mapping between the presence and value of `EnableDeviceInsertSwipeTap` and `EnableKeyedEntry` query parameters. Note that “-” symbol means “the parameter was not present in the URL”. Symbol “x” means that the UI is available.

{% hint style="info" %}
To enable Device processing screen only, ensure that *EnableDeviceInsertSwipeTap > True and EnableKeyedEntry is enabled and set to false*
{% endhint %}

&#x20;

> When both keyed and swipe user interfaces are available, each one contains an UI element to navigate to the other interface

&#x20;

&#x20;

<figure><img src="/files/gm3Q2xFR3owML53qxWbQ" alt=""><figcaption><p>Example of a <strong>keyed</strong> user interface. Note that the top right corner icon navigates the user to the <strong>swipe</strong> user interface.</p></figcaption></figure>

&#x20;

<figure><img src="/files/pLakodRWKvGA7T0tSill" alt=""><figcaption><p>Example of a <strong>swipe</strong> user interface which is scanning for nearby VP3300 card reader to connect to. Note that the button on the bottom navigates the user to the <strong>keyed</strong> user interface.</p></figcaption></figure>

&#x20;

### 4.3 Transaction Processing <a href="#deeplinking-4.2.transactionprocessing" id="deeplinking-4.2.transactionprocessing"></a>

![Sola deep link - create a transaction form](/files/-MbdOMPZgokfKCFkZDwy)

The user interface provides a button to process a transaction. The required parameters on the UI are the card number, expiration date, and the amount. The amount parameter is passed in through the URL. Expiration date defaults to the current month in the current year. The card number has to be typed in or provided as an optional argument with the `xCardNum` query parameter.

After the transaction is processed, two things can happen:

1. Transaction is approved - User will see a summary of the processed transaction. User has an option to click “Done” or “Signature.” Clicking on the “Done” button opens the mobile device browser with the URL specified by the xRedirectURL parameter. Transaction details are converted into key/value pairs and appended as a query string onto the xRedirectURL value. This is a GET request.
2. Transaction resulted in an error - User will not see the processed transaction summary. User will see the error message about what went wrong in a popup. User has an option to send the response back to `xRedirectURL` by clicking on any of the 2 Send buttons.

![A successfully processed transaction summary. Clicking Done delivers the results back to the xRedirectURL URL.](/files/-MbdOMPWTpBgHrqdY2qV)

{% code title="" %}

```
https://www.test.com/?xResult=A&xStatus=Approved&xError=&xErrorCode=00000&xRefNum=441701775&xExp=0421&xDate=4%2f7%2f2021+8%3a04%3a58+AM&xAuthCode=382480&xBatch=6913571&xAvsResultCode=NNN&xAvsResult=Address%3a+No+Match+%26+5+Digit+Zip%3a+No+Match&xCvvResultCode=&xCvvResult=No+CVV+data+available&xAuthAmount=1.30&xToken=7848qp7h1qp7q8p199062qnh4h9mq2q7&xMaskedCardNumber=4xxxxxxxxxxx1111&xCardType=Visa
```

{% endcode %}

A successful transaction URL encoded response sent to the xRedirectURL

<figure><img src="/files/NMNINTYg348XExShT90g" alt=""><figcaption><p>A successfully processed transaction that resulted in an error response from the Sola API. The error is displayed ‘as is’ and the user has an option to instruct the app to deliver the Sola API response to the xRedirectURL URL</p></figcaption></figure>

```
https://www.test.com/?xResult=E&xStatus=Error&xError=Duplicate+Transaction&xErrorCode=01332&xRefNum=441702196&xExp=0421&xDate=4%2f7%2f2021+8%3a07%3a18+AM&xAuthCode=000000&xBatch=&xAvsResultCode=&xAvsResult=Unmapped+AVS+response&xCvvResultCode=&xCvvResult=No+CVV+data+available&xDuplicateAuthCode=382480&xDuplicateRefnum=441701775&xMaskedCardNumber=4xxxxxxxxxxx1111&xCardType=Visa
```

A erroneous transaction URL encoded response sent to the xRedirectURL

After the app sends the response back to the caller (by opening up the xRedirectURL in the mobile browser), the app’s UI is replaced with a full screen image displaying the Sola logo:

<figure><img src="/files/-MbdOMPUIpKHroLxG3Xj" alt=""><figcaption><p>The UI presented in the application when the app delivers the results to xRedirectURL. User navigating back to the app from the browser would see this screen</p></figcaption></figure>

### 4.4 Process Cancellation

When the user taps **Cancel** in the application, a DeepLink cancellation is processed.

| **Response** | **Value**          |
| ------------ | ------------------ |
| xError       | DeepLink Cancelled |
| xResult      | E                  |
| xStatus      | Error              |

## 5. Required Parameters <a href="#deeplinking-5.requiredparameters" id="deeplinking-5.requiredparameters"></a>

| **Name**     | **Type** | **Description**                                                                                                                                                                                                                                                                                                               | **Sample data**         | **Additional notes**                                                                         |
| ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------- |
| xKey         | string   | Sola account key                                                                                                                                                                                                                                                                                                              | Sola                    | Has to be a non-empty, non-pure-whitespace string.                                           |
| xCommand     | string   | Sola transaction type                                                                                                                                                                                                                                                                                                         | cc:sale                 | <p>Has to be lowercase.</p><p>Supported values are all values supported by the Sola API.</p> |
| xAmount      | double   | Total amount of the transaction, including tax and tip, if applicable.                                                                                                                                                                                                                                                        | 3.0                     |                                                                                              |
| xRedirectURL | URL      | <p>A URL where the Sola app delivers the results of processing a transaction.</p><p>URL needs to have a schema/protocol alongside the domain name.</p><p>Results are delivered by the app, appending the Sola API response to this value and opening the URL on the mobile device’s browser.</p><p>This is a GET request.</p> | <https://www.test.com/> |                                                                                              |

## 6. Optional parameters <a href="#deeplinking-6.optionalparameters" id="deeplinking-6.optionalparameters"></a>

| **Name**        | **Type** | **Description**                                                                                                                                                                                     | **Sample data**       |
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| xAllowDuplicate | bool     | By default, Sola rejects duplicate transactions within 10 minutes of the original transaction. This command overrides that safeguard. True/False allowed.                                           | False                 |
| xExp            | string   | The card expiration number. Format: MMYY                                                                                                                                                            | 1249                  |
| xCardNum        | string   | The customer card number.                                                                                                                                                                           | 4444333322221111      |
| xCustReceipt    | bool     | True/False value indicating if the email address specified in `xemail` should receive a receipt containing the transaction details.                                                                 | False                 |
| xEmail          | string   | The customer’s email address.                                                                                                                                                                       | <test@example.com>    |
| xCVV            | string   | 3-digit code from the back of the card (for Amex, 4-digit code from the front of the card).                                                                                                         | 123                   |
| xName           | string   | The cardholder’s name.                                                                                                                                                                              | John Doe              |
| xInvoice        | string   | The merchant’s invoice number for the transaction. `xInvoice` is recommended when available for improved duplicate handling.                                                                        | 123456A               |
| xPoNum          | int      | The merchant’s purchase order number for the transaction.                                                                                                                                           | 123485                |
| xDescription    | string   | Additional data optionally passed along for reporting.                                                                                                                                              | This is a description |
| xUserName       | string   | User’s name                                                                                                                                                                                         | John                  |
| xZip            | string   | The billing zip code of the cardholder.                                                                                                                                                             | 11111                 |
| xStreet         | string   | The billing street address of the cardholder.                                                                                                                                                       | 123 Any Street        |
| xRefNum         | double   | <p>Used to reference a previous transaction when doing a follow-up transaction, typically a refund, void, or capture.</p><p><strong>Note:</strong> <code>xRefnum</code> can be a 64-bit number.</p> | 81234568              |
| xCustom01       | string   | 3 custom fields are available for custom data, such as customer comments, etc. Use `xCustom01` through `xCustom03`.                                                                                 |                       |
| xAuthCode       | double   | `xAuthCode` is a verification number provided by the issuing bank to be used with the `cc:postauth` command.                                                                                        | T4321A                |
| xBillCity       | string   | The customer’s city for their billing profile.                                                                                                                                                      | Anytown               |
| xBillCompany    | string   | The customer’s company name for their billing profile.                                                                                                                                              | Acme                  |
| xBillCountry    | string   | The customer’s country for their billing profile.                                                                                                                                                   | USA                   |
| xBillFirstName  | string   | The customer’s first name for their billing profile.                                                                                                                                                | John                  |
| xBillLastName   | string   | The customer’s last/family name for their billing profile.                                                                                                                                          | Doe                   |
| xBillState      | string   | The customer’s state for their billing profile.                                                                                                                                                     | NY                    |
| xBillStreet     | string   | The customer’s street address for their billing profile.                                                                                                                                            | 123 Any Street        |
| xBillPhone      | string   | The customer’s phone number for their billing profile.                                                                                                                                              | 8005551212            |
| xBillZip        | string   | The customer’s zip code for their billing profile.                                                                                                                                                  | 12345                 |
| xShipCity       | string   | The customer’s city for their shipping profile.                                                                                                                                                     | Anytown               |
| xShipCompany    | string   | The customer’s company name for their shipping profile.                                                                                                                                             | Acme                  |
| xShipFirstName  | string   | The customer’s first name for their shipping profile.                                                                                                                                               | John                  |
| xShipLastName   | string   | The customer’s last/family name for their shipping profile.                                                                                                                                         | Doe                   |
| xShipState      | string   | The customer’s state for their shipping profile.                                                                                                                                                    | NY                    |
| xShipStreet     | string   | The customer’s street address for their shipping profile.                                                                                                                                           | 123 Any Street        |
| xShipPhone      | string   | The customer’s phone number for their shipping profile.                                                                                                                                             | 8005551212            |
| xShipZip        | string   | The customer’s zip code for their shipping profile.                                                                                                                                                 | 11111                 |


# Deep Linking Integration for Third-Party Websites

The following files need to be publicly accessible on the third-party’s website:

#### Android <a href="#android" id="android"></a>

* Host a publicly accessible file named `assetlinks.json` on the `/well-known/assetlinks.json` route with the following content:

```
 [
   {
      "relation":[
         "delegate_permission/common.handle_all_urls"
      ],
      "target":{
         "namespace":"android_app",
         "package_name":"com.gateway.cardknox.android",
         "sha256_cert_fingerprints":[
            "6A:2D:20:86:D4:4C:46:33:44:6A:41:35:4D:A4:91:20:82:1A:38:8E:63:05:C5:4F:CC:EC:94:36:3F:F9:35:E3"            
         ]
      }
   }
]
```

#### iOS <a href="#ios" id="ios"></a>

* Host a file named `apple-app-site-association` on the `/well-known/apple-app-site-association` route with the following content:
  * note: file should not have an extension

```
{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "QCP4TQ46S6.com.gateway.cardknox.iosapp",
                "paths": [ "/transaction/*"]
            }
        ]
    }
}
```

&#x20;


# EBT Online

## Overview

EBT (Electronic Benefits Transfer) cards allow customers to pay for food and other products through government-funded financial assistance programs. One of the largest such programs is the Supplemental Nutrition Assistance Program (SNAP). SNAP is managed by the U.S. Department of Agriculture (USDA).

To qualify for SNAP EBT online processing, retailers must meet SNAP's food stocking requirements as well as their [online purchasing requirements](https://www.fns.usda.gov/snap/retailer-requirements-provide-online-purchasing). One of the online purchasing requirements for retailers is to integrate their online shopping cart with a third-party processor that offers a digital PIN pad. Sola's EBT solution utilizes a third-party PIN pad so that EBT cardholders can securely type in their PIN online just as they would in-store. Once the customer makes a payment with their EBT card, they are able to see the remaining balance on their card and complete the transaction.

During the implementation process, keep in mind that when submitting a sale transaction, you can add up to a 10% padding to the amount if the final price needs to be adjusted upon completing the order. When completing the order, the retailer would refund the remaining amount. **Retailers must follow the refund process and not issue refunds using cash or gift cards.**

The Sample Code can be found [here](#workflow-sample-code).

{% hint style="info" %}
In order to use EBT Online, it must be activated on your account. To request activation, please contact support.
{% endhint %}

## Endpoints <a href="#ebtonlineimplementation-endpoints" id="ebtonlineimplementation-endpoints"></a>

The base URL to send transactions to is `https://x1.cardknox.com`

Additionally, the backup URL is `https://b1.cardknox.com`

\
Sola allows you to send the data in **FormData**, **JSON**, and **XML** formats.

Add to the base URL any of the following formats to indicate which format you are sending it as:

| **Format** | **Addtional URL** | **Full URL**                          |
| ---------- | ----------------- | ------------------------------------- |
| FormData   | /gateway          | <https://x1.cardknox.com/gateway>     |
| JSON       | /gatewayjson      | <https://x1.cardknox.com/gatewayjson> |
| XML        | /gatewayxml       | <https://x1.cardknox.com/gatewayxml>  |

As noted above, you can use “`https://b1.cardknox.com`" as an alternative backup URL.

## Request Method <a href="#ebtonlineimplementation-requestmethod" id="ebtonlineimplementation-requestmethod"></a>

Method: **POST**\
Sola/Cardknox Gateway requires an HTTP POST method to be used for enhanced security.\
We do not support the GET method.

## Request / Commands to the Sola/Cardknox Gateway <a href="#request-commands-to-the-cardknox-gateway" id="request-commands-to-the-cardknox-gateway"></a>

### ebtonline:initiate <a href="#ebtonline-initiate" id="ebtonline-initiate"></a>

This API call will return the information needed to redirect the user to the PIN pad.\
A PIN is needed for the `ebtonline:fssale`, `ebtonline:cbsale`, and `ebtonline:balance` commands.

| **Variable**     | **Required** | **Description**                                                                      | **Sample data**                                                                                  |
| ---------------- | ------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| xKey             | Yes          | Your Sola API Key.                                                                   | \[xkeycredentials]                                                                               |
| xVersion         | Yes          | Gateway API Version. The current version is 4.5.9                                    | 4.5.9                                                                                            |
| xSoftwareName    | Yes          | Name of your software.                                                               | \[xsoftwarecredentials]                                                                          |
| xSoftwareVersion | Yes          | Version number of your software.                                                     | \[xversioncredentials]                                                                           |
| xCommand         | Yes          | Command specifying which transaction.                                                | ebtonline:initiate                                                                               |
| xCardNum         | Yes          | The customer card number. Alternatively, `xToken` `xMagStripe` or `SUT` can be used. | 6004861944321111844                                                                              |
| xShipMethod      | Yes\*        | Denotes Shipping Method                                                              | <ul><li>DirectDelivery</li><li>CustomerPickup</li><li>CommercialShipping</li><li>Other</li></ul> |
| xShipStreet      | Yes          | The customer’s street address for their shipping profile                             | 123 Main St.                                                                                     |
| xShipStreet2     | Yes          | The customer’s street address 2nd line for their shipping profile                    | Suite 200                                                                                        |
| xShipCity        | Yes          | The customer’s city for their shipping profile                                       | Anytown                                                                                          |
| xShipState       | Yes          | The customer’s state for their shipping profile                                      | NY                                                                                               |
| xShipZip         | Yes          | The customer’s zip code for their shipping profile                                   | 10001                                                                                            |

{% hint style="info" %}
**Parameter Notes:**\
\*This field can be sent either on the initiate transaction or follow up command transaction\
\*\*Required if xShipMethod is anything other than customer pickup
{% endhint %}

***

### **ebtonline:fssale** <a href="#ebtonline-fssale" id="ebtonline-fssale"></a>

Process an EBT Online transaction to transfer funds from an EBT card to the retailer.

| **Variable**     | **Required** | **Description**                                                                                                        | **Sample data**                                                                                                                  |
| ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| xKey             | Yes          | Your Sola API Key.                                                                                                     | \[xkeycredentials]                                                                                                               |
| xVersion         | Yes          | Gateway API Version. The current version is 4.5.9                                                                      | 4.5.9                                                                                                                            |
| xSoftwareName    | Yes          | Name of your software.                                                                                                 | \[xsoftwarecredentials]                                                                                                          |
| xSoftwareVersion | Yes          | Version number of your software.                                                                                       | \[xversioncredentials]                                                                                                           |
| xCommand         | Yes          | Command specifying which transaction.                                                                                  | ebtonline:fssale                                                                                                                 |
| xAmount          | Yes          | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction. | 9.99                                                                                                                             |
| xShipFirstName   | Yes\*        | Customer’s first name for their shipping profile.                                                                      |                                                                                                                                  |
| xShipMiddleName  | Yes\*        | Customer’s middle name or initial for their shipping profile.                                                          |                                                                                                                                  |
| xShipLastName    | Yes\*        | Customer’s last/family name for their shipping profile.                                                                |                                                                                                                                  |
| xShipCompany     | Yes\*        | Customer’s company name for their shipping profile.                                                                    |                                                                                                                                  |
| xShipPhone       | No           | Customer’s phone number for their shipping profile.                                                                    |                                                                                                                                  |
| xShipMobile      | No           | Customer’s mobile number for their shipping profile.                                                                   |                                                                                                                                  |
| xRefnum          | Yes          |                                                                                                                        |                                                                                                                                  |
| xShipMethod      | Yes\*        | Denotes Shipping Method                                                                                                | <p></p><p>Supported methods:</p><ul><li>DirectDelivery</li><li>CustomerPickup</li><li>CommercialShipping</li><li>Other</li></ul> |
| xShipStreet      | Yes          | The customer’s street address for their shipping profile                                                               | 123 Main St.                                                                                                                     |
| xShipStreet2     | Yes          | The customer’s street address 2nd line for their shipping profile                                                      | Suite 200                                                                                                                        |
| xShipCity        | Yes          | The customer’s city for their shipping profile                                                                         | Anytown                                                                                                                          |
| xShipState       | Yes          | The customer’s state for their shipping profile                                                                        | NY                                                                                                                               |
| xShipZip         | Yes          | The customer’s zip code for their shipping profile                                                                     | 10001                                                                                                                            |

{% hint style="info" %}
**Parameter Notes:**\
\*This field can be sent either on the initiate transaction or follow up command transaction\
\*\*Required if xShipMethod is anything other than customer pickup
{% endhint %}

### **ebtonline:cbsale** <a href="#ebtonline-cbsale" id="ebtonline-cbsale"></a>

Process an EBT Online cash benefits transaction to transfer funds from an EBT card to the retailer.

| **Variable**     | **Required** | **Description**                                                                                                        | **Sample data**                                                                                                           |
| ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| xKey             | Yes          | Your Sola API Key.                                                                                                     | \[xkeycredentials]                                                                                                        |
| xVersion         | Yes          | Gateway API Version. The current version is 4.5.9                                                                      | 4.5.9                                                                                                                     |
| xSoftwareName    | Yes          | Name of your software.                                                                                                 | \[xsoftwarecredentials]                                                                                                   |
| xSoftwareVersion | Yes          | Version number of your software.                                                                                       | \[xversioncredentials]                                                                                                    |
| xCommand         | Yes          | Command specifying which transaction.                                                                                  | cbsale                                                                                                                    |
| xAmount          | Yes          | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction. | 9.99                                                                                                                      |
| xShipFirstName   | Yes\*        | Customer’s first name for their shipping profile.                                                                      |                                                                                                                           |
| xShipMiddleName  | Yes\*        | Customer’s middle name or initial for their shipping profile.                                                          |                                                                                                                           |
| xShipLastName    | Yes\*        | Customer’s last/family name for their shipping profile.                                                                |                                                                                                                           |
| xShipCompany     | Yes\*        | Customer’s company name for their shipping profile.                                                                    |                                                                                                                           |
| xShipPhone       | No           | Customer’s phone number for their shipping profile.                                                                    |                                                                                                                           |
| xShipMobile      | No           | Customer’s mobile number for their shipping profile.                                                                   |                                                                                                                           |
| xRefnum          | Yes          | A unique request ID.                                                                                                   |                                                                                                                           |
| xShipMethod      | Yes\*        | Shipping method.                                                                                                       | <p>Supported methods:</p><ul><li>DirectDelivery</li><li>CustomerPickup</li><li>CommercialShipping</li><li>Other</li></ul> |
| xShipStreet      | Yes          | The customer’s street address for their shipping profile                                                               | 123 Main St.                                                                                                              |
| xShipStreet2     | Yes          | The customer’s street address 2nd line for their shipping profile                                                      | Suite 200                                                                                                                 |
| xShipCity        | Yes          | The customer’s city for their shipping profile                                                                         | Anytown                                                                                                                   |
| xShipState       | Yes          | The customer’s state for their shipping profile                                                                        | NY                                                                                                                        |
| xShipZip         | Yes          | The customer’s zip code for their shipping profile                                                                     | 10001                                                                                                                     |

{% hint style="info" %}
**Parameter Notes:**\
\*This field can be sent either on the initiate transaction or follow up command transaction\
\*\*Required if xShipMethod is anything other than customer pickup
{% endhint %}

### **ebtonline:balance** <a href="#ebtonline-balance" id="ebtonline-balance"></a>

Check the available balance on an EBT card

| **Variable**     | **Required** | **Description**                                                   | **Sample data**                                                                                                           |
| ---------------- | ------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| xKey             | Yes          | Your Sola API Key.                                                | \[xkeycredentials]                                                                                                        |
| xVersion         | Yes          | Gateway API Version. The current version is 4.5.9                 | 4.5.9                                                                                                                     |
| xSoftwareName    | Yes          | Name of your software.                                            | \[xsoftwarecredentials]                                                                                                   |
| xSoftwareVersion | Yes          | Version number of your software.                                  | \[xversioncredentials]                                                                                                    |
| xCommand         | Yes          | Command specifying which transaction.                             | balance                                                                                                                   |
| xRefnum          | Yes          | A unique request ID.                                              |                                                                                                                           |
| xShipMethod      | Yes\*        | Denotes Shipping Method                                           | <p>Supported methods:</p><ul><li>DirectDelivery</li><li>CustomerPickup</li><li>CommercialShipping</li><li>Other</li></ul> |
| xShipStreet      | Yes          | The customer’s street address for their shipping profile          | 123 Main St.                                                                                                              |
| xShipStreet2     | Yes          | The customer’s street address 2nd line for their shipping profile | Suite 200                                                                                                                 |
| xShipCity        | Yes          | The customer’s city for their shipping profile                    | Anytown                                                                                                                   |
| xShipState       | Yes          | The customer's state for their shipping profile                   | NY                                                                                                                        |
| xShipZip         | Yes          | The customer’s zip code for their shipping profile                | 10001                                                                                                                     |

{% hint style="info" %}
**Parameter Notes:**\
\*This field can be sent either on the initiate transaction or follow up command transaction\
\*\*Required if xShipMethod is anything other than customer pickup
{% endhint %}

### **ebtonline:refund** <a href="#ebtonline-refund" id="ebtonline-refund"></a>

Process an EBT online refund transaction to return funds from the retailer to the cardholder.

| **Variable**     | **Required** | **Description**                                                                                                        | **Sample data**         |
| ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| xKey             | Yes          | Your Sola API Key.                                                                                                     | \[xkeycredentials]      |
| xVersion         | Yes          | Gateway API Version. The current version is 4.5.9                                                                      | 4.5.9                   |
| xSoftwareName    | Yes          | Name of your software.                                                                                                 | \[xsoftwarecredentials] |
| xSoftwareVersion | Yes          | Version number of your software.                                                                                       | \[xversioncredentials]  |
| xCommand         | Yes          | Command specifying which transaction.                                                                                  | refund                  |
| xAmount          | No           | The total amount of the transaction, inclusive of tax and tip if applicable. This the total amount of the transaction. | 9.99                    |
| xRefnum          | Yes          | A unique request ID.                                                                                                   |                         |

### **ebtonline:void** <a href="#ebtonline-void" id="ebtonline-void"></a>

Process an EBT Online void transaction to cancel out a sale.

| **Variable**     | **Required** | **Description**                                   | **Sample data**         |
| ---------------- | ------------ | ------------------------------------------------- | ----------------------- |
| xKey             | Yes          | Your Sola API Key.                                | \[xkeycredentials]      |
| xVersion         | Yes          | Gateway API Version. The current version is 4.5.9 | 4.5.9                   |
| xSoftwareName    | Yes          | Name of your software.                            | \[xsoftwarecredentials] |
| xSoftwareVersion | Yes          | Version number of your software.                  | \[xversioncredentials]  |
| xCommand         | Yes          | Command specifying which transaction.             | void                    |
| xRefnum          | Yes          | A unique request ID.                              |                         |

## Response Parameters <a href="#response-parameters" id="response-parameters"></a>

| **Variable** | **Description** | **Sample data** |
| ------------ | --------------- | --------------- |

| **Variable**           | **Description**                                                                                      | **Sample data**                      |
| ---------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------ |
| xResult                | Transaction status                                                                                   | <p>A<br>D<br>E</p>                   |
| xDate                  |                                                                                                      |                                      |
| xStatus                | Result verbiage                                                                                      | <p>Approved<br>Declined<br>Error</p> |
| xMaskedCardNumber      |                                                                                                      |                                      |
| xToken                 |                                                                                                      |                                      |
| xError                 | Error message, if applicable                                                                         |                                      |
| xRefnum                | Sola reference number                                                                                |                                      |
| xCardType              | Type of card                                                                                         | EBT                                  |
| xPinPadURL             | This field is returned on the initiate command and you would send it when redirecting to the PIN pad |                                      |
| xAccuID                | This field is returned on the initiate command and you would send it when redirecting to the PIN pad |                                      |
| xRemainingBalanceEBTCB | Indicates the remaining EBT cash benefits balance                                                    |                                      |
| xRemainingBalanceEBTFS | Indicates the remaining EBT cash benefits balance                                                    |                                      |
| xBatch                 | Batch into which transaction will settle                                                             |                                      |
| xAuthAmount            | The total amount authorized, inclusive                                                               |                                      |
| xEbtOnlineErrorMessage | Error message as received from the EBT online provider.                                              |                                      |
| xEbtOnlineErrorCode    | Error code as received from the EBT online provider.                                                 |                                      |
| xEbtOnlineResponseCode | Response code as received from the EBT online provider.                                              |                                      |

### **Response Codes**

Responses that can be returned.

| **Response Code** | **Response Message**                                                                                                                                      |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0                 |                                                                                                                                                           |
| 1                 | Missing Parameter                                                                                                                                         |
| 3                 | Invalid Merchant/Terminal                                                                                                                                 |
| 4                 | Command Not Supported                                                                                                                                     |
| 5                 | Command Not Authorized                                                                                                                                    |
| 6                 | Decline                                                                                                                                                   |
| 12                | Invalid Transaction                                                                                                                                       |
| 13                | Invalid Amount                                                                                                                                            |
| 14                | The EBT card you entered is invalid. Please try again.                                                                                                    |
| 23                | Unacceptable Transaction Fee                                                                                                                              |
| 40                | Request Not Supported                                                                                                                                     |
| 41                | The EBT card you used is restricted and cannot be used. Please call the number on the back of your card for assistance or use a different payment method. |
| 42                | Invalid Account                                                                                                                                           |
| 43                | The EBT card you used is restricted and cannot be used. Please call the number on the back of your card for assistance or use a different payment method. |
| 51                | Your SNAP (or Cash) payment failed for insufficient funds.                                                                                                |
| 54                | Expired Card                                                                                                                                              |
| 55                | The PIN you entered is incorrect. Please re-enter your PIN.                                                                                               |
| 56                | The EBT card you entered is invalid. Please try again.                                                                                                    |
| 57                | Your credit / debit card has been declined. Please try again or add a different payment method.                                                           |
| 59                | Your credit / debit card has been declined. Please try again or add a different payment method.                                                           |
| 60                | Card Acceptor Contact Acquirer                                                                                                                            |
| 61                | The refund amount requested exceeds the original sales amount.                                                                                            |
| 62                | The EBT card you used is restricted and cannot be used. Please call the number on the back of your card for assistance or use a different payment method. |
| 67                | Decline                                                                                                                                                   |
| 75                | Your card was locked after too many incorrect PIN attempts. Please call the number on the back of your card for assistance.                               |
| 76                | Key Synchronization Error                                                                                                                                 |
| 89                | CVV Failed                                                                                                                                                |
| 90                | No Account On File                                                                                                                                        |
| 92                | There has been an error while processing your PIN. Please try again.                                                                                      |
| 96                | There has been an error while processing your PIN. Please try again.                                                                                      |
| 9                 | There has been an error while processing your PIN. Please try again.                                                                                      |

### **Error Codes**

Errors that can be returned.

| **Error Code** | **Error Message**                                                  |
| -------------- | ------------------------------------------------------------------ |
| 501            | Invalid IP Address                                                 |
| 502            | Invalid User Credentials                                           |
| 503            | Request Validation Failed                                          |
| 504            | Invalid Hash Value                                                 |
| 602            | Invalid User                                                       |
| 603            | Original Transaction Not Found                                     |
| 604            | Payment provider could not read card. Please try again             |
| 605            | Track Data Error                                                   |
| 607            | RSA Token Key Error                                                |
| 608            | Tokenazation Error                                                 |
| 609            | Transaction Type can not be reversed                               |
| 610            | Invalid Currency                                                   |
| 611            | Invalid BIN                                                        |
| 612            | BIN Error                                                          |
| 616            | Merchant Descriptor Error                                          |
| 618            | Our payment solution provider is not responding. Please try again. |
| 621            | Duplicate Reference Key                                            |
| 622            | Transaction Type Not Supported                                     |
| 702            | Error With Transaction Number                                      |
| 703            | SAF Error                                                          |
| 704            | EFT Connection Error                                               |
| 712            | Declined transaction                                               |
| 713            | Our payment solution provider is not responding. Please try again. |

## PIN Pad Implementation <a href="#ebtonlineimplementation-transactionflow" id="ebtonlineimplementation-transactionflow"></a>

### Overview <a href="#overview.1" id="overview.1"></a>

After the `ebtonline:initiate` command, the Sola gateway will return the necessary pieces to render the PIN pad. The website will take care of redirecting the user to the PIN pad.\
\
To render the PIN pad redirect the consumer to the `xPinPadURL` (PaySecure) using a POST with the following parameters. Once the consumer has completed entry of their PIN, PaySecure will redirect the consumer back to your site using the URL in the `AccuReturnURL` field. PaySecure will determine the viewport (desktop or mobile) and render the PIN pad in an adaptive manner, meaning there are distinct layouts based on screen size. PaySecure does not use responsive web design as it interferes with the PIN pad functionality.

**Endpoint**: `xPinPadURL` that was returned in the initiate command

**Method**: URL Redirection

{% hint style="info" %}
This endpoint can only be called from the browser.
{% endhint %}

**Format**: FormData

### Redirect Parameters <a href="#ebtonlineimplementation-requestparameters" id="ebtonlineimplementation-requestparameters"></a>

| **Variable**            | **Description**                                                                                                                                                                                                                                                                                                                            | **Sample data**                           |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| AccuId                  | xAccuID that was returned in the initiate command                                                                                                                                                                                                                                                                                          |                                           |
| AccuReturnURL           | <p>Fully qualified retailer’s URL; PaySecure will use to redirect the user upon completion of the PIN pad.</p><p>URL encoding required</p>                                                                                                                                                                                                 |                                           |
| AccuLanguage            | Language in which the PIN pad will be displayed to the user                                                                                                                                                                                                                                                                                | <p>en-US (English)<br>es-MX (Spanish)</p> |
| \[Client Echoed Fields] | <p>You may pass additional form fields that will be passed back to your AccuReturnURL.<br></p><p>There are no restrictions on these fields, provided their names are not the same as the reserved PaySecure names. Many retailers utilize these fields to pass session IDs used to identify the user upon return to the AccuReturnURL.</p> |                                           |

***

### Response/Redirect Parameters <a href="#response-redirect-parameters" id="response-redirect-parameters"></a>

| **Variable**            | **Description**                                                                           | **Sample data**                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AccuResponseCode        | Response code from PaySecure indicating if the pin process was successful                 | <p><strong>Accu000</strong> = PIN successfully collected<br><strong>Accu200</strong> = Cardholder pressed cancel button<br><strong>Accu400</strong> = Cardholder inactivity timeout<br><strong>Accu600</strong> = Invalid data received by terminal<br><strong>Accu710</strong> = Terminal security issue<br><strong>Accu720</strong> = Terminal communication issue<br><strong>Accu730</strong> = Terminal internal error<br><strong>Accu800</strong> = General error encountered</p> |
| AccuResponseMsg         | Response message from PaySecure indicating if the pin process was successful              | see AccuResponseCode                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| AccuId                  | xAccuID that was submitted                                                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| \[Client Echoed Fields] | Fields that you sent in the Redirect Parameters to the pin pad in \[Client Echoed Fields] |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

## Workflow/Sample code <a href="#workflow-sample-code" id="workflow-sample-code"></a>

### **Overview** <a href="#overview.2" id="overview.2"></a>

`ebtonline:fssale`, `ebtonline:cbsale`, and `ebtonline:balance` transactions require the user to enter a PIN during the transaction process (for `ebtonline:refund` and `ebtonline:void` skip to step 3).&#x20;

As per the EBT requirement (certification), The PIN is not sent with the transaction to the gateway, the Acculynk PIN pad must be used. Acculynk sends the PIN directly to PaySecure and it’s identified by a unique transaction ID.

#### **1) Submit an Initiate Request**

The `ebtonline:initiate` will begin the PIN process. Sola will return the necessary pieces to render a PIN pad for the user.

**Request**

{% code lineNumbers="true" %}

```json
{
  "xKey": "xxxxxxxxxxxxxxxxxxxxxxx",
  "xVersion": "4.5.9",
  "xSoftwareName": "YourSoftwareName",
  "xSoftwareVersion": "1.0.0",
  "xCommand": "ebtonline:initiate",
  "xCardNum": "6004861944321111844",
  "xShipMethod": "CustomerPickup"
}
```

{% endcode %}

**Response**

{% code lineNumbers="true" %}

```json
{
  "xResult": "A",
  "xStatus": "Approved",
  "xError": "",
  "xErrorCode": "00000",
  "xRefNum": "600546727",
  "xAvsResultCode": "",
  "xAvsResult": "Unmapped AVS response",
  "xCvvResultCode": "",
  "xCvvResult": "No CVV data available",
  "xMaskedCardNumber": "6xxxxxxxxxxxxxx1844",
  "xCardType": "EBT",
  "xToken": "hp6h31h29phnh6p48pm6024mp8278q96",
  "xInternalID": "5c3d7ba7-80d4-4437-b4cb-c259cf0757c6",
  "xPinPadURL": "https://test.paysecure.acculynk.net/PINpad",
  "xAccuID": "ce8da934-fe7c-47f4-90bd-46fd0e3ff99e",
  "xMID": "xxxxxxxxxxxTest",
  "xDate": "3/1/2022 12:51:52 PM",
  "xEntryMethod": "Keyed",
  "xRemainingBalanceEBTCB": "0.00",
  "xRemainingBalanceEBTFS": "0.00",
  "xEbtOnlineErrorCode": "00",
  "xEbtOnlineErrorMessage": "SUCCESS"
}
```

{% endcode %}

#### **2)  Redirect the user to the PIN pad**

Redirect the user to the `xPinPadURL` for the user to enter their pin.<br>

**Request**

{% code lineNumbers="true" %}

```html
<form action="https://test.paysecure.acculynk.net/PINpad" method="post">
    <label>AccuId:</label>
    <input type="text" id="AccuId" name="AccuId" value="">
    <label>AccuReturnURL:</label>
    <input type="text" id="AccuReturnURL" name="AccuReturnURL" value="">
    <label>AccuLanguage:</label>
    <input type="text" id="AccuLanguage" name="AccuLanguage" value="en-US">
    <input type="submit" value="Submit">
</form>
```

{% endcode %}

**Response**

{% code lineNumbers="true" %}

```
AccuLanguage=en-US&
AccuId=ce8da934-fe7c-47f4-90bd-46fd0e3ff99e&
AccuResponseCode=ACCU000&
AccuResponseMsg=SUCCESS
```

{% endcode %}

#### **3) Submit the final command to the gateway**

\
Once the user is redirected back to your site with the response code `Accu000` submit the final request (`ebtonline:fssale`, `ebtonline:cbsale`, or `ebtonline:balance`) to the Sola gateway to complete the transaction. If you receive any other response code, allow the user to try again or cancel the transaction.\
\
**Request**

{% code lineNumbers="true" %}

```json
{
  "xKey": "xxxxxxxxxxxxxxxxxxxxxxx",
  "xVersion": "4.5.9",
  "xSoftwareName": "YourSoftwareName",
  "xSoftwareVersion": "1.0.0",
  "xCommand": "ebtonline:fssale",
  "xAmount": "1",
  "xRefNum": "123456789"
}
```

{% endcode %}

**Response**

{% code lineNumbers="true" %}

```json
{
  "xResult": "A",
  "xStatus": "Approved",
  "xError": "",
  "xErrorCode": "00000",
  "xRefNum": "600548315",
  "xAuthCode": "452251",
  "xBatch": "6329524",
  "xAvsResultCode": "",
  "xAvsResult": "Unmapped AVS response",
  "xCvvResultCode": "",
  "xCvvResult": "No CVV data available",
  "xAuthAmount": "1.00",
  "xMaskedCardNumber": "6xxxxxxxxxxxxxx1844",
  "xCardType": "EBT",
  "xMID": "xxxxxxxxxxxTest",
  "xDate": "3/1/2022 12:54:39 PM",
  "xEntryMethod": "Unknown",
  "xRemainingBalanceEBTCB": "932.62",
  "xRemainingBalanceEBTFS": "235.25",
  "xEbtOnlineResponseCode": "00",
  "xEbtOnlineErrorCode": "00",
  "xEbtOnlineErrorMessage": "SUCCESS"
}
```

{% endcode %}

## Test Cards

| **Test Card**       | **Response Code** | **Error Message**              |
| ------------------- | ----------------- | ------------------------------ |
| 6004861944321111844 | 0                 | (Approved)                     |
|                     | 1                 | Missing parameter              |
|                     | 3                 | Invalid merchant/terminal      |
| 6104341675219380    | 4                 | Command not supported          |
| 6104341397212234    | 5                 | Command not authorized         |
| 6104342085618120    | 6                 | Decline                        |
| 6004861835913142835 | 41                | Decline                        |
| 6004861659118294500 | 43                | Decline                        |
| 6104341476018981    | 57                | Decline                        |
| 6004861674715978348 | 59                | Decline                        |
| 6004861469721133669 | 67                | Decline                        |
| 6104341094217098    | 12                | Invalid transaction            |
| 6104341339116774    | 13                | Invalid amount                 |
| 6104342179210040    | 14                | Invalid card number            |
| 6004861283711548772 | 15                | Invalid card                   |
| 6004861936221520819 | 23                | Unacceptable transaction fee   |
|                     | 40                | Request not supported          |
| 6104341157820259    | 42                | Invalid account                |
| 6004861118116374806 | 51                | Insufficient funds             |
| 6104342148913849    | 54                | Expired card                   |
| 6104341215511833    | 55                | Incorrect PIN                  |
| 6004861487521029713 | 56                | Invalid card                   |
| 6004861804921225354 | 60                | Card acceptor contact acquirer |
| 6104341821716867    | 61                | Exceeds withdrawal limit       |
| 6104341606718450    | 62                | Restricted card                |
| 6104341108310343    | 75                | PIN tries exceeded             |
| 6004861908615095260 | 76                | Key synchronization error      |
| 6004861170115289659 | 89                | CVV failed                     |
|                     | 90                | No account on file             |
| 6004861035618530794 | 92                | System error                   |
| 6004861904512646719 | 96                | System error                   |
| 6004861141211040767 | 99                | System error                   |

***

## Frequently Asked Questions <a href="#frequently-asked-questions" id="frequently-asked-questions"></a>

<details>

<summary><strong>Can I view the EBT online commands in</strong> Sola <strong>reporting?</strong></summary>

The initiate and balance commands are available for internal users in the `report:log` and sale commands are available in all reports.

</details>

<details>

<summary><strong>What's the difference between a void and a refund?</strong></summary>

The void command voids the entire transaction, so no amount is allowed; a refund can partially refund the transaction, so an amount is allowed.

</details>

<details>

<summary><strong>Can I use a token instead of a card number for the initiate?</strong></summary>

Yes

</details>

<details>

<summary><strong>Are partial approvals supported?</strong></summary>

No

</details>

<details>

<summary><strong>Is there a separate command for food stamps and cash benefits?</strong></summary>

For balance, refund, and void, there is no need to specify. For sales, there is a separate command for food stamps (`ebtonline:fssale`) and cash benefits (`ebtonline:cbsale`).

</details>


# Gateway Emulators

## Overview <a href="#authorize.net-aim" id="authorize.net-aim"></a>

Sola gateway emulators translate third-party payment gateway APIs into the Cardknox/Sola gateway API. This allows transactions to be routed through the existing gateway to Sola without having to build a full integration using the Sola API.

Sola offers gateway emulators for Authorize.Net and USAePay.

To use gateway emulators, you will need to enter in your Sola key and change the gateway URL to Sola's gateway emulator URL.

## [Authorize.net](http://authorize.net/) (AIM) <a href="#authorize.net-aim" id="authorize.net-aim"></a>

Endpoint URL: <https://x1.cardknox.com/authorize>

Use your Sola key as the login ID and transaction key.

API Login ID: First half of Sola key

Transaction Key: Second half of Sola key

{% hint style="info" %}
Please note that we only emulate the AIM method.
{% endhint %}

**Split Your Key:**

Split your key by using [the tool here](https://www.cardknox.com/split-tool/).

## USAePay <a href="#usaepay" id="usaepay"></a>

Endpoint URL: <https://x1.cardknox.com/gate><br>

Use your Cardknox key as the UMkey.

## PayTrace <a href="#paytrace" id="paytrace"></a>

Endpoint URL: <https://x1.cardknox.com/paytrace>


# iFields

## Overview <a href="#overview" id="overview"></a>

iFields is a Sola technology that integrates into your payment forms, giving you the ability to design and customize the look and feel of your payment and checkout flows without having to worry about PCI compliance.

Payment forms that leverage iFields technology keep sensitive card data away from merchant servers,  keeping you outside of PCI compliance territory. Information that's entered into the standard card number and CVV input fields are sent directly to the Sola gateway via iframes. The gateway immediately returns SUTs (single-use tokens,  also referred to as payment nonces) in place of the card and CVV numbers, that are used by the server-side code for processing the transaction.\
\
Here is an example of how the iframes work, and the SUTs they return.

## Workflow <a href="#workflow" id="workflow"></a>

Let's get started by understanding the difference between how card information flows through an API-only integration versus one that utilizes iFields.

### API-Only <a href="#api-only" id="api-only"></a>

* The customer enters the credit card information into an `<input>` field on the website checkout page, submitting the data to the website server.
* The server sends an HTTP POST request with the transaction information to the Sola gateway for processing using the Sola API.
* Sola sends the response back through the server, which forwards it and displays it on the website.

See [Transaction API - Request Method](https://docs.cardknox.com/api/transaction) for more information about request methods.

![](/files/-MguuczhtODXlwfBHQuJ)

### API and iFields <a href="#api-and-ifields" id="api-and-ifields"></a>

* The customer enters the credit card information into an `<iframe>` field on the website checkout page, submitting the data to Cardknox CDN.
* Sola CDN returns the single-use token (SUT) into a hidden `<input>` field of the website checkout page, which submits the data to the website server.
* The server sends an HTTP POST request with the transaction information to the Sola gateway for processing using the Sola API with the SUT as xCardNum.
* Sola sends the response back through the server, which forwards and displays it on the website. Sola gateway includes an xToken in the response, enabling the merchant to use the xToken to send in any future transactions for that customer.

See [Transaction API - Tokenization](https://docs.cardknox.com/api/transaction#tokenization) for more information about tokenization.

![](/files/-MguvUJ938cGqpwqdcnf)

## Getting Started <a href="#overview" id="overview"></a>

To use iFields, you’ll need two Sola keys:\
1\. Your iFields key, which is the public-facing key used in the Javascript\
2\. Your private Sola merchant key

**The Sola iFields key (public-facing key) is for the client-side transaction.**\
**The Sola transaction key is for the server-side transaction.**

**Important note**\
The iFields solution accomplishes the goal of generating a SUT in place of the card number that will then be sent to your server.  A transaction cannot be processed with iFields alone. Once your server obtains the SUT, you'll need to use our Transaction API to send a server-side command to process a transaction. The card number SUT should be sent as `"xCardNum"` and the CVV SUT should be sent as `"xCVV"`.\
See [Transaction API](/api/transaction) for the server-side commands.

## Frameworks <a href="#initiate-ifields" id="initiate-ifields"></a>

If you use one of the following frameworks, you can set up the iFields integration more easily:

[Npm: React](https://www.npmjs.com/package/@cardknox/react-ifields)\
[Npm: Angular](https://www.npmjs.com/package/@cardknox/angular-ifields)\
[Npm: Vue](https://www.npmjs.com/package/@cardknox/vue-cardknox-ifields)

## Initiate iFields <a href="#initiate-ifields" id="initiate-ifields"></a>

[See Full Working Example](https://codepen.io/cardknox/pen/Bajdzvv)

### Step 1 <a href="#step-1" id="step-1"></a>

Find the latest version of iFields at: <https://cdn.cardknox.com/ifields/versions.htm>

Add the Cardknox JS file after the \<head> tag on your payment page:

```markup
<script src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifields.min.js" />
```

Then, add the `setAccount()` function with the three required parameters which should be called on page load:

| **Parameter**    | **Description**                                                                                                                                                                                                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| iFields key      | <p>Your iFields key<br>Use the iFields key that matches the account that you will submit the transaction to. Ensure you are using the correct key as this does not get validated on the front end.<br><strong>Attention:</strong> Do NOT use your API key here, as it will be exposed.</p> |
| Software name    | Name of your software                                                                                                                                                                                                                                                                      |
| Software version | Version number of your software                                                                                                                                                                                                                                                            |

```
setAccount("iFields key", "Software name", "Software version")
```

### Step &#x32;**:** HTML <a href="#step-2-html" id="step-2-html"></a>

In addition to the standard fields necessary for non-sensitive card data, the html should include four additional fields for the form; two fields for the credit card number; and two for the CVV. The first set of fields are iFrame fields to collect the sensitive information, and the second set are hidden input fields that are populated with the SUTs once they are returned by the gateway.

Adding the fields:

First, add these three fields to your form to collect the sensitive card data:

```markup
<iframe data-ifields-id="ach" data-ifields-placeholder="Checking Account Number" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifield.htm"></iframe> 
<iframe data-ifields-id="card-number" data-ifields-placeholder="Card Number" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifield.htm"></iframe> 
<iframe data-ifields-id="cvv" data-ifields-placeholder="CVV" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifield.htm" ></iframe>
```

**Attention: Be sure to replace the \*\*ifields-version-number\*\* text with the appropriate iFields version number. Get the latest version of iFields at** [**https://cdn.cardknox.com/ifields/versions.htm**](https://cdn.cardknox.com/ifields/versions.htm)**.**

Next, add the following two fields that will be populated with the SUTs once the gateway returns them:

```markup
<input name="xACH" data-ifields-id="ach-token" type="hidden" /> 
<input name="xCVV" type="hidden" data-ifields-id="cvv-token" /> 
<input name="xCardNum" type="hidden" data-ifields-id="card-number-token" />
```

Finally, add this field for error handling:

```markup
<label data-ifields-id="card-data-error" style="color: red;"></label>
```

Full Sample HTML:

```javascript
<head>
    <script src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifields.min.js" />
</head>
<body>
     
<form id=”payment-form”>
        <iframe data-ifields-id="ach" data-ifields-placeholder="Checking Account Number" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifield.htm"></iframe>
        <input data-ifields-id="ach-token" name="xACH" type="hidden" />
        <iframe data-ifields-id="card-number" data-ifields-placeholder="Card Number" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifield.htm"></iframe>
        <input data-ifields-id="card-number-token" name="xCardNum" type="hidden" >
        <iframe data-ifields-id="cvv" data-ifields-placeholder="CVV" src="https://cdn.cardknox.com/ifields/**ifields-version-number**/ifield.htm" ></iframe>
        <input data-ifields-id="cvv-token" name="xCVV" type="hidden" >
 
        <!--And a field for all errors from the iFields-->
        <label id="transaction-status"></label>
        <label data-ifields-id="card-data-error" style="color: red;"></label>
 
        <!--Submit button-->
        <input id="submit-btn" type="submit" value="Submit">
    </form>
 
</body>
```

### Step 3: JavaScript <a href="#step-3-js" id="step-3-js"></a>

Attach an event listener to submit event of the form (in our example #payment-form) that contains the following:

A call to the `getTokens()` function that will pass in a callback to receive the SUTs and populate the hidden fields with them, and then submit the form with all the transaction details to your server-side code for processing. For a full list of server-side calls, see our [API docs](https://kb.cardknox.com/api).

```javascript
setAccount("your-public-facing-key", "your-software-name", "0.1.2");
document.getElementById('payment-form').addEventListener('submit', function(e){
    e.preventDefault();
    var submitBtn = document.getElementById('submit-btn');
    submitBtn.disabled = true;
    getTokens(
        function() { 
            document.getElementById('payment-form').submit();
        },
        function() { //onError
            submitBtn.disabled = false;
        },
        30000, //30 second timeout
    );
});
```

### 3D Secure Authentication with iFields <a href="#ifields-with-3d-secure-authentication" id="ifields-with-3d-secure-authentication"></a>

(Available starting in version 2.14)

Enhance your payment security and protect against fraud by enabling **3D Secure Authentication (3DS)** in your iFields integration. This requires both **client-side** and [**server-side**](https://docs.solapayments.com/api/transaction/3ds) handling.

#### Step 1: Enable 3D Secure on the Client Side <a href="#step-1-enable-3d-secure-on-the-client-side" id="step-1-enable-3d-secure-on-the-client-side"></a>

Call the `enable3DS()` function during page load to initialize 3DS. This function takes two required parameters:

**Function**: `enable3DS(environment, verifyHandler)`

**Parameters:**

| **Parameter** | **Type** | **Description**                                                                                                                                                                                                                                | **Required?** |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| environment   | String   | Use staging for testing or production for live implementations.                                                                                                                                                                                | Y             |
| verifyHandler | Function | Callback function that handles the 3DS result and sends it to your server. Your server should finalize the transaction by submitting the 3DS result to our API. See [**server-side**](https://docs.solapayments.com/api/transaction/3ds) code. | Y             |

**`verifyHandler` Callback**

When the 3DS challenge popup completes, the `verifyHandler` function is triggered with these parameters:

| **Parameter**                   | **Description**                               |
| ------------------------------- | --------------------------------------------- |
| x3dsActionCode                  | The 3DS action code result.                   |
| xCavv                           | Cardholder Authentication Verification Value. |
| xEci                            | Electronic Commerce Indicator.                |
| xRefNum                         | Transaction reference number.                 |
| x3dsAuthenticationStatus        | Status of the authentication attempt.         |
| x3dsSignatureVerificationStatus | Result of the digital signature verification. |

**Sample code:**

{% code lineNumbers="true" %}

```javascript
// Enable 3D Secure (3DS)
enable3DS('staging', verifyHandler); // or 'production'

function verifyHandler(x3dsActionCode, xCavv, xEci, xRefNum, x3dsAuthenticationStatus, x3dsSignatureVerificationStatus) {
    // Prepare authentication result data
    const postData = {
        x3dsActionCode,
        xCavv,
        xEci,
        xRefNum,
        x3dsAuthenticationStatus,
        x3dsSignatureVerificationStatus
    };

    // Send to your server and finalize the transaction
}
```

{% endcode %}

See [**server-side**](https://docs.solapayments.com/api/transaction/3ds) code how to finalize the transaction.

#### Step 2: Check Server Response for 3DS Challenge <a href="#step-2-check-server-response-for-3ds-challenge" id="step-2-check-server-response-for-3ds-challenge"></a>

After submitting a payment to the [transaction API](https://docs.solapayments.com/api/transaction), the response will include an `xResult` value that indicates the status:

`A`**,** `E`**, or** `D` — Transaction complete. No further 3DS action is needed.

`V` — A 3DS challenge is required. You must initiate the challenge step by calling `verify3DS()`.

In a case where the **xResult** is **V**, 3D Secure authentication must be completed through a challenge popup. To proceed, call the `verify3DS()` function and pass the entire transaction response object.

#### `verify3DS(transactionResponse)` <a href="#verify3ds-transactionresponse" id="verify3ds-transactionresponse"></a>

| Parameter           | Type   | Description                                                          |
| ------------------- | ------ | -------------------------------------------------------------------- |
| transactionResponse | Object | The full transaction response from your initial server-side request. |

**Sample Code**:

```
if (transactionResponse.xResult === 'V') {
    // Triggers the 3DS challenge popup
    verify3DS(transactionResponse);
} else {
    // No additional 3DS action needed
    console.log("Transaction complete.");
}
```

## iFields Features <a href="#ifield-features" id="ifield-features"></a>

### Setting iFields Styles <a href="#setting-ifield-styles" id="setting-ifield-styles"></a>

Added in version 2.2\
A style can be set for each iFields by calling the `setIfieldStyle()` function and passing in the `data-ifields-id` value (card-number or cvv) and the JSON with the styles to set.<br>

Each field can be given its own style or use a shared variable to set them all to look the same.

\
**Parameters:**

| **Parameter** | **Description**                                                            | **Required?** |
| ------------- | -------------------------------------------------------------------------- | ------------- |
| iFieldName    | The name of the iFields to style (valid names are ‘card-number’ or ‘cvv’). | Y             |

\
**Sample Code:**

```markup
let style = {
    border: '1px solid black',
    font-size: '14px',
    padding: '3px',
    width: '250px'
};
setIfieldStyle('card-number', style);
setIfieldStyle('cvv', style);
```

### Clear iFields <a href="#clear-ifield" id="clear-ifield"></a>

Added in version 2.2\
You can clear the data inside an iFields by calling clearIfield(ifieldName).

\
**Parameters:**

| **Parameter** | **Description**                                                            | **Required?** |
| ------------- | -------------------------------------------------------------------------- | ------------- |
| ifieldName    | The name of the iFields to style (valid names are ‘card-number’ or ‘cvv’). | Y             |

\
**Sample Code:**

```markup
cleariField(‘cvv’);
```

### Auto Format iFields Data <a href="#auto-format-ifield-data" id="auto-format-ifield-data"></a>

Added in version 2.3\
You can allow auto-formatting of the data in the card number field by calling `enableAutoFormat(separator)`.

\
**Parameters:**

| **Parameter** | **Description**                                                                                                                                                  | **Required?** |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| Separator     | This is the separation character to place between number groups. The default separator is a space. Only a single character should be passed in as the separator. | N             |

\
**Sample Code:**

```javascript
enableAutoFormatting(‘-‘); will show 4444-3333-2222-1111
```

### Focus iFields <a href="#focus-ifield" id="focus-ifield"></a>

Added in version 2.3\
You can set focus on an iFields. A common use case for this is if you want the iframes to be focused after page load.<br>

**Paramaters:**

| **Parameter** | **Description**                                                            | **Required?** |
| ------------- | -------------------------------------------------------------------------- | ------------- |
| iFieldName    | The name of the iFields to style (valid names are ‘card-number’ or ‘cvv’). | Y             |

\
**Sample Code:**

```javascript
focusIfield(‘card-number’);
```

### iFields Key Pressed Callback <a href="#ifield-key-pressed-callback" id="ifield-key-pressed-callback"></a>

*Added in version 2.3*<br>

You can create a reaction to the changing of data in the iFields as the user types by registering a callback using `addiFieldKeyPressCallback(callbackFunction)`. The callback function can accept a parameter that passes in a JSON object. That object contains non-sensitive information about the data contained in the iFields, such as the validity of the card number/CVV; the length of the data entered; the issuer of the entered card number; and which iFields last had text entered into it. This function can be called multiple times to add multiple callbacks.

\
**Parameters:**

| **Parameter**    | **Description**                                               | **Required?** |
| ---------------- | ------------------------------------------------------------- | ------------- |
| callbackFunction | The function to call after the text in an iFields is changed. | Y             |

\
**Sample Code:**

```javascript
addIfieldKeyPressCallback(function(data) {
    console.log('card number is ' + (data.cardNumberIsValid ? 'valid' : 'invalid');
});
```

```javascript
addIfieldKeyPressCallback(function(data) {
                    setIfieldStyle('card-number', data.cardNumberFormattedLength <= 0 ? defaultStyle : data.cardNumberIsValid ? validStyle : invalidStyle);
                    if (data.lastIfieldChanged === 'cvv'){
                        setIfieldStyle('cvv', data.issuer === 'unknown' || data.cvvLength <= 0 ? defaultStyle : data.cvvIsValid ? validStyle : invalidStyle);
                    } else if (data.lastIfieldChanged === 'card-number') {
                        if (data.issuer === 'unknown' || data.cvvLength <= 0) {
                            setIfieldStyle('cvv', defaultStyle);
                        } else if (data.issuer === 'amex'){
                            setIfieldStyle('cvv', data.cvvLength === 4 ? validStyle : invalidStyle);
                        } else {
                            setIfieldStyle('cvv', data.cvvLength === 3 ? validStyle : invalidStyle);
                        }
                    } else if (data.lastIfieldChanged === 'ach') {
                        setIfieldStyle('ach',  data.achLength === 0 ? defaultStyle : data.achIsValid ? validStyle : invalidStyle);
                    }
                });
```

### Global iFields Key <a href="#global-ifields-key" id="global-ifields-key"></a>

Developers who use multiple keys in their software can eliminate the need to collect a new iFields key from each merchant by using the Vendor ID feature.

Once this feature is enabled by a Sola Support team, the developer is free to use the same iFields key for all transactions. They just need to add an extra parameter to all transactions using the SUTs that were generated with the global iFields key.

The Vendor ID can also be configured to supply a default Software Name.

| **Parameter** | **Description**                                                                                                                                                                                                                                           | **Sample** |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| xVendorId     | The parameter that tells the gateway which developer is performing the transaction. If the value matches the account of the iFields key, the gateway will allow the transaction to work even though the API and iFields keys are from different accounts. | 123456     |

**Sample Code:**

```json
{
  "xCommand": "cc:sale",
  "xSoftwareVersion": "1.0.0",
  "xVersion": "5.0.0",
  "xSoftwareName": "Cardknox Test",
  "xKey": "test1",
  "xAmount": "1",
  "xCardnum": "4000000000001111;sut_02_1_cc_visa_keyed_01_20230417T134931Z_7200_hf-jrfg-2_e949b687b122457da8513f81d175ced2_e9b71c6bf1125748a6362ae90f28ed9f5024bedf438a7c3046ec1a1ccd226958",
  "xCvv": "xxx;sut_xx_x_cvv_xx_xxxxxxxxTxxxxxxZ_xxxx_hf-jrfg-x_xxcxbfxaxxxxxxxcxxxxaxexxxxefxac_bbxxfxdxecaxxcxxexxxxxxxxaxdxxxxcdxxxfxxxfaxxfxxxxxxdcaxxxaxxbax",
  "xExp": "1234",
  "xVendorId": "123456"
}
```

<br>


# Angular iFields

## Overview

Our component for the Angular framework simplifies the iFields integration process. This integration allows you to build forms with secure payment fields, giving you the ability to design and customize the look and feel of your payment and checkout flows without having to worry about PCI compliance.

**Sandbox:** To request a Sandbox account, please reach out to <support@solapayments.com>.

**iFields:** [Fields](https://www.cardknox.com/ifields/)

A sandbox or live account is required to use this component.

## Inputs <a href="#inputs" id="inputs"></a>

There are 2 basic inputs required to get this up and running:

#### 1. Type <a href="#id-1.-type" id="id-1.-type"></a>

There are three types of payment data that iFields supports:

* Credit Card
* CVV
* ACH

```
    <cardknox-ifields [type]="CARD"></cardknox-ifields>
```

The possible values for this property are:

* card
* CVV
* ACH

These can be imported from the component.

```
    import { ACH_TYPE, CARD_TYPE, CVV_TYPE, AngularIfieldsComponent } from '@cardknox/angular-ifields';
    /**...*/
    CARD = CARD_TYPE;
```

#### 2. Account <a href="#id-2.-account" id="id-2.-account"></a>

Pass your [iFields key](https://www.cardknox.com/ifields/) to the component in the **account** input like this:

```
<cardknox-ifields [account]="account"></cardknox-ifields>
    
    /**...*/

    account = {
        xKey: '{Your iFields key}',
        xSoftwareName: '{The name of your app}',
        xSoftwareVersion: '{Your app's version}'
    }
```

Events:

There are 2 lifecycle events and 7 user events.

### Lifecycle events <a href="#lifecycle-events" id="lifecycle-events"></a>

#### 1. Load <a href="#id-1.-load" id="id-1.-load"></a>

Is emitted when the iFrame has loaded.

`1` `<cardknox-ifields (load)="onLoad"></cardknox-ifields>`

#### 2. Token <a href="#id-2.-token" id="id-2.-token"></a>

Is emitted when a token is received from the iField.

`1` `<cardknox-ifields (token)="onToken"></cardknox-ifields>`

### User events <a href="#user-events" id="user-events"></a>

User events are events passed along from iFields when the user interacts with it.

The available events are:

1. click
2. dblclick
3. focus
4. blur
5. input
6. change
7. submit\*

\* the submit event works slightly differently, see below.

#### Update <a href="#update" id="update"></a>

Aside from submit, the above events can be collected on a single event `update`. This is **not** recommended as it will cause an unnecessary amount of function calls. Instead, subscribe only to the events you want to act on.

The event [payload](https://www.npmjs.com/package/@cardknox/angular-ifields) is in `e.data`. The data also contains the event so you can subscribe to multiple events with a single function and a `switch` statement, like this:

```
<cardknox-ifields (update)="onUpdate($event)"></cardknox-ifields>

    /**...*/

    onUpdate({ data }) {
        switch (data.event) {
            case 'input':
                console.log("input event received");
                break;
            case 'click':
                console.log("click event received");
                break;
        }
    }
```

#### Submit <a href="#submit" id="submit"></a>

This event is triggered when the user submits the form from within the iFrame.

This event works differently from other user events.

* This event is only emitted if prop `options.autoSubmit` is true. (this is the default).
* Subscribing to `update` will not, work as mentioned above.
* The data passed along with this event is slightly different (see below).

```
<form id="form">
        <cardknox-ifields [options]="options"></cardknox-ifields>
    </form>

    /**...*/
    
    options = {
        autoSubmit: true,
        autoSubmitFormId: 'form'
    }
```

It is also possible to have the component automatically submit the form for you when *submit* is triggered from the iFrame. If `autoSubmitFormId` is set on the options prop, the component will call submit on the element with that ID. This is useful for smaller applications relying on the form element to handle submission.

```
<form id="form">
        <cardknox-ifields [options]="options"></cardknox-ifields>
    </form>

    /**...*/
    
    options = {
        autoSubmit: true,
        autoSubmitFormId: 'form'
    }
```

### Error <a href="#error" id="error"></a>

There is also an error event that can be subscribed to.

## Actions <a href="#actions" id="actions"></a>

There are 3 actions available on this component as well:

### Focus <a href="#focus" id="focus"></a>

`focusIfield`

This action will set the focus to the iField when called.

### Clear <a href="#clear" id="clear"></a>

`clearIfield`

This action will clear the data from the iField when called.

### Get Token <a href="#get-token" id="get-token"></a>

`getToken`

This action will load the token for the iField when called.

```
<cardknox-ifields #card></cardknox-ifields>

  @ViewChild('card') cardIfield?: AngularIfieldsComponent;

  this.cardIfield.focusIfield();
  this.cardIfield.clearIfield();
  this.cardIfield.getToken();
```

## Inputs <a href="#inputs.1" id="inputs.1"></a>

| Name    | Type                                                               | Description  | Valid values                                   |
| ------- | ------------------------------------------------------------------ | ------------ | ---------------------------------------------- |
| type    | String                                                             | iFields type | <ul><li>card</li><li>cvv</li><li>ach</li></ul> |
| account | [Account](https://www.npmjs.com/package/@cardknox/angular-ifields) |              |                                                |
| options | [Options](https://www.npmjs.com/package/@cardknox/angular-ifields) |              |                                                |
| threeDS | [ThreeDS](https://www.npmjs.com/package/@cardknox/angular-ifields) |              |                                                |
| issuer  | String                                                             | Card issuer  | For cvv iField only                            |

### Account <a href="#account" id="account"></a>

| Name             | Type   | Description      |
| ---------------- | ------ | ---------------- |
| xKey             | String | iFields key      |
| xSoftwareName    | String | Software name    |
| xSoftwareVersion | String | Software version |

### Options <a href="#options" id="options"></a>

| Name                | Type    | Description                                                                                                                                            |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| enableLogging       | Boolean | Turn iField logs to the console on and off                                                                                                             |
| autoFormat          | Boolean | Turn iField auto-formatting on and off. This is only used for iFields of *card* type. See *autoFormatSeparator*                                        |
| autoFormatSeparator | String  | A string to be used to auto-format card numbers when *autoFormat* is turned on. The default value is " " (space).                                      |
| autoSubmit          | Boolean | Turn on capturing a submit event triggered from within the iFrame. Default is `true`.                                                                  |
| autoSubmitFormId    | String  | If autoSubmit is true, the ID of a form element can be set and the component will trigger *submit* on the form when submit is triggered in the iFrame. |
| placeholder         | String  | Text to be used as *placeholder* text for the input field.                                                                                             |
| iFieldstyle         | Object  | A style object to be used to style the iFields input element. This object is assigned to **HTMLElement.style**.                                        |

### ThreeDS <a href="#threeds" id="threeds"></a>

| Name                   | Type    | Description                                                                                 |
| ---------------------- | ------- | ------------------------------------------------------------------------------------------- |
| enable3DS              | Boolean | Turn 3DSecure on and off                                                                    |
| waitForResponse        | Boolean | Determine whether iFields should wait for a response from 3DSecure before getting the token |
| waitForResponseTimeout | Number  | The 3DSecure response timeout in milli-seconds. The default value is 2000 (2 seconds).      |
| amount                 | Number  | The transaction amount                                                                      |
| month                  | Number  | The 2-digit card expiration month                                                           |
| year                   | Number  | The 2-digit card expiration year                                                            |

### Update Event Data <a href="#update-event-data" id="update-event-data"></a>

| Name                   | Type    | Description                                                                                 |
| ---------------------- | ------- | ------------------------------------------------------------------------------------------- |
| enable3DS              | Boolean | Turn 3DSecure on and off                                                                    |
| waitForResponse        | Boolean | Determine whether iFields should wait for a response from 3DSecure before getting the token |
| waitForResponseTimeout | Number  | The 3DSecure response timeout in milli-seconds. The default value is 2000 (2 seconds).      |
| amount                 | Number  | The transaction amount                                                                      |
| month                  | Number  | The 2-digit card expiration month                                                           |
| year                   | Number  | The 2-digit card expiration year                                                            |

### Error Data <a href="#error-data" id="error-data"></a>

| Name         | Type   | Description                                |
| ------------ | ------ | ------------------------------------------ |
| result       | String | This will always have the value of `error` |
| errorMessage | String | Contains the error message                 |
| xTokenType   | String | Either card, cvv, or ach                   |

**iFields Version:** [2.6.2006.0102](https://cdn.cardknox.com/ifields/versions.htm)


# PaymentSITE

## Overview

PaymentSITE is a hosted payment page that can be integrated into a merchant’s system to process payments. Upon accessing the PaymentSITE, either where it is embedded or via a standalone URL, the customer can enter their payment details and any other relevant information like their name, address, and phone number. PaymentSITE tokenizes all card data and keeps the merchant out of scope for PCI compliance.

The most popular form integration flow for developers is to build their own secure form with [iFields](/products/ifields) for the user to enter their information, and then submit the transaction via our [Transaction API](/api/transaction). By doing so, the developer maintains full control over the UI and behavior of the integration. When using a PaymentSITE, the developer gives up much control and is limited to whatever is supported by PaymentSITE.

The advantage of PaymentSITE is that it is a quicker and easier implementation since the developer does not need to build the secure payment form and API calls directly. In addition, the user can utilize PaymentSITE’s built-in features and customizations without the developer needing to do additional work.

{% hint style="info" %}
PaymentSITE use requires initial sign-up. To get more information or sign-up, contact support.
{% endhint %}

## Getting started

### Transaction types

The PaymentSite can be configured to process various different payment types: `Sale` , `AuthOnly` , and `Save`. For more details on what each of these commands is used for see [Transaction API](/api/transaction)

## Implementation

### Initiation methods

#### **Redirect**

The PaymentSite is implemented so that when the user is ready to pay, they are redirected out of the merchants system, to the PaymentSite to enter their payment information.

#### **iFrame**

When the user is ready to pay, the PaymentSite is opened in an iFrame in the merchants system.

#### Pre-populate fields

Most fields that are on the PaymentSite (besides the sensitive payment details) can be pre-populated by the merchants system before the user is directed to the page. This can be done by specifying the “key” and “values” of those fields separated by the “&” symbol in the URL query string. The “key“ value needs to match exactly the html “name“ element of the field; you can find that by inspecting the page using the developer tools of a browser. You can also look at the [Transaction API](/api/transaction) by transaction type to find most fields.

Example: <https://secure.cardknox.com/cardknoxexternaldemodev?**xamount**=100&**xinvoice**=232144234>

{% hint style="info" %}
**Note:** The merchant can log into the Cardknox portal to control what fields are available on the page. If you try to pre populate a field that is not added to the page, the system will just ignore it.
{% endhint %}

Here is a list of specific settings fields that can be set in the query string in addition to the above.

**Settings**

| Name                      | Description                                                                                                                                                                                                                                                                                 |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xRedirectURL              | This is the URL that the page will be redirected after the user submits the payment and the transaction is approved. If this is not specified, the user will stay on the PaymentSITE page and receive a message that the payment went through successfully.                                 |
| xRedirectURL\_NotApproved | This is the URL that the page will be redirected after the user submits the payment and the transaction is not approved. If this is not specified, the user will stay on the PaymentSITE page and receive a message that the payment did not go through, and they will be able to try again |
| xPostUrl                  | This is the URL the webhook will be sent to after the user submits the payment.                                                                                                                                                                                                             |

{% hint style="info" %}
Accounts need a setting enabled by a Cardknox Support Team member to use the `xPostUrl` field.
{% endhint %}

### Response methods

**Redirect**

Typically, after the transaction is completed by the user, the PaymentSite will automatically redirect the user back to the merchants system. There are two ways how to specify the redirect URL

1. Set the Redirect URL in the Cardknox PaymentSite backend settings
2. Set the `xRedirectURL` parameter in the query string when directing the user to the PaymentSITE.

The redirect will return the response parameter in the redirect quarry string. For a full list of response fields see [Response parameters](https://docs.cardknox.com/api/transaction#response-parameters)

**Example:**\
<https://www.cardknox.com/?xCurrency=USD\\&xDate=6%2F29%2F2020%204%3A26%3A47%20PM\\&xResult=A\\&xStatus=Approved\\&xErrorCode=00000\\&xAuthCode=09379A\\&xAuthAmount=1.03\\&xRefNum=341260411\\&xToken=0p3q5479g1g3h2p34g5763008044gg0p\\&xBatch=5128197\\&xMID=xxxxxxxxxx9999\\&xTID=xxxxx6789\\&xAvsResult=Address%3A%20No%20Match%20&5\\_Digit\\_Zip%3A\\_No\\_Match\\&xAvsResultCode=NNN\\&xCvvResult=No%20CVV%20data%20available\\&xMaskedCardNumber=4xxxxxxxxxxx1111\\&xName=t%20test\\&xExp=0620\\&xCardType=Visa\\&xEntryMethod=Keyed\\&xCustom10=Payment%20Site>

**Webhook**

The merchant's site can be notified of transaction responses via webhook notifications. This can be implemented in one of several ways:

1. Utilize [account webhooks](/products/webhooks) to receive webhooks for any transaction that is processed on an account
2. Set the webhook URL in the Sola PaymentSite backend settings
3. Set the `xPostUrl` the parameter in the query string when directing the user to the PaymentSITE.

{% hint style="info" %}
To set an `xPostUrl`, please note that you need to contact Gateway Support to enable the setting for this method to function correctly.&#x20;
{% endhint %}


# QR Codes for PaymentSITE

The Sola API gives you the ability to generate Quick Response (QR) codes that link to a custom PaymentSITE with pre-filled fields. Running a Sola API call for Sola PaymentSITE will return a QR code that can be used within point-of-sale applications or displayed on signage or reciepts that customers can scan.

{% hint style="info" %}
The QR code will be returned as **base64** and can be converted to an image file.
{% endhint %}

### EndPoints

#### /CREATE&#x20;

Create a QR code for merchants Sola/Cardknox PaymentSITEs

#### API URLs

| **Type**   | **URL**                                                        |
| ---------- | -------------------------------------------------------------- |
| Test       | <https://xeubhm6lhd.execute-api.us-west-2.amazonaws.com/Prod>  |
| Production | [us-east-2.qr.cardknox.com](http://us-east-2.qr.cardknox.com/) |

#### API Details

| URL            | [us-east-2.qr.cardknox.com/create](http://us-east-2.qr.cardknox.com/create)                                                                                                   |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Type           | GET                                                                                                                                                                           |
| Parameters     | <ul><li><p>URL (required)</p><ul><li>This is expecting a <a href="http://secure.cardknox.com/">secure.cardknox.com/</a>\[paymentSITE name] URL</li></ul></li></ul>            |
| Sample Request | [us-east-2.qr.cardknox.com](http://us-east-2.qr.cardknox.com/)/create?[url=secure.cardknox.com/demo](http://url=secure.cardknox.com/demo)?*\[xfield=value]*&*\[xfield=value]* |


# Split Capture

## **Overview** <a href="#splitcapture-background" id="splitcapture-background"></a>

Sola's Split Capture feature enables merchants to capture multiple payments for a single authorization-only transaction. This functionality is ideal for e-commerce merchants who ship out orders in increments, as they have the ability to capture several portions of the authorization as each shipment goes out.

The benefits of Split Capture are as follows:

* **Ability to Confirm Available Funds for the Entire Order Amount** \
  Rather than having to process multiple authorizations and captures, merchants can run a single authorization to confirm there are funds available before capturing several portions of the total amount.
* **Improve Record Keeping and Account Reconciliations** \
  Using Split Capture helps merchants to ensure that payments more accurately reflect shipments. Invoices and records are more organized, and the account reconciliation process is that much simpler.
* **Customer Satisfaction**\
  Customers appreciate that they’re only getting charged for shipments that have actually shipped out.

## **Transaction Flow** <a href="#splitcapture-transactionflow" id="splitcapture-transactionflow"></a>

### **CC:AuthOnly Transaction** <a href="#splitcapture-cc-authonlytransaction" id="splitcapture-cc-authonlytransaction"></a>

A standard authonly command is executed for the amount to be authorized with no additional flags.

* For the best merchant experience, it is recommended that the transaction include `xRequireSplitCapturable=1,` which ensures that the transaction can be split captured. If the flag is sent in on the authorization and the account is not set up to support split capture, the transaction errors with, “Split capture not supported.“ This flag is only supported on `cc:authonly` transactions.
* If the authorization can be split captured (i.e., the engine and account setup support split captures), then the authonly response includes `IsSplitCapturable=1`.

#### Transaction Incoming Fields (Specific to AuthOnly Transactions) <a href="#splitcapture-transactionincomingfields-specifictoauthonlytransactions" id="splitcapture-transactionincomingfields-specifictoauthonlytransactions"></a>

\[Optional] flag to require that authorization is able to be split captured before processing the authorization

| **Field**                 | **Value**                                                                                                            |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `xCommand`                | `cc:authonly`                                                                                                        |
| `xRequireSplitCapturable` | \[Optional] flag to require that authorization will be able to be split captured before processing the authorization |
| `xAmount`                 | Amount to be authorized                                                                                              |

### **CC:SplitCapture Transaction** <a href="#splitcapture-cc-splitcapturetransaction" id="splitcapture-cc-splitcapturetransaction"></a>

For a single `cc:authonly`, many `cc:splitcapture` commands can be executed. Each `cc:splitcapture`must specify the amount of the original authorized amount to be captured. The authorization is updated with the `ClearedAmount` (amount that was successfully captured) and the `ClearedCount` (count of successful split capture transactions).

#### Transaction Incoming Fields (Specific to Split Capture Transactions) <a href="#splitcapture-transactionincomingfields-specifictosplitcapturetransactions" id="splitcapture-transactionincomingfields-specifictosplitcapturetransactions"></a>

Reference number of the authonly transaction.

| **Field**  | **Value**                                     |
| ---------- | --------------------------------------------- |
| `xCommand` | `cc:splitcapture`                             |
| `xRefnum`  | Reference number of the authonly transaction. |
| `xAmount`  | Amount to be split captured                   |

## **Follow Up Transactions** <a href="#splitcapture-followuptransactions" id="splitcapture-followuptransactions"></a>

### Closing an AuthOnly Transaction <a href="#splitcapture-closinganauthonlytransaction" id="splitcapture-closinganauthonlytransaction"></a>

The user has the option to close an authonly transaction so that additional transactions cannot be processed for the authorization.

Once the auth has been closed:

* The status of the auth would be set to `AuthCloseTransaction`.
* In the transaction details of the auth, canceled would be set to `true`.
* An auth that was already closed would be blocked.
  * "Auth can no longer be closed"
* A voided auth would be blocked.
  * "Cannot close voided auth"
* Additional split captures would be blocked.
* Voids and refunds on the auth would be blocked.
  * Void: "Authorization was closed and can no longer be voided."
  * Refund: "Refund not allowed. Issue refund on split capture transaction."

| **Field**  | **Value**                                     |
| ---------- | --------------------------------------------- |
| `xCommand` | `cc:authclose`                                |
| `xRefnum`  | Reference number of the authonly transaction. |

The close command should only be used to close an authorization that has already been split captured. If a merchant wants to close an authorization that has not been split captured yet, the authorization should be voided.

### Voids <a href="#splitcapture-voids" id="splitcapture-voids"></a>

* An auth can not be voided/voidrefunded if it was split captured or closed.
  * "Authorization was split captured. Issue refund on split capture transaction."
* A split capture transaction can not be voided.
  * “Split capture cannot be voided. Issue refund."

### Refunds <a href="#splitcapture-refunds" id="splitcapture-refunds"></a>

* Refunding an authonly transaction:
  * If the authonly was not captured/split captured or closed, refund would be blocked.
    * “Refund not allowed on non-captured auth. Issue void.”
  * Once the authonly has been split captured, refund would be blocked.
    * &#x20;“Refund not allowed. Issue refund on split capture transaction.”
* Refunding a split capture transaction:

**VoidRefund**

* AuthOnly Transaction
  * If transaction has not been split captured, it will be processed as a void.
  * If transaction has been split captured, this will be blocked.
* Split Capture Transaction
  * Transaction will be processed as a refund.

## **Reporting** <a href="#splitcapture-reporting" id="splitcapture-reporting"></a>

The following fields can be requested on all standard report types. See [here](/api/reporting#reporting-fields) for more reportable fields.

| **Field**            | **Value**                                                     |
| -------------------- | ------------------------------------------------------------- |
| `xClearedCount`      | Count of cleared split capture transactions on original auth. |
| `xClearedAmount`     | Amount that has been split captured on original auth.         |
| `xIsSplitCapturable` | Specifies whether or not the auth can be split captured.      |

`Report:auth` will only display authorizations that have not been closed. It *will* display authorizations that have been split captured.


# Tap to Pay - Android

## **Introduction** <a href="#introduction" id="introduction"></a>

### **Purpose** <a href="#purpose" id="purpose"></a>

This document references all the features and an Android integration guide for Sola Tap to Pay.

&#x20;

**We’ll cover:**

* Tap to Pay Application Overview
* How do you install the Tap to Pay application on your Android device?
* How to integrate a third-party merchant application with the Sola Tap to Pay application

### **Scope** <a href="#scope" id="scope"></a>

This document is for Android developers looking to integrate the Sola Tap to Pay Helper application into their existing Android mobile app or web application.

***

&#x20;

## **Overview of Tap to Pay Helper Mobile App** <a href="#overview-of-tap-to-phone-helper-mobile-app" id="overview-of-tap-to-phone-helper-mobile-app"></a>

### **About** <a href="#about" id="about"></a>

Tap to Pay allows merchants to accept payments using their mobile devices without an external terminal. Tap to Pay is a service application that will work only if the transaction is requested from other third-party merchant applications.

It offers deep link identities to third-party merchant applications to seamlessly integrate to fulfill their payment needs.

**Requirements**:

* Operating system of Android OS 12 or later
* An Android device with NFC capabilities
* An Android device that is not rooted
* Android Device Settings:
  * Enable NFC and Contactless Payments settings
  * Disable Developer Options and USB Debugging settings
* Enable “Tap to Pay” within the Device Configuration settings within the Sola[ Mobile App](https://play.google.com/store/apps/details?id=com.gateway.cardknox.android\&hl=en_US\&gl=US)

### **How to use Tap to Pay with the Sola Android App** <a href="#how-to-use-tap-to-phone-with-the-cardknox-android-app" id="how-to-use-tap-to-phone-with-the-cardknox-android-app"></a>

* **Enable the Tap to Pay Feature:**
  * Open the Sola [Android App](https://play.google.com/store/apps/details?id=com.gateway.cardknox.android).
  * Navigate to Settings -> Device Configuration
  * Select Tap to Pay.
* **Install the Tap to Pay Helper App:**
  * When prompted, install the [Tap to Pay Helper app](https://play.google.com/store/apps/details?id=com.cardknox.tap.prod\&pli=1).
* **Activate Tap to Pay:**
  * Once the Tap to Pay helper app is installed, return to the Sola App and enable Tap to Pay.

### **How to install Tap to Pay using the Google Play Store** <a href="#how-to-install-tap-to-phone-using-the-google-play-store" id="how-to-install-tap-to-phone-using-the-google-play-store"></a>

Download the Tap to Pay Helper application from the [Google Play Store](https://play.google.com/store/apps/details?id=com.cardknox.tap.prod\&pli=1).&#x20;

&#x20;

***

## **Deep Linking** <a href="#deep-linking" id="deep-linking"></a>

The deep linking feature allows a third-party application to use a predefined URL to open up the pre-installed Tap to Pay Helper mobile application to process a payment transaction.

The Tap to Pay Helper app will use the “`xRedirectUrl`” parameter to deliver the transaction results to the third-party application. Results are provided as query parameters, appended onto the value provided by the `xRedirectUrl` parameter.

The Tap to Pay Helper application's predefined URL is:

`cardknox://tap.cardknox.com/transaction`

&#x20;

***

&#x20;

## **Supported Transaction Workflows**  <a href="#supported-transaction-workflows" id="supported-transaction-workflows"></a>

Tap to Pay Helper mobile application supports three (3) different transaction workflows.

1. **Encrypted Payload** – The third-party application will request the encrypted payload from the Tap to Pay helper application. To complete the transaction, send the server-side payload and other returned data to the Sola API. (see server-side transaction example)

| **Parameters**                               | **Required** | **Possible Values** | **Description**                                                                                                                                                               |
| -------------------------------------------- | ------------ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **xCommand**                                 | Yes          | cc:encrypt          | If you send the xCommand value as `cc:encrypt`, the Tap to Pay helper will use the ‘Encrypted Payload’ workflow and return the encrypted payload in the transaction response. |
| <p><strong>xRedirectURL</strong></p><p> </p> | Yes          |                     | A valid URL scheme defined inside the third-party application to receive transaction responses from the ‘Tap to Pay’ helper application                                       |

&#x20;

&#x20;

2. **Single Use Token (SUT)** – The merchant application will request a “Single Use Token” instead of the encrypted payload from the Tap to Pay helper application. Then, send the SUT and other returned data to the Sola API to complete the transaction.

   &#x20;

| **Parameters**                               | **Required** | **Possible Values** | **Description**                                                                                                                                                             |
| -------------------------------------------- | ------------ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **xCommand**                                 | Yes          | cc:singleusetoken   | If you send the xCommand value as `cc:singleusetoken`, the Tap to Pay helper will use the “Single Use Token (SUT)” workflow and return the SUT in the transaction response. |
| <p><strong>xRedirectURL</strong></p><p> </p> | Yes          |                     | A valid URL scheme defined inside the third-party application to receive transaction responses from the ‘Tap to Pay’ helper application                                     |

&#x20;

&#x20;

3. **Complete Transaction** – With this workflow, the Tap to Pay helper application processes the complete transaction and returns the gateway response to the third-party application.

&#x20;

| **Parameters**                                                                  | **Required** | **Possible Values**                      | **Description**                                                                                                                         |
| ------------------------------------------------------------------------------- | ------------ | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **xCommand**                                                                    | Yes          | cc:sale, cc:save, cc:authonly, cc:credit | Sola transaction type                                                                                                                   |
| **xKey**                                                                        | Yes          |                                          | Your Sola API key                                                                                                                       |
| <p><strong>xRedirectURL</strong></p><p> </p>                                    | Yes          |                                          | A valid URL scheme defined inside the third-party application to receive transaction responses from the ‘Tap to Pay’ helper application |
| [**\*Any ‘Cardknox API’ parameter**](https://docs.cardknox.com/api/transaction) |              |                                          |                                                                                                                                         |

&#x20;

***

&#x20;

## **Transaction Parameters** <a href="#transaction-parameters" id="transaction-parameters"></a>

Two types of parameters are supported by the Tap to Pay helper application.

1. **Transaction API Specific** – Use any Sola API parameters in the deep-link request. [See Transaction API documentation](/api/transaction). However, the below API parameters must be **carefully designed** to achieve the desired transaction result using the Tap to Pay helper.

&#x20;

&#x20;

| **Parameter** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xRedirectURL  | A valid URL scheme defined inside the third-party application to receive transaction responses from the ‘Tap to Pay’ helper application                                                                                                                                                                                                                                                                                                  |
| xCommand      | <p>This parameter is utilized to indicate the specific type of transaction that needs to be executed (cc:sale, cc:refund, cc:void, etc.).</p><p>One caveat is that this must be defined as <code>cc:encrypt</code> for the  ‘Encrypted Payload’ workflow or <code>cc:singleusetoken</code> for the ‘Single-Use-Token’ workflow.</p><p>For the ‘Complete Transaction’ workflow, you can pass the usual Sola-specific xCommand values.</p> |

&#x20;

***

### **Development and Debugging** <a href="#development-and-debugging-hardbreak-hardbreak" id="development-and-debugging-hardbreak-hardbreak"></a>

**Tap to Pay Development/Debugging Parameters** – These are defined to troubleshoot issues quickly during the development phase.

The following is the list of Tap to Pay specific parameters that can be passed, along with the BBPOS Specific parameters, by the third-party merchant application in the deep link query string.

&#x20;

| **Parameter** | **Description**                                                                                                 | **Possible Values** | **Default Value** |
| ------------- | --------------------------------------------------------------------------------------------------------------- | ------------------- | ----------------- |
| debug         | Set to TRUE to display logs in the Tap to Pay helper application.                                               | TRUE/FALSE          | FALSE             |
| useSTG        | <p>This enables a staging gateway environment. Applicable only for ‘Complete Transaction’ workflow.</p><p> </p> | TRUE/FALSE          | FALSE             |
| doNotRedirect | Disables the redirect URL and displays the results/logs within the Tap to Pay helper app.                       | TRUE/FALSE          | FALSE             |

&#x20;

*All ‘debugging’ parameters are optional.*

&#x20;

***

&#x20;

## **How to Integrate Tap to Pay with Third-Party Android Applications** <a href="#how-to-integrate-tap-to-phone-with-third-party-android-applications" id="how-to-integrate-tap-to-phone-with-third-party-android-applications"></a>

### How to Setup Deeplink URL <a href="#how-to-setup-deeplink-url" id="how-to-setup-deeplink-url"></a>

Third-party merchant app developers can form URLs based on different transaction needs. Tap to Pay helper app will not cache any third-party request in the mobile application storage, and it's entirely driven by the transaction request passed through the deep link request.

&#x20;

Example of a deep link URL:

`cardknox://tap.cardknox.com/transaction?`**`xRedirectURL`**`=mechant://pos.merchant.com/&`**`xKey`**`=XXXXXW23243HHDFJ&`**`xEmail`**`=test@merchant.com&`**`xAmount`**`=12.00&`**`xTip`**`=1.0&`**`xCommand`**`=cc:sale&`**`debug`**`=True&`**`useSTG`**`=True&x`**`AllowPartialAuth`**`=true`

&#x20;

Note that the above URL is corresponding to the “Complete Transaction” workflow since xKey is provided

&#x20;

Example of a deep link request, corresponding to the transaction response:

`mechant://pos.merchant.com?`**xResult**`=D&`**xStatus**`=Declined&`**xError**`=Invalid%20Chip&`**xRefNum**`=102304545&`**xErrorCode**`=2034`

&#x20;

The below response parameters and their explanations in the context of Tap to Pay helper.

&#x20;

| **Parameter**     | **Description**                                                                                                                                                      |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| xEncryptedPayload | <p>This will contain the encrypted payload or single-use token if the transaction workflow is requested as an ‘encrypted payload’ or ‘single-use token’.</p><p> </p> |
| xSerialNumber     | This will contain the rock value, that’s needed to perform the gateway request when the workflow is requested as ‘Encrypted Payload’ or ‘Single-Use-Token’.          |
| xStatus           | This will be a success or error when the workflow is requested as ‘Encrypted payload’ or ‘Single-Use-Token’. Containing the standard Sola gateway response values.   |
| xCommand          |                                                                                                                                                                      |

&#x20;

You can refer to the [API documentation](/api/transaction) for other response parameter definitions.

### **How to create a server-side call:** <a href="#how-to-create-a-server-side-call" id="how-to-create-a-server-side-call"></a>

When running the server-side call to Sola, you must use the standard required API parameters. Reference the [Transaction API](/api/transaction) for a list of parameters.

Additionally, the following parameters are required:

| **Parameter**  | **Description**                                                       | **Example**                                                                                          |
| -------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| xSerialNumber  | The serial number value returned from the payload.                    | alP4n4-\_92UPrgVI                                                                                    |
| xMobileTapType | Must equal to ‘TapToPhoneApp’                                         | TapToPhoneApp                                                                                        |
| xEMVData       | Pass the value of the returned encrypted payload (xEncryptedPayload). | AAABBgAAABgAAAAAAAABHgAAAIYAAAEeAQAAAAH\_htzImhOJfEQlhxhrJsYZttThXPsWFZgUTYwxmxqaxdOXYnCvfoATExUgJb… |

&#x20;

### Server-side Request Example: <a href="#server-side-request-example" id="server-side-request-example"></a>

```
{
  "xKey": "dxxxcaxaxfxxfxxxxxxdxxcxcxfaax",
  "xCommand": "cc:sale",
  "xVersion": "4.5.9",
  "xSoftwareVersion": "1.0.12",
  "xAmount": "1.08",
  "xSoftwareName": "My Application ",
  "xEMVdata": "AAABBgAAABgAAAAAAAABHgAAAIYAAAEeAQAAAAH_htzImhOJfEQlhxhrJsYZttThXPsWFZgUTYwxmjxPBLLhkxwPcVZACZGDIntDDasmtAxxBWxxn_eAxlUbNxxAxxWtR",
  "xSerialNumber": "alN4n4-_92UPrgVI",
  "xMobileTapType": "TapToPhoneApp"
}
```

&#x20;

### **How to call a Deep Link URL to Invoke the Tap to Pay Helper Application** <a href="#how-to-call-a-deep-link-url-to-invoke-the-tap-to-phone-helper-application" id="how-to-call-a-deep-link-url-to-invoke-the-tap-to-phone-helper-application"></a>

Once the deep link URL is formed, you can create an intent using the formed deep link URL and start the activity using the intent.

Thus Tap to Pay Helper application will be launched and start the workflow. Once the requested operations are complete, the result will be returned using the xRedirectUrl as well.&#x20;

&#x20;

Here’s an example snippet of code to invoke the creation:

```
Uri myAction = Uri.parse(deepLinkUrl); 
// deepLinkUrl must be a string variable holding the deep link URL with all required parameters.
Intent intent = new Intent (Intent.ACTION_VIEW);
intent.setData (myAction);
startActivity(intent);
```

&#x20;


# Webhooks

Sola accounts can be configured to send notifications, known as webhooks, to a designated URL each time a transaction is processed on the account. These webhooks are sent as a series of key-value pairs, encoded in a POST request, and contain all the necessary information to identify the transaction and its status. The information included in these webhooks can be customized to fit your needs, and a complete list of available fields can be found in the "[Response Parameters](/#response-parameters)" section. The webhook and [optional pin](#webhook-pin) can be enabled in the [Sola Portal](https://portal2.solapayments.com/settings/gateway-settings/webhook).

See example below:

| Form values       |                                    |
| ----------------- | ---------------------------------- |
| xEnteredDate      | `9/3/2021 9:28:22 AM`              |
| xRefNum           | `506918667`                        |
| xCommand          | `CC:Sale`                          |
| xAmount           | `0.01`                             |
| xResponseResult   | `Approved`                         |
| xMaskedCardNumber | `4xxxxxxxxxxx1111`                 |
| xExp              | `1020`                             |
| xCardType         | `Visa`                             |
| xToken            | `7h39p8qp6hq2pgqp76mgg2qnq7npp3g5` |
| xSoftwareName     | `KnockKnox`                        |
| xSourceKey        | `Cardknox Support Key`             |
| xResponseBatch    | `6358090`                          |
| xMerchantID       | `8663`                             |
| xMerchantName     | `Cardknox Support`                 |

**Raw Content**

```
xEnteredDate=9%2f3%2f2021+9%3a28%3a22+AM&xRefNum=506918667&xCommand=CC%3aSale&xAmount=0.01&xResponseResult=Approved&xMaskedCardNumber=4xxxxxxxxxxx1111&xExp=1020&xCardType=Visa&xToken=7h39p8qp6hq2pgqp76mgg2qnq7npp3g5&xSoftwareName=KnockKnox&xSourceKey=Cardknox+Support+Key&xResponseBatch=6358090&xMerchantID=8663&xMerchantName=Cardknox+Support
```

#### Webhook PIN <a href="#webhook-pin" id="webhook-pin"></a>

For security purposes and to prevent DDoS attacks, a pin can be set up when configuring the webhook. Sola will generate a hash and it will be included in the webhook header as "ck-signature". To validate the authenticity of a webhook on the recipient's end, follow the steps below to generate a hash and compare it to the "ck-signature". If your hash matches the "ck-signature" it confirms that the webhook originated from Sola.

1. **URL Decode Data:** URL decode the webhook data.
2. **Normalize Key Case:** Convert all parameter keys to lowercase to ensure case-insensitive sorting.
3. **Sort Data Alphabetically:** Sort the parameters alphabetically by their keys.
4. **Extract Values:** Extract the values from the sorted parameters.
5. **Concatenate Values with PIN:** Combine the extracted values with the webhook pin at the end.
6. **Hash Concatenated String Using MD5:** Apply the MD5 hashing algorithm to the concatenated string.

**Pin Rules**

1. The pin can only be AlphaNumeric
2. The pin must be at least 15 characters long


# Apple Pay Hosted Checkout

## Overview

Apple Pay Hosted Checkout is our simple integration that enables online Apple Pay processing through the Sola gateway. This landing page contains all of the links and references needed for setting up and maintaining Apple Pay Hosted Checkout. Please reference the **Initial Setup** and Apple Pay Hosted Checkout **Resources** sections below.

## What's New

{% hint style="info" %}
We now support **Address Validation** and **Recurring**/**Deferred** Payments and **Subscriptions**.\
For more info about [Apple Pay Features](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-features) please click the link.
{% endhint %}

## Apple Pay Hosted Checkout Resources <a href="#apple-pay-hosted-checkout-resources" id="apple-pay-hosted-checkout-resources"></a>

The following pages can be found by viewing the navigation bar on the left side of the screen.

* [Initial Setup](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-initial-setup)
* [Hosted Checkout Sample Code](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-sample-code)
* [iFields Integration](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-ifields-integration)
* [Hosted Checkout Request Objects](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request)
* [Hosted Checkout Response Objects](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-response)
* [Apple Pay Features](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-features)

## Questions?

Contact <support@solapayments.com>


# Apple Pay Hosted Checkout Initial Setup

## Initial Setup

**Contents**

* [Prerequisites](#prerequisites)
* [Client-Side Integration](#client-side-integration)
  * [Adding Reference to iFields](#adding-reference-to-ifields)
  * [Adding JavaScript Objects for Apple Pay button](#adding-javascript-objects-for-apple-pay-button)
  * [Enabling Apple Pay](#enable-apple-pay)
* [Server-Side Integration](#server-side-integration)
  * [Server Endpoint Creation](#server-endpoint-creation)
  * [API Integration](#api-integration)

## Prerequisites

**Set up Apple Pay Merchant ID**

Sola supports two solutions to help you set up your Apple Pay Merchant ID:

1. [Set up Apple Pay Merchant ID through your Merchant Portal](/mobile-wallets/apple-pay-hosted-checkout/set-up-apple-pay-merchant-id-with-sola) - A simple solution where Sola handles all communications with Apple and takes care of all certificates.
2. [Set up Apple Pay Merchant ID using your own Apple account](/mobile-wallets/apple-pay-hosted-checkout/apple-pay) - in this case it will be your responsibility for mainlining account, domain and certificates up to date with Apple.

## Implementing Apple Pay Hosted Checkout

### Client-Side Integration

#### Adding Reference to iFields

{% hint style="info" %}
Find the latest version of iFields at: [https://cdn.cardknox.com/ifields/versions.htm](https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcdn.cardknox.com%2Fifields%2Fversions.htm\&data=04%7C01%7Csaltman%40cardknox.com%7Cee27e2f8cee34d8eb64108d96965fb39%7Cbee12808a32d4518bad72e695a86fc91%7C0%7C0%7C637656709056206810%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000\&sdata=EkulORguWhCwZ%2BApGRr3WBqvzxcnnMsHj6w2nxzCwog%3D\&reserved=0)
{% endhint %}

&#x20;

**Step 1:** Add the iFields.js file after the \<head> tag on your payment page:

```html
<script src=https://cdn.cardknox.com/ifields/**ifields-version-number**/ifields.min.js></script>
```

&#x20;

#### Adding JavaScript Objects for Apple Pay button

**Step 1:** Add the following JS snippet inside the *\<body>* where the Apple Pay button is desired.

```html
<div id="ap-container">
</div>
```

&#x20;

**Step 2:** Create JavaScript object that holds all of the properties/methods required to process Apple Pay.

```javascript
window.apRequest = {
    buttonOptions: {
        buttonContainer: "ap-container",
        buttonColor: APButtonColor.black,
        buttonType: APButtonType.pay
    },
    ..............
    initAP: function() {
        return {
            buttonOptions: this.buttonOptions,
            merchantIdentifier: "<Your Apple Merchant Identifier provided by Cardknox>",
            requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
            requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
            onGetTransactionInfo: "apRequest.onGetTransactionInfo",
            onValidateMerchant: "apRequest.onValidateMerchant",
            onPaymentAuthorize: "apRequest.onPaymentAuthorize",
            onPaymentComplete: "apRequest.onPaymentComplete",
            onAPButtonLoaded: "apRequest.apButtonLoaded",
            isDebug: true
        };
    }
}
```

&#x20;                                       &#x20;

{% hint style="info" %}
For a full sample code please refer to [Apple Pay iFields Integration](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-ifields-integration)
{% endhint %}

&#x20;

**Step 3:** Implement desired callbacks.

For the list of available callbacks, please refer to [Apple Pay Object](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request).

* There are three main callbacks that must be implemented (the rest are optional):
  * onGetTransactionInfo - calculates the total amount based on the charge amount, fees, taxes, shipping costs, etc.
  * onValidateMerchant - a callback to be called to validate the Apple Pay Merchant.
  * onPaymentAuthorize - a callback that will be called after the consumer pays and Apple returns a token with all of the requested consumer information, like the billing address, shipping address, etc. This is where you need to make an ajax call to your server with the Apple Payload. The sample for making an ajax call is below.

*Sample Code for Making Ajax Call:*

```javascript
validateApplePayMerchant: function (url) {
    return new Promise(function (resolve, reject) {
        try {
            var xhr = new XMLHttpRequest();
            xhr.open('POST', "https://api.cardknox.com/applepay/validate");
            xhr.onload = function () {
                if (this.status >= 200 && this.status < 300) {
                    resolve(xhr.response);
                } else {
                    reject({
                        status: this.status,
                        statusText: xhr.response
                    });
                }
            };
            xhr.onerror = function () {
                reject({
                    status: this.status,
                    statusText: xhr.statusText
                });
            };
            xhr.setRequestHeader("Content-Type", "application/json");
            xhr.send(JSON.stringify({ validationUrl: url}));
        } catch (err) {
            setTimeout(function () { alert("getApplePaySession error: " + exMsg(err)) }, 100);
        }
    });
},
authorize: function(applePayload, totalAmount) {
    return new Promise(function (resolve, reject) {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "https://<your domain>/<path to handle authorization>");
        xhr.onload = function () {
            if (this.status >= 200 && this.status < 300) {
                resolve(xhr.response);
            } else {
                reject({
                    status: this.status,
                    statusText: xhr.statusText
                });
            }
        };
        xhr.onerror = function () {
            reject({
                status: this.status,
                statusText: xhr.statusText
            });
        };
        const data = {
            amount: totalAmount,
            payload: applePayload
        };
        xhr.setRequestHeader("Content-Type", "application/json");
        xhr.send(JSON.stringify(data));
    });
}
```

{% hint style="info" %}
For full sample code, please refer to [Apple Pay iFields Integration](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-ifields-integration)
{% endhint %}

**Step 4:** Create JavaScript function that will initialize iFields.

```javascript
initAP: function() {
    return {
        buttonOptions: this.buttonOptions,
        merchantIdentifier: "merchant.cardknoxdev.com",
        requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
        requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
        onGetTransactionInfo: "apRequest.onGetTransactionInfo",
        onGetShippingMethods: "apRequest.onGetShippingMethods",
        onShippingContactSelected: "apRequest.onShippingContactSelected",
        onShippingMethodSelected: "apRequest.onShippingMethodSelected",
        onPaymentMethodSelected: "apRequest.onPaymentMethodSelected",
        onValidateMerchant: "apRequest.onValidateMerchant",
        onPaymentAuthorize: "apRequest.onPaymentAuthorize",
        onPaymentComplete: "apRequest.onPaymentComplete",
        onAPButtonLoaded: "apRequest.apButtonLoaded",
        isDebug: true
    };
}
```

initAP function above returns [Request Object](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request).

#### Enable Apple Pay

**window\.ckApplePay object** - controls initialization of Apple Pay button

| **Method**     | **Call Required** | **Description**                                                                                                                                              |
| -------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| enableApplePay | Yes               | <p>Initializes and enables Apple Pay Button.<br>Takes <a href="/pages/qWagxxVPUAnHTDgSfhZG#enableapplepayparams-object">EnableApplePayParams</a> object.</p> |
| updateAmount   | Conditional       | Updates amount on Apple Sheet.                                                                                                                               |

{% hint style="info" %}
You can provide either All, One, or None of the parameters for enableApplePay call.

* initFunction **Required** - either function name or function itself to initialize Apple Pay.
* amountField **Optional** - if specified, the Apple Pay total amount will be automatically updated whenever the amount has changed.
* amountField *is not* specified - in this case, it’s up to you to provide the correct amount for Apple Pay. One of the ways to do it is to call window\.ckApplePay.updateAmount manually.
  {% endhint %}

#### EnableApplePayParams Object

| **Name**     | **Type**       | **Required** | **Description**                                                                                                   |
| ------------ | -------------- | ------------ | ----------------------------------------------------------------------------------------------------------------- |
| initFunction | String\|Object | Yes          | Either function name or function itself to initialize Apple Pay                                                   |
| amountField  | String\|Object | No           | <p>Field containing amount.<br>Could be either the name of the field (String) or<br>the field itself (Object)</p> |

{% code title="Enable Apple Pay example" %}

```javascript
ckApplePay.enableApplePay({
  initFunction: 'apRequest.initAP',
  amountField: 'amount'
});
```

{% endcode %}

***

### Server-Side Integration

#### Server Endpoint Creation

A server endpoint is needed in order to accept the Apple Payload from Hosted Checkout.

**Step 1:** Create an endpoint and method for API Integration on your server side that takes an object containing total transaction amount and [Apple Payload](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-response#applepayload-object) and makes a call to Sola.\
Sample Object:

```
const req = {
    amount: 1.45,
    payload: <Payload from Apple Response>
}
```

#### API Integration

{% hint style="info" %}
This section assumes that you already know how to integrate other payments with [Cardknox API](https://docs.cardknox.com/api/transaction)
{% endhint %}

**Below are the steps to integrate Apple Pay with the Sola API:**

Once the consumer confirms the payment, Apple Pay API generates an [Apple Payload](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-response#applepayload-object) in the form of a JSON string.

Integration Steps:

1. Extract the paymentData from the payload.
2. Encode it with Base64 encoding.
3. Set `xCardNum` field to the encoded value above.
4. Set `xDigitalWalletType` to ApplePay.
5. Set the remaining required fields:
   1. `xAmount` the Transaction Amount.
   2. `xCommand` - Set to one of the values that starts with cc: like cc:sale, cc:auth, etc.
   3. `xBillFirstName`
   4. `xBillLastName`
   5. `xBillStreet`
   6. `xBillCity`
   7. `xBillState`
   8. `xBillZip`

Sample Request:

```javascript
public async Task<IActionResult> Authorize(AuthorizeRequest req) 
{
	var reqGateway = new
	{
		xKey = "Your xKey", 
		xAmount = (decimal)req.amount,
		xCommand = "cc:sale",
		xVersion = "4.5.4",
		xSoftwareName= "Your Software Name",
		xSoftwareVersion = "Your Software Version",
		xBillFirstName = req.paymentResponse.billingContact.givenName,
		xBillLastName = req.paymentResponse.billingContact.familyName,
		xBillStreet = req.paymentResponse.billingContact.addressLines[0],
		xBillCity = req.paymentResponse.billingContact.locality,
		xBillState = req.paymentResponse.billingContact.administrativeArea,
		xBillZip = req.paymentResponse.billingContact.postalCode,
		xShipFirstName = req.paymentResponse.shippingContact.givenName,
		xShipLastName = req.paymentResponse.shippingContact.familyName,
		xShipStreet = req.paymentResponse.shippingContact.addressLines[0],
		xShipCity = req.paymentResponse.shippingContact.locality,
		xShipState = req.paymentResponse.shippingContact.administrativeArea,
		xShipZip = req.paymentResponse.shippingContact.postalCode,
		xdigitalwallettype = "applepay",
		xcardnum = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(req.payload.token.paymentData)))
	};
	var respMsg = "";
	using (var http = new HttpClient())
	{
		var resp = await http.PostAsJsonAsync("https://x1.cardknox.com/gatewayJSON", reqGateway);
		respMsg = await resp.Content.ReadAsStringAsync();
		.....
	}
	.....
}	
```

For more details, please contact your Sola Representative.

## Questions?

Contact <support@solapayments.com>


# Apple Pay Prerequisites

1. **Create a Merchant ID.**
   1. Navigate to [Apple Developer Page](https://developer.apple.com/account/resources/identifiers/list).
   2. Click on *Identifiers*.
   3. Click on the plus sign next to Identifiers.
   4. Choose Merchant IDs and click Continue
   5. Follow the instructions to Register a Merchant ID.
   6. **Register your domain for Apple Pay on the Web.**
      1. If you are not using Apple Pay on the Web, skip this step.
      2. On [Apple Developer Page](https://developer.apple.com/account/resources/identifiers/list), under the list of merchants, click on the one you just created.
      3. Scroll down to Merchant Domains and click Add Domain.
      4. Follow the instructions to register your domain.
   7. **Generate Merchant ID Certificate.**
      1. Navigate to your Sola Merchant Portal
      2. Open AccountSettings > Payment Methods > Configure Apple Pay
      3. Click `Register for Apple Pay using your own Certificate`
      4. Download csr file and generate Merchant Certificate based on that csr.
      5. Click `Download Certificate` from Apple and save it locally\
         ![](/files/js5EiDPQzS2tDG48VZ88)
   8. **Create an Apple Pay Payment Processing Certificate.**
      1. Continue on Merchant Portal by uploading Merchant Certificate from Apple.
      2. Download Payment Processing csr
      3. Under Apple Pay Payment Processing Certificate, click on Create Certificate.
      4. Click on Choose File, select CSR file and continue.
   9. **You are now ready to process Apple Pay transactions!**

![](/files/-Me08X_83CUnnr_9BpL3)

### FAQs <a href="#faqs" id="faqs"></a>

**Q:** What Apple Pay related fields are necessary to be sent on a gateway transaction request?\
**A:**

1. xCardNum containing a base-64 encoded ApplePay encrypted token block (paymentData.data)

```
{ "paymentData": { "version": "EC_v1", "data":
"nts4o1EdIF9GA7Yy3GbdJamkPJNu66nMtPBk6hcp4N4/12v7LrEf/xsaFE5NRH9jEMQ93KJME2f9ZnQo9rRNK0ZLwYEQ7mynlsRvQY1gtvgEAhZMarGfOrBFSLIS5gC3tWM4hRn+ELfu9U3vv3sg+h4Ci611TeFvwZK5E4tbQ7Q6V66kN2sJSGjGcqzCoao6WXCOHhyhWy53c24OqK6Bz77RGhM+PtMfBNGREKzwKATnS1PHhA1mPUGysBIUWc2qWNRDxVm0XqlH/aBndQankLNbUetWFNHrJDhRsiEvdVwIZfUG2E+HtkQLV80Q2OCcnSmNSl/uoLCetvd7zM9w0OUXGUQ3qP/LvtAiyUXJBDZ8TUQVyNV/qac9zsjHIDvP2EiwSgdJXO+ns1s=",
"signature":
"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4zCCA4igAwIBAgIITDBBSVGdVDYwCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE5MDUxODAxMzI1N1oXDTI0MDUxNjAxMzI1N1owXzElMCMGA1UEAwwcZWNjLXNtcC1icm9rZXItc2lnbl9VQzQtUFJPRDEUMBIGA1UECwwLaU9TIFN5c3RlbXMxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwhV37evWx7Ihj2jdcJChIY3HsL1vLCg9hGCV2Ur0pUEbg0IO2BHzQH6DMx8cVMP36zIg1rrV1O/0komJPnwPE6OCAhEwggINMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUI/JJxE+T5O8n5sT2KGw/orv9LkswRQYIKwYBBQUHAQEEOTA3MDUGCCsGAQUFBzABhilodHRwOi8vb2NzcC5hcHBsZS5jb20vb2NzcDA0LWFwcGxlYWljYTMwMjCCAR0GA1UdIASCARQwggEQMIIBDAYJKoZIhvdjZAUBMIH+MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNlIG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBvZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZpY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDYGCCsGAQUFBwIBFipodHRwOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNAYDVR0fBC0wKzApoCegJYYjaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGVhaWNhMy5jcmwwHQYDVR0OBBYEFJRX22/VdIGGiYl2L35XhQfnm1gkMA4GA1UdDwEB/wQEAwIHgDAPBgkqhkiG92NkBh0EAgUAMAoGCCqGSM49BAMCA0kAMEYCIQC+CVcf5x4ec1tV5a+stMcv60RfMBhSIsclEAK2Hr1vVQIhANGLNQpd1t1usXRgNbEess6Hz6Pmr2y9g4CJDcgs3apjMIIC7jCCAnWgAwIBAgIISW0vvzqY2pcwCgYIKoZIzj0EAwIwZzEbMBkGA1UEAwwSQXBwbGUgUm9vdCBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwHhcNMTQwNTA2MjM0NjMwWhcNMjkwNTA2MjM0NjMwWjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATwFxGEGddkhdUaXiWBB3bogKLv3nuuTeCN/EuT4TNW1WZbNa4i0Jd2DSJOe7oI/XYXzojLdrtmcL7I6CmE/1RFo4H3MIH0MEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcwAYYqaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZXJvb3RjYWczMB0GA1UdDgQWBBQj8knET5Pk7yfmxPYobD+iu/0uSzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFLuw3qFYM4iapIqZ3r6966/ayySrMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlcm9vdGNhZzMuY3JsMA4GA1UdDwEB/wQEAwIBBjAQBgoqhkiG92NkBgIOBAIFADAKBggqhkjOPQQDAgNnADBkAjA6z3KDURaZsYb7NcNWymK/9Bft2Q91TaKOvvGcgV5Ct4n4mPebWZ+Y1UENj53pwv4CMDIt1UQhsKMFd2xd8zg7kGf9F3wsIW2WT8ZyaYISb1T4en0bmcubCYkhYQaZDwmSHQAAMYIBizCCAYcCAQEwgYYwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTAghMMEFJUZ1UNjANBglghkgBZQMEAgEFAKCBlTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMDA5MzAwMjU2NDBaMCoGCSqGSIb3DQEJNDEdMBswDQYJYIZIAWUDBAIBBQChCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEIPKm5f38JoEhydyPKo4cCyfCY+KXfKty3kQAuOrUfUMwMAoGCCqGSM49BAMCBEYwRAIgBZZO6LSzs93DKgw/NpvqUevggniTod0T5zMJUzM2TKUCIFLyN1mYe1b4ANNQEMpYMr2D+CCnh86iARbZ1ue4iQVGAAAAAAAA",
"header": { "ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4jfJmg6VGIGFnlUX2mw/0REAQHdlCqXOfFAfwrurQh9WM9EBjcsmjwl5KDBH5yuVeG2sW4uXFlqQkSoWJDnxig==", "publicKeyHash": "XvufuWpJGfsSOrPWpbBwoyjrrRT3ByIFOijzGdeI8Ho=", "transactionId":
"0969a45481176c0e86f6ad43914de68e41d33ce95db1e1169d7cd3274d757b49", "applicationData": null }, "paymentMethod": { "displayName": "MasterCard 0492", "network": "MasterCard", "type": "credit" }, "transactionIdentifier": "0969A45481176C0E86F6AD43914DE68E41D33CE95DB1E1169D7CD3274D757B49" } }
```

1. &#x20;xDigitalWalletType set to “ApplePay”

**Q:** Can a POST or GET be used interchangeably to submit the request?

**A:** No, due to the size of the data, this request must be submitted to Sola Gateway via a POST.

**Q:** I received an error “Invalid payment data format“ on the transaction response. What might be the issue?

**A:** The Apple Pay payload in the xCardNum field was not a valid base-64 block.

**Q:** I received an error “Transaction amount does not match the amount provided“ on the transaction response. What might be the issue?

**A:** The amount sent in via the xAmount parameter does not match the amount retrieved from the payload provided by Apple Pay.

**Q:** I received error “PaymentDataType \<?> not supported for ApplePay“ on the transaction response. What might be the issue?

**A:** We currently only support 3DSecure data type. This covers all areas aside from China.

**Q:** How can I be sure that an Apple Pay transaction is secure?

**A:** Sola will validate the signature on the Apple Pay request to ensure that the request is properly signed using Apple Pay certificates and that the request has not been tampered with. If this\
validation fails, the transaction will be rejected.

**Q:** What will the xEntryMethod be for an Apple Pay transaction?

**A:** The xEntryMethod will be set to DigitalWallet.


# Apple Pay Hosted Checkout Objects Reference (Request)

***For complete sample code please refer*** [***here***](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-sample-code)

## **Available dictionary objects**

***

### iStatus

```javascript
const iStatus = {
    success: 100,
    unsupported: -100,
    error: -200
}
```

**Use:** iStatus.success

### APButtonColor

```javascript
const APButtonColor = {
    black: "black",
    white: "white",
    whiteOutline: "white-outline"
}    
```

**Use:** `APButtonColor.black`

### APButtonType

```javascript
const APButtonType = {
    buy: "buy",
    pay: "pay",
    plain: "plain",
    order: "order",
    donate: "donate",
    continue: "continue",
    checkout: "check-out"
}     
```

**Use:** `APButtonType.buy`

### APRequiredFeatures

```javascript
const APRequiredFeatures = {
    address_validation: "address_validation",
    support_recurring: "support_recurring",
    support_subscription : "support_subscription"
}  
```

**Use:** `APRequiredFeatures.address_validation`

### APErrorCode

```javascript
const APErrorCode = {
    shippingContactInvalid: "shippingContactInvalid",
    billingContactInvalid: "billingContactInvalid",
    addressUnserviceable: "addressUnserviceable",
    couponCodeInvalid: "couponCodeInvalid",
    couponCodeExpired: "couponCodeExpired",
    unknown: "unknown"
} 
```

**Use:** `APErrorCode.addressUnserviceable`

### APErrorContactField

```javascript
const APErrorContactField = {
    phoneNumber: "phoneNumber",
    emailAddress: "emailAddress",
    name: "name",
    phoneticName: "phoneticName",
    postalAddress: "postalAddress",
    addressLines: "addressLines",
    locality: "locality",
    subLocality: "subLocality",
    postalCode: "postalCode",
    administrativeArea: "administrativeArea",
    subAdministrativeArea: "subAdministrativeArea",
    country: "country",
    countryCode: "countryCode"
}
```

**Use:** `APErrorContactField.administrativeArea`

## **Request objects**

***

### ApplePayRequest

**The Main object that contains all the information necessary to communicate with Apple Pay API.**

| **Name**                      | **Type**                                          | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------- | ------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| merchantIdentifier            | String                                            | Yes          | For merchants integrating their own *Apple Developer* account must be *Merchant Identifier* from the account, otherwise must be merchant.cardknox.com                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| buttonOptions                 | [ButtonOptions](#buttonoptions-object)            | No           | <p>Provides Apple Pay button customization options.<br>For more information please click the link.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| requiredFeatures              | [APRequiredFeatures\[\]](#aprequiredfeatures)     | No           | Features required by Merchant. Each Feature is available with the certain iOS version. Therefore if device doesn’t support that version (Feature) - Apple Pay Button won’t be displayed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| requiredBillingContactFields  | [ApplePayContactField\[\]](#applepaycontactfield) | No           | List of field names used for requesting contact information in a payment request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| requiredShippingContactFields | [ApplePayContactField\[\]](#applepaycontactfield) | No           | List of field names used for requesting contact information in a payment request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| onAPButtonLoaded              | String                                            | Yes          | <p>Name of a callback function to be called when Apple Pay button is loaded.<br>Accepts an object of type <a href="https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#apbuttonloadedresult-object">APButtonLoadedResult</a><br>Please click <a href="https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onapbuttonloaded-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| onGetTransactionInfo          | String                                            | Yes          | <p>Name of a callback function to be called that returns the final price and tax calculations.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#ongettransactioninfo-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| onGetShippingMethods          | String                                            | Yes          | <p>Name of a callback function to be called that returns a list of available Shipping Methods.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#ongetshippingmethods-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| onShippingContactSelected     | String                                            | Yes          | <p>Name of a callback function to be called when Shipping Contact is selected/changed.<br>Accepts a parameter <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#paymentcontact-object">PaymentContact</a>.<br>Returns <a href="https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#shippingcontactresponse-object">ShippingContactResponse</a>.<br>If <code>address\_validation</code> is part of <a href="https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#aprequiredfeatures">requiredFeatures</a> in your ApplePay Request object you can return an <a href="#error-object">Error</a> as part of <code>ShippingContactResponse</code>.<br>Please click <a href="#onshippingcontactselected-callback-example">here</a> for the sample code.</p> |
| onShippingMethodSelected      | String                                            | Yes          | <p>Name of a callback function to be called when Shipping Method is selected/changed.<br>Accepts a parameter <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#shippingmethod-object">ShippingMethod</a>.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onshippingmethodselected-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| onPaymentMethodSelected       | String                                            | Yes          | <p>Name of a callback function to be called when Payment Method is selected/changed.<br>Accepts a parameter <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#paymentmethod-object">PaymentMethod</a>.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onpaymentmethodselected-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| onBeforeProcessPayment        | String                                            | Yes          | <p>Name of a callback function to be called when consumer clicked the button but before Apple Pay sheet is loaded. Usually used to make validations before the payment.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onbeforeprocesspayment-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| onValidateMerchant            | String                                            | Yes          | <p>Name of a callback function to be called to validate the Merchant.<br>This functions accepts a parameter validationUrl.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onvalidatemerchant-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| onPaymentAuthorize            | String                                            | Yes          | <p>Name of a callback function to be called when Apple Payment is authorized for the completion of the transaction.<br>This function accepts a parameter of PaymentResponse.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onpaymentauthorize-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| onPaymentComplete             | String                                            | Yes          | <p>Name of a callback function to be called when Apple confirms the completion of the transaction.<br>This function accepts a parameter of PaymentComplete.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#onpaymentauthorize-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| onError                       | String                                            | Yes          | <p>Name of a callback function to be called when Error occurs.<br>Please click <a href="#onerror-callback-example">here</a> for the sample code.<br>Make sure to assign <code>onError</code> in <code>initAP</code> function like <a href="#payment-request-example">below</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| onCancel                      | String                                            | Yes          | <p>Name of a callback function to be called when user cancels.<br>Please click <a href="https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#oncancel-callback-example">here</a> for the sample code.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### **Request Examples**

#### **Payment Request example**

{% code lineNumbers="true" %}

```javascript
initAP: function() {
  return {
    buttonOptions: this.buttonOptions,
    merchantIdentifier: "merchant.cardknoxdev.com",
    requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
    requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
    onGetTransactionInfo: "apRequest.onGetTransactionInfo",
    onGetShippingMethods: "apRequest.onGetShippingMethods",
    onShippingContactSelected: "apRequest.onShippingContactSelected",
    onShippingMethodSelected: "apRequest.onShippingMethodSelected",
    onPaymentMethodSelected: "apRequest.onPaymentMethodSelected",
    onValidateMerchant: "apRequest.onValidateMerchant",
    onPaymentAuthorize: "apRequest.onPaymentAuthorize",
    onPaymentComplete: "apRequest.onPaymentComplete",
    onError: "apRequest.onError",
    onAPButtonLoaded: "apRequest.apButtonLoaded"
  };
}
```

{% endcode %}

#### **onAPButtonLoaded callback example**

{% code lineNumbers="true" %}

```javascript
apButtonLoaded: function(resp) {
    if (!resp) return;
    if (resp.status === iStatus.success) {
        showHide(this.buttonOptions.buttonContainer, true);
        showHide("lbAPPayload", true);
    } else if (resp.reason) {
        alert(resp.reason);
    }
}
```

{% endcode %}

#### **onGetTransactionInfo callback example**

{% code lineNumbers="true" %}

```javascript
taxAmt: null,
shippingMethod: null,
creditType: null,
getTransactionInfo: function (taxAmt, shippingMethod, creditType) {
  try {
    this.shippingMethod = shippingMethod || this.shippingMethod || {
                "label": "Free Shipping",
                "amount": "0.00",
                "type": "final"
            };
    this.taxAmt = roundToNumber(taxAmt, 4) || this.taxAmt || 0.07;
    this.creditType = creditType || this.creditType;
    const amt = getAmount();
    const lineItems = [
        {
            "label": "Subtotal",
            "type": "final",
            "amount": amt
        },
        this.shippingMethod
    ];
    if (this.creditType === "credit") {
        lineItems.push({
            "label": "Credit Card Fee",
            "amount": roundTo(0.0275*amt, 2),
            "type": "final"
        });
    }
    lineItems.push({
        "label": "Estimated Tax",
        "amount": roundTo(this.taxAmt*amt, 2),
        "type": "final"
    });
    let totalAmt = 0;
    lineItems.forEach((item) => {
        totalAmt += parseFloat(item.amount)||0;
    });
    totalAmt = roundTo(totalAmt, 2);

    return {
        'lineItems': lineItems,  
        total: {
                type:  'final',
                label: 'Total',
                amount: totalAmt,
            }
    };                        
  } catch (err) {
    console.error("getTransactionInfo error ", exMsg(err));
    if (isDebugEnv) {
        alert("getTransactionInfo error: "+exMsg(err));
    }
}
},  
onGetTransactionInfo: function () {
  try {
    return this.getTransactionInfo();
  } catch (err) {
    console.error("onGetTransactionInfo error ", exMsg(err));
    if (isDebugEnv) {
        alert("onGetTransactionInfo error: "+exMsg(err));
    }
  }
}
```

{% endcode %}

#### **onGetShippingMethods callback example**

{% code lineNumbers="true" %}

```javascript
onGetShippingMethods: function()  {
  return [
    {
        label: 'Free Shipping',
        amount: '0.00',
        identifier: 'free',
        detail: 'Delivers in five business days',
    },
    {
        label: 'Express Shipping',
        amount: '5.00',
        identifier: 'express',
        detail: 'Delivers in two business days',
    },
  ];
}
```

{% endcode %}

#### **onShippingContactSelected callback example**

{% code lineNumbers="true" %}

```javascript
onShippingContactSelected: function(shippingContact) {
  const self = this;
  return new Promise(function (resolve, reject) {
    try {
      console.log("shippingContact", JSON.stringify(shippingContact));
      let taxAmt = 0.1;
      const newShippingMethods = [
        {
          label: 'Free Shipping',
          amount: '0.00',
          identifier: 'free',
          detail: 'Delivers in five business days',
        }                                
      ];
      if (shippingContact && shippingContact.administrativeArea) {
        if (shippingContact.administrativeArea === "NY") {
          taxAmt = 0.0875;
          newShippingMethods.push(
            {
              label: 'Overnight Shipping',
              amount: '10.00',
              identifier: 'overnight',
              detail: 'Delivers in one business days',
            }
          );
        } else if (shippingContact.administrativeArea === "NJ") {
          taxAmt = 0.07;
          newShippingMethods.push(
            {
              label: 'Express Shipping',
              amount: '5.00',
              identifier: 'express',
              detail: 'Delivers in two business days',
            }
          );
        }
      }
      const resp = self.getTransactionInfo(taxAmt, newShippingMethods[0]);
      resp.shippingMethods = newShippingMethods;
      resolve(resp);                            
    } catch (err) {
      const apErr = {
        code: "-101",
        contactField: "",
        message: exMsg(err)
      }
      console.error("onShippingContactSelected error.", exMsg(err));
      if (isDebugEnv) {
        setTimeout(function(){ alert("onShippingContactSelected error: "+exMsg(err))}, 100);
      }
      reject({errors: [err]});
    }
  })                
}
```

{% endcode %}

#### **onShippingMethodSelected callback example**

{% code lineNumbers="true" %}

```javascript
onShippingMethodSelected: function(shippingMethod) {
  const self = this;
  return new Promise(function (resolve, reject) {
    try {
      console.log("shippingMethod", JSON.stringify(shippingMethod));
      const resp = self.getTransactionInfo(null, shippingMethod);
      resolve(resp);                            
    } catch (err) {
      const apErr = {
          code: "-102",
          contactField: "",
          message: exMsg(err)
      }
      console.error("onShippingMethodSelected error.", exMsg(err));
      if (isDebugEnv) {
          setTimeout(function(){ alert("onShippingMethodSelected error: "+exMsg(err))}, 100);
      }
      reject({errors: [err]});
    }
  })                
}
```

{% endcode %}

#### **onPaymentMethodSelected callback example**

{% code lineNumbers="true" %}

```javascript
onPaymentMethodSelected: function(paymentMethod) {
  const self = this;
  return new Promise(function (resolve, reject) {
    try {
      console.log("paymentMethod", JSON.stringify(paymentMethod));
      const resp = self.getTransactionInfo(null, null, paymentMethod.type);
      resolve(resp);                            
    } catch (err) {
      const apErr = {
          code: "-102",
          contactField: "",
          message: exMsg(err)
      }
      console.error("onPaymentMethodSelected error.", exMsg(err));
      if (isDebugEnv) {
          setTimeout(function(){ alert("onPaymentMethodSelected error: "+exMsg(err))}, 100);
      }
      reject({errors: [err]});
    }
  })                
}
```

{% endcode %}

#### **onBeforeProcessPayment callback example**

{% code lineNumbers="true" %}

```javascript
onBeforeProcessPayment: function () {
    return new Promise(function (resolve, reject) {
        try {
            //Do some validation here
            resolve(iStatus.success);
        } catch (err) {
            reject(err);
        }
    });
}
Payment callback example
```

{% endcode %}

#### **onValidateMerchant callback example**

{% code lineNumbers="true" %}

```javascript
onValidateMerchant: function(validationUrl) {
  return new Promise(function (resolve, reject) {
    try {
      if (isDebugEnv) {
        alert("onValidateMerchant: "+JSON.stringify(event), validationUrl);
      }

      getApplePaySession(validationUrl)
        .then(function (response) {
          try {
            console.log(response);
            resolve(response);
        } catch (err) {
            console.error("getApplePaySession exception.", JSON.stringify(err));
            setTimeout(function(){ alert("onValidateMerchant error: "+exMsg(err))}, 100);
            reject(err);
        }
      })
      .catch(function(err) {
        console.error("getApplePaySession error.", JSON.stringify(err));
        setTimeout(function(){ alert("getApplePaySession error: "+exMsg(err))}, 100);
        reject(err);
      });    
    } catch (err) {
      console.error("onValidateMerchant error.", JSON.stringify(err));
      if (isDebugEnv) {
          setTimeout(function(){ alert("onValidateMerchant error: "+exMsg(err))}, 100);
      }
      reject(err);
    }
  })
}
```

{% endcode %}

#### **onPaymentAuthorize callback example**

{% code lineNumbers="true" %}

```javascript
onPaymentAuthorize: function(paymentResponse) {
  return new Promise(function (resolve, reject) {
    try {
      authorizeAPay(paymentResponse.token)
      .then(function (response) {
        try {
            console.log(response);
            setAPPayload(JSON.stringify(paymentResponse, null, 2));
            const resp = JSON.parse(response);
            if (!resp)
                throw "Invalid response: "+ response;
            if (resp.xError) {
                throw resp;
            }
            resolve(response);
        } catch (err) {
            throw err;
            // console.error("authorizeAPay exception.", JSON.stringify(err));
            // setTimeout(function(){ alert("onPaymentAuthorize error: "+exMsg(err))}, 100);
            // reject(err);
        }
      })
      .catch(function(err) {
        console.error("authorizeAPay error.", JSON.stringify(err));
        apRequest.handleAPError(err);
        reject(err);
      });    
    } catch (err) {
      console.error("onPaymentAuthorize error.", JSON.stringify(err));
      apRequest.handleAPError(err);
      reject(err);
    }
  })
}
```

{% endcode %}

#### **onPaymentComplete callback example**

{% code lineNumbers="true" %}

```javascript
onPaymentComplete: function(paymentComplete) {
  if (paymentComplete.response) { //Success
    const resp = JSON.parse(paymentComplete.response);
    if (resp.xRefNum) {
      setTimeout(function(){ alert("Thank you for your order:("+resp.xRefNum+")")}, 100);
    } else {
      setTimeout(function(){ alert("Thank you for your order.")}, 100);
    }
  } else if (paymentComplete.error) {
    console.error("onPaymentComplete", exMsg(paymentComplete.error));
    handleAPError(paymentComplete.error);
  }                    
}
```

{% endcode %}

#### onError callback example

```javascript
onError: function(error) {
  setTimeout(function () { alert(`An error occured: ${error}`) }, 500);
}
```

#### **onCancel callback example**

{% code lineNumbers="true" %}

```javascript
onCancel: function() {
  setTimeout(function () { alert("Payment was canceled") }, 500);
}
```

{% endcode %}

***

### ButtonOptions Object

| **Name**        | **Type**                        | **Required** | **Description**                                                                                                                                                                                                                                                                                                    |
| --------------- | ------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| buttonContainer | String                          | Yes          | Name of the \<div> where Apple Pay Button will be loaded                                                                                                                                                                                                                                                           |
| buttonColor     | [APButtonColor](#apbuttoncolor) | No           | <p><em>From Google documentation</em>:</p><ul><li>default: A Google-selected default value. Currently black but it may change over time (default).</li><li>black: A black button suitable for use on white or light backgrounds.</li><li>white: A white button suitable for use on colorful backgrounds.</li></ul> |
| buttonType      | [APButtonType](#apbuttontype)   | No           | <p><em>From Google documentation</em>:</p><ul><li>buy: "Buy with Google Pay" button (default).</li><li>donate: "Donate with Google Pay" button.</li><li>plain: Google Pay button without additional text.</li></ul>                                                                                                |

#### **Button Options example**

```
buttonOptions: {
    buttonContainer: "ap-container",
    buttonColor: APButtonColor.black,
    buttonType: APButtonType.pay
}
```

***

### APButtonLoadedResult Object

| **Name** | **Type** | **Description**                                                                                                                                                                                                                                                                                          |
| -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status   | iStatus  | <p>There are 3 possible cases:</p><ul><li>Apple Pay Button loaded successfully: <code>status = iStatus.success</code></li><li>Apple Pay not supported: <code>status = iStatus.unsupported</code></li><li>An error occurred while loading Apple Pay Button: <code>status = iStatus.error</code></li></ul> |
| reason   | String   | If Apple Pay Button failed to load this field will be populated with the reason.                                                                                                                                                                                                                         |

***

### ApplePayContactField

*Field names used for requesting contact information in a payment request.*

Available fields:

* name
* email
* phone
* postalAddress

### **ApplePay Contact Field example**

```
...
requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
...
```

### PaymentContact Object

| **Name**              | **Type**  | **Description**                                                                                                                                          |
| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| phoneNumber           | String    | A phone number for the contact                                                                                                                           |
| emailAddress          | String    | An email address for the contact                                                                                                                         |
| givenName             | String    | The contact’s given name                                                                                                                                 |
| familyName            | String    | The contact’s family name                                                                                                                                |
| addressLines          | String\[] | The street portion of the address for the contact                                                                                                        |
| subLocality           | String    | Additional information associated with the location, typically defined at the city or town level (such as district or neighborhood), in a postal address |
| locality              | String    | The city for the contact                                                                                                                                 |
| postalCode            | String    | The zip code or postal code, where applicable, for the contact                                                                                           |
| subAdministrativeArea | String    | The subadministrative area (such as a county or other region) in a postal address                                                                        |
| administrativeArea    | String    | The state for the contact                                                                                                                                |
| country               | String    | The name of the country or region for the contact                                                                                                        |
| countryCode           | String    | The contact’s two-letter ISO 3166 country code                                                                                                           |

### ShippingContactResponse Object <a href="#shippingcontactresponse-object" id="shippingcontactresponse-object"></a>

| **Name**          | **Type**                                    | **Description**                                                                           |
| ----------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `lineItems`       | [LineItem](#lineitem-object)\[]             | A set of line items that explain recurring payments and additional charges and discounts. |
| `total`           | [LineItem](#lineitem-object)                | A line item that represents the total for the payment.                                    |
| `shippingMethods` | [ShippingMethod](#shippingmethod-object)\[] | A list of Shipping Methods                                                                |
| `error`           | [Error](#aperrorcode)                       | Error code                                                                                |

### LineItem Object <a href="#lineitem-object" id="lineitem-object"></a>

{% hint style="info" %}
We’re now supporting **Recurring** and **Deferred** Payments as well as **Subscriptions**.\
These features are supported starting iOS 15.4.<br>

These features are available if `support_recurring` and/or `support_subscription` is part of [requiredFeatures](https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#applepayrequest) list.
{% endhint %}

| Name                                    | Type                             | Description                                                                                                                    |
| --------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| type                                    | ApplePayLineItemType             | A value that indicates whether the line item is final or pending                                                               |
| label                                   | String                           | A required value that’s a short, description of the line item                                                                  |
| amount                                  | String                           | A required value that’s the monetary amount of the line item.                                                                  |
| **Recurring and Subscription**          |                                  |                                                                                                                                |
| `paymentTiming`                         | ApplePayPaymentTiming object     | The time that the payment occurs as part of a successful transaction                                                           |
| `recurringPaymentStartDate`             | Date                             | The date of the first payment                                                                                                  |
| `recurringPaymentEndDate`               | Date                             | The date of the final payment                                                                                                  |
| `recurringPaymentIntervalUnit`          | ApplePayRecurringPaymentDateUnit | The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval |
| `recurringPaymentIntervalCount`         | Long                             | The number of interval units that make up the total payment interval                                                           |
| `deferredPaymentDate`                   | Date                             | The date, in the future, of the payment                                                                                        |
| `automaticReloadPaymentThresholdAmount` | String                           | The balance an account reaches before the merchant applies the automatic reload amount                                         |

### ApplePayLineItemType <a href="#applepaylineitemtype" id="applepaylineitemtype"></a>

* `final` - A line item representing the known, final cost.
* `pending` - A line item representing an estimated or unknown cost.

### ApplePayRecurringPaymentDateUnit <a href="#applepayrecurringpaymentdateunit" id="applepayrecurringpaymentdateunit"></a>

* `year`
* `month`
* `day`
* `hour`
* `minute`

**Recurring Line Item Example (Charging $20 starting today for the next year)**

{% code lineNumbers="true" %}

```javascript
const startDate = new Date();
const endDate = new Date(startDate.getFullYear()+1, startDate.getMonth(), startDate.getDate());
lineItem = {
    "label": "Subscription",
    "amount": "20.00",
    "type": "final",
    "paymentTiming": "recurring",
    "recurringPaymentStartDate": startDate,
    "recurringPaymentIntervalUnit": "month",
    "recurringPaymentIntervalCount": 1,
    "recurringPaymentEndDate": endDate,
}
```

{% endcode %}

### ShippingMethod Object

| **Name**   | **Type** | **Description**                      |
| ---------- | -------- | ------------------------------------ |
| label      | String   | Label for this Shipping Method       |
| amount     | String   | Price for this shipping option       |
| detail     | String   | Description for this Shipping Method |
| identifier | String   | Identifier for this Shipping Method  |

### **ShippingMethod example**

```json
{    
    "label": "Free Shipping",
    "amount": "0.00",
    "detail": "Arrives in 7 to 10 business days",    
    "identifier": "free"
}
```

***

### PaymentMethod Object

| **Name**       | **Type**          | **Description**                                         |
| -------------- | ----------------- | ------------------------------------------------------- |
| displayName    | String            | A string, suitable for display, that describes the card |
| network        | String            | Name of the payment network backing the card            |
| type           | PaymentMethodType | The card's type of payment                              |
| billingContact | PaymentContact    | The billing contact associated with the card            |

***

### PaymentMethodType

*A payment card’s type of payment.*

The payment method type value is one of:

* debit
* credit
* prepaid
* store

### Error Object <a href="#error-object" id="error-object"></a>

**Note:** Supported starting iOS 11.\
Available when `address_validation` is part of [requiredFeatures](https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#applepayrequest) list.

| **Name**       | **Type**                                                                                                                                                       | **Description**                         |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `code`         | [APErrorCode](https://cardknox.atlassian.net/wiki/spaces/PUB/pages/2366144654/Apple+Pay+Hosted+Checkout+Objects+reference+Request#APErrorCode)                 | One of Apple Pay Error Codes            |
| `contactField` | [APErrorContactField](https://cardknox.atlassian.net/wiki/spaces/PUB/pages/2366144654/Apple+Pay+Hosted+Checkout+Objects+reference+Request#APErrorContactField) | One of Apple Pay Error Contact fields   |
| `message`      | String                                                                                                                                                         | Error message displayed to the customer |

&#x20;

<br>


# Apple Pay Hosted Checkout Objects Reference (Response)

## **Response objects**

For the Full Response example click [here](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-sample-code)

***

### ApplePayload Object

| **Name**        | **Type**                                                                                                                                                          | **Always exists** | **Description**                                                                    |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------- |
| billingContact  | [PaymentContact](https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#paymentcontact-object) | No                | Contains all transaction data. For more details please click on the link.          |
| shippingContact | [PaymentContact](https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#paymentcontact-object) | No                | This is a response object that's returned by Apple after a payer approves payment. |
| token           | PaymentToken                                                                                                                                                      | Yes               | This is a response object that's returned by Apple after a payer approves payment. |

***

### PaymentToken Object

| **Name**              | **Type**                                                                                                                                                        | **Always exists** | **Description**                                                                                                                          |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| paymentData           | JSON                                                                                                                                                            | Yes               | An object containing the encrypted payment data. **This is the object that needs to be Base64 Encoded and sent to gateway as** xCardNum. |
| paymentMethod         | [PaymentMethod](https://docs.cardknox.com/cardknox-products/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#paymentmethod-object) | Yes               | Information about the card used in the transaction.                                                                                      |
| transactionIdentifier | String                                                                                                                                                          | Yes               | A unique identifier for this payment                                                                                                     |

**paymentData use example**

```
var reqGateway = new
{
  .........
  xcardnum = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(req.paymentData)))
  .........
};
```

***

### PaymentComplete Object

An object returned from onPaymentAuthorize ajax call - typically a Gateway Response\
An example of PaymentComplete Response returned by iFields is below:

```
{
  "xResult": "A",
  "xStatus": "Approved",
  "xError": "",
  "xErrorCode": "00000",
  "xRefNum": "481244058",
  "xExp": "0424",
  "xAuthCode": "OK8853",
  "xBatch": "6332569",
  "xAvsResultCode": "YYY",
  "xAvsResult": "Address: Match & 5 Digit Zip: Match",
  "xCvvResultCode": "S",
  "xCvvResult": "Should be On card but Not so indicated",
  "xAuthAmount": "1.12",
  "xMaskedCardNumber": "5xxxxxxxxxxx6344",
  "xCardType": "MasterCard",
  "xName": "Test Applepay",
  "xToken": "34q9h58n68qh24p7719m76m0nhm013hh",
  "xMID": "xxxxxxxxxxx0661",
  "xTID": "xxxx0003",
  "xDate": "7/13/2021 7:18:02 PM",
  "xAuthNetwork": "3",
  "xEntryMethod": "Keyed",
  "xCAVV": "ALyaPlPZZIgIADhFniB+AoABFA==",
  "xEciFlag": "01"
}
```


# Apple Pay iFields Integration

```javascript
<!DOCTYPE html>
<html>
    <head>
		<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
		<meta content="utf-8" http-equiv="encoding">

        <!-- Use the following src for the script on your form and replace ****version**** with the desired version: src="https://cdn.cardknox.com/ifields/****version****/ifields.min.js" -->     
        <script src="ifields.min.js"></script> 
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", function(event) { 
                 ckApplePay.enableApplePay({
                    initFunction: 'apRequest.initAP',
                    amountField: 'amount'
                });
            });

            window.apRequest = {
                buttonOptions: {
                    buttonContainer: "ap-container",
                    buttonColor: APButtonColor.black,
                    buttonType: APButtonType.pay
                },
                totalAmount: null,
                taxAmt: null,
                shippingMethod: null,
                creditType: null,
                getTransactionInfo: function (taxAmt, shippingMethod, creditType) {
                    try {
                        this.shippingMethod = shippingMethod || this.shippingMethod || {
                                    "label": "Free Shipping",
                                    "amount": "0.00",
                                    "type": "final"
                                };
                        this.taxAmt = roundToNumber(taxAmt, 4) || this.taxAmt || 0.07;
                        this.creditType = creditType || this.creditType;
                        const amt = getAmount();
                        const lineItems = [
                            {
                                "label": "Subtotal",
                                "type": "final",
                                "amount": amt
                            },
                            this.shippingMethod
                        ];
                        if (this.creditType === "credit") {
                            lineItems.push({
                                "label": "Credit Card Fee",
                                "amount": roundTo(0.0275*amt, 2),
                                "type": "final"
                            });
                        }
                        lineItems.push({
                            "label": "Estimated Tax",
                            "amount": roundTo(this.taxAmt*amt, 2),
                            "type": "final"
                        });
                        let totalAmt = 0;
                        lineItems.forEach((item) => {
                            totalAmt += parseFloat(item.amount)||0;
                        });
                        totalAmt = roundTo(totalAmt, 2);
                        this.totalAmount = totalAmt;
                        
                        return {
                            'lineItems': lineItems,  
                            total: {
                                    type:  'final',
                                    label: '[Your Business Name]',
                                    amount: totalAmt,
                                }
                        };                        
                    } catch (err) {
                        console.error("getTransactionInfo error ", exMsg(err));
                    }
                },  
                onGetTransactionInfo: function () {
                    try {
                        return this.getTransactionInfo();
                    } catch (err) {
                        console.error("onGetTransactionInfo error ", exMsg(err));
                    }
                },  
                onGetShippingMethods: function()  {
                    return [
                        {
                            label: 'Free Shipping',
                            amount: '0.00',
                            identifier: 'free',
                            detail: 'Delivers in five business days',
                        },
                        {
                            label: 'Express Shipping',
                            amount: '5.00',
                            identifier: 'express',
                            detail: 'Delivers in two business days',
                        },
                    ];
                },
                onShippingContactSelected: function(shippingContact) {
                    const self = this;
                    return new Promise((resolve, reject) => {
                        try {
                            console.log("shippingContact", JSON.stringify(shippingContact));
                            let taxAmt = 0.1;
                            const newShippingMethods = [
                                {
                                    label: 'Free Shipping',
                                    amount: '0.00',
                                    identifier: 'free',
                                    detail: 'Delivers in five business days',
                                }                                
                            ];
                            if (shippingContact && shippingContact.administrativeArea) {
                                if (shippingContact.administrativeArea === "NY") {
                                    taxAmt = 0.0875;
                                    newShippingMethods.push(
                                            {
                                                label: 'Overnight Shipping',
                                                amount: '10.00',
                                                identifier: 'overnight',
                                                detail: 'Delivers in one business days',
                                            }
                                        );
                                } else if (shippingContact.administrativeArea === "NJ") {
                                    taxAmt = 0.07;
                                    newShippingMethods.push(
                                        {
                                            label: 'Express Shipping',
                                            amount: '5.00',
                                            identifier: 'express',
                                            detail: 'Delivers in two business days',
                                        }
                                    );
                                }
                            }
                            const resp = self.getTransactionInfo(taxAmt, newShippingMethods[0]);
                            resp.shippingMethods = newShippingMethods;
                            resolve(resp);                            
                        } catch (err) {
                            const apErr = {
                                code: "-101",
                                contactField: "",
                                message: exMsg(err)
                            }
                            console.error("onShippingContactSelected error.", exMsg(err));
                            reject({errors: [err]});
                        }
                    })                
                },
                onShippingMethodSelected: function(shippingMethod) {
                    const self = this;
                    return new Promise(function (resolve, reject) {
                        try {
                            console.log("shippingMethod", JSON.stringify(shippingMethod));
                            const resp = self.getTransactionInfo(null, shippingMethod);
                            resolve(resp);                            
                        } catch (err) {
                            const apErr = {
                                code: "-102",
                                contactField: "",
                                message: exMsg(err)
                            }
                            console.error("onShippingMethodSelected error.", exMsg(err));
                            reject({errors: [err]});
                        }
                    })                
                },
                onPaymentMethodSelected: function(paymentMethod) {
                    const self = this;
                    return new Promise((resolve, reject) => {
                        try {
                            console.log("paymentMethod", JSON.stringify(paymentMethod));
                            const resp = self.getTransactionInfo(null, null, paymentMethod.type);
                            resolve(resp);                            
                        } catch (err) {
                            const apErr = {
                                code: "-102",
                                contactField: "",
                                message: exMsg(err)
                            }
                            console.error("onPaymentMethodSelected error.", exMsg(err));
                            reject({errors: [err]});
                        }
                    })                
                },
                validateApplePayMerchant: function () {
                    return new Promise((resolve, reject) => {
                        try {
                            var xhr = new XMLHttpRequest();
                            xhr.open("POST", "https://api.cardknox.com/applepay/validate");
                            xhr.onload = function () {
                                if (this.status >= 200 && this.status < 300) {
                                    console.log("validateApplePayMerchant", JSON.stringify(xhr.response));
                                    resolve(xhr.response);
                                } else {
                                    console.error("validateApplePayMerchant", JSON.stringify(xhr.response), this.status);
                                    reject({
                                        status: this.status,
                                        statusText: xhr.response
                                    });
                                }
                            };
                            xhr.onerror = function () {
                                console.error("validateApplePayMerchant", xhr.statusText, this.status);
                                reject({
                                    status: this.status,
                                    statusText: xhr.statusText
                                });
                            };
                            xhr.setRequestHeader("Content-Type", "application/json");
                            xhr.send();
                        } catch (err) {
                            setTimeout(function () { console.log("getApplePaySession error: " + exMsg(err)) }, 100);
                        }
                    });
                },
                onValidateMerchant: function() {
                    return new Promise((resolve, reject) => {
                        try {
                            this.validateApplePayMerchant()
                            .then((response) => {
                                try {
                                    console.log(response);
                                    resolve(response);
                                } catch (err) {
                                    console.error("validateApplePayMerchant exception.", JSON.stringify(err));
                                    reject(err);
                                }
                            })
                            .catch((err) => {
                                console.error("validateApplePayMerchant error.", JSON.stringify(err));
                                reject(err);
                            });    
                        } catch (err) {
                            console.error("onValidateMerchant error.", JSON.stringify(err));
                            reject(err);
                        }
                    });
                },
                authorize: function(applePayload, totalAmount) {
                    return new Promise(function (resolve, reject) {
                        var xhr = new XMLHttpRequest();
                        xhr.open("POST", "https://<your domain>/<path to handle authorization>");
                        xhr.onload = function () {
                            if (this.status >= 200 && this.status < 300) {
                                resolve(xhr.response);
                            } else {
                                reject({
                                    status: this.status,
                                    statusText: xhr.statusText
                                });
                            }
                        };
                        xhr.onerror = function () {
                            reject({
                                status: this.status,
                                statusText: xhr.statusText
                            });
                        };
                        const data = {
                            amount: totalAmount,
                            payload: applePayload
                        };
                        xhr.setRequestHeader("Content-Type", "application/json");
                        xhr.send(JSON.stringify(data));
                    });
                },
                onPaymentAuthorize: function(applePayload) {
                    return new Promise((resolve, reject) => {
                        try {
                            this.authorize(applePayload, this.totalAmount)
                            .then((response) => {
                                try {
                                    console.log(response);
                                    const resp = JSON.parse(response);
                                    if (!resp)
                                        throw "Invalid response: "+ response;
                                    if (resp.xError) {
                                        throw resp;
                                    }
                                    resolve(response);
                                } catch (err) {
                                    throw err;
                                    // reject(err);
                                }
                            })
                            .catch((err) => {
                                console.error("authorizeAPay error.", JSON.stringify(err));
                                apRequest.handleAPError(err);
                                reject(err);
                            });    
                        } catch (err) {
                            console.error("onPaymentAuthorize error.", JSON.stringify(err));
                            apRequest.handleAPError(err);
                            reject(err);
                        }
                    });
                },
                onPaymentComplete: function(paymentComplete) {
                    if (paymentComplete.response) { //Success
                        const resp = JSON.parse(paymentComplete.response);
                        if (resp.xRefNum) {
                            setAPPayload("Thank you for your order:("+resp.xRefNum+")");
                        } else {
                            setAPPayload("Thank you for your order.");
                        }
                    } else if (paymentComplete.error) {
                        console.error("onPaymentComplete", exMsg(paymentComplete.error));
                        handleAPError(paymentComplete.error);
                    }                        
                },
                handleAPError: function(err) {
                    if (err && err.xRefNum) {
                        setAPPayload("There was a problem with your order:("+err.xRefNum+")");
                    } else {
                        setAPPayload("There was a problem with your order:"+exMsg(err));
                    }
                },
                initAP: function() {
                    return {
                        buttonOptions: this.buttonOptions,
                        merchantIdentifier: "<Your Apple Merchant ID>",
                        requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
                        requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
                        onGetTransactionInfo: "apRequest.onGetTransactionInfo",
                        onGetShippingMethods: "apRequest.onGetShippingMethods",
                        onShippingContactSelected: "apRequest.onShippingContactSelected",
                        onShippingMethodSelected: "apRequest.onShippingMethodSelected",
                        onPaymentMethodSelected: "apRequest.onPaymentMethodSelected",
                        onValidateMerchant: "apRequest.onValidateMerchant",
                        onPaymentAuthorize: "apRequest.onPaymentAuthorize",
                        onPaymentComplete: "apRequest.onPaymentComplete",
                        onAPButtonLoaded: "apRequest.apButtonLoaded",
                        isDebug: true
                    };
                },
                apButtonLoaded: function(resp) {
                    if (!resp) return;
                    if (resp.status === iStatus.success) {
                        showHide(this.buttonOptions.buttonContainer, true);
                        showHide("lbAPPayload", true);
                    } else if (resp.reason) {
                        console.log(resp.reason);
                    }
                }
            };
            
            function setAPPayload(value) {
                const apTxt = document.getElementById('ap-payload');
                apTxt.value = value;
                showHide(apTxt, value);
            }

            function showHide(elem, toShow) {
                if (typeof(elem) === "string") {
                    elem = document.getElementById(elem);
                }
                if (elem) {
                    toShow ? elem.classList.remove("hidden") : elem.classList.add("hidden");
                }
            }
            function getAmount () {
                return roundToNumber(document.getElementById("amount").value || "0", 2);
            }
        </script>
        <style> 
            body {
                margin: 10px;
            }
            div.main {
				width: 350px;
			}
            .ap {
                border: 0;
                width: 250px;
                height: auto;
                min-height: 55px;
                padding: 0px;
                margin-bottom: 12px;
            }

            input {
                border: 1px solid black;
                font-size: 14px;
                padding: 3px;
                width: 250px;
                margin-bottom: 12px;
            }

            .hidden {
                display: none;
            }

            textarea {
                border: 1px solid black;
                width: 100%;
            }
        </style>
    </head>
    <body>
      <div class="main">
        <form id="payment-form" method="POST">
            <input id="amount" name="xAmount" placeholder="Amount" type="number" inputmode="decimal"></input>
            <br/>
            <div id="ap-container" class="ap hidden" >
                <br/>
            </div>
            <br/>
            <label id="lbAPPayload" class="hidden">Apple Pay Payload: </label>
            <br />
            <textarea id="ap-payload" class="hidden" rows="10" readonly="true"></textarea>
            <br/>
        </form>
      </div>
    </body>    
</html>    
```


# Apple Pay Hosted Checkout Sample Code

1. **Let's define a helper object with all necessary components:**

   ```javascript
   window.apRequest = {
       buttonOptions: {
           buttonContainer: "ap-container",
           buttonColor: APButtonColor.black,
           buttonType: APButtonType.pay
       },
       totalAmount: null,
       taxAmt: null,
       shippingMethod: null,
       creditType: null,
       getTransactionInfo: function (taxAmt, shippingMethod, creditType) {
           try {
               this.shippingMethod = shippingMethod || this.shippingMethod || {
                           "label": "Free Shipping",
                           "amount": "0.00",
                           "type": "final"
                       };
               this.taxAmt = roundToNumber(taxAmt, 4) || this.taxAmt || 0.07;
               this.creditType = creditType || this.creditType;
               const amt = getAmount();
               const lineItems = [
                   {
                       "label": "Subtotal",
                       "type": "final",
                       "amount": amt
                   },
                   this.shippingMethod
               ];
               if (this.creditType === "credit") {
                   lineItems.push({
                       "label": "Credit Card Fee",
                       "amount": roundTo(0.0275*amt, 2),
                       "type": "final"
                   });
               }
               lineItems.push({
                   "label": "Estimated Tax",
                   "amount": roundTo(this.taxAmt*amt, 2),
                   "type": "final"
               });
               let totalAmt = 0;
               lineItems.forEach((item) => {
                   totalAmt += parseFloat(item.amount)||0;
               });
               totalAmt = roundTo(totalAmt, 2);
               this.totalAmount = totalAmt;
               
               return {
                   'lineItems': lineItems,  
                   total: {
                           type:  'final',
                           label: 'Total',
                           amount: totalAmt,
                       }
               };                        
           } catch (err) {
               console.error("getTransactionInfo error ", exMsg(err));
           }
       },  
       onGetTransactionInfo: function () {
           try {
               return this.getTransactionInfo();
           } catch (err) {
               console.error("onGetTransactionInfo error ", exMsg(err));
           }
       },  
       onGetShippingMethods: function()  {
           return [
               {
                   label: 'Free Shipping',
                   amount: '0.00',
                   identifier: 'free',
                   detail: 'Delivers in five business days',
               },
               {
                   label: 'Express Shipping',
                   amount: '5.00',
                   identifier: 'express',
                   detail: 'Delivers in two business days',
               },
           ];
       },
       onShippingContactSelected: function(shippingContact) {
           const self = this;
           return new Promise((resolve, reject) => {
               try {
                   console.log("shippingContact", JSON.stringify(shippingContact));
                   let taxAmt = 0.1;
                   const newShippingMethods = [
                       {
                           label: 'Free Shipping',
                           amount: '0.00',
                           identifier: 'free',
                           detail: 'Delivers in five business days',
                       }                                
                   ];
                   if (shippingContact && shippingContact.administrativeArea) {
                       if (shippingContact.administrativeArea === "NY") {
                           taxAmt = 0.0875;
                           newShippingMethods.push(
                                   {
                                       label: 'Overnight Shipping',
                                       amount: '10.00',
                                       identifier: 'overnight',
                                       detail: 'Delivers in one business days',
                                   }
                               );
                       } else if (shippingContact.administrativeArea === "NJ") {
                           taxAmt = 0.07;
                           newShippingMethods.push(
                               {
                                   label: 'Express Shipping',
                                   amount: '5.00',
                                   identifier: 'express',
                                   detail: 'Delivers in two business days',
                               }
                           );
                       }
                   }
                   const resp = self.getTransactionInfo(taxAmt, newShippingMethods[0]);
                   resp.shippingMethods = newShippingMethods;
                   resolve(resp);                            
               } catch (err) {
                   const apErr = {
                       code: "-101",
                       contactField: "",
                       message: exMsg(err)
                   }
                   console.error("onShippingContactSelected error.", exMsg(err));
                   reject({errors: [err]});
               }
           })                
       },
       onShippingMethodSelected: function(shippingMethod) {
           const self = this;
           return new Promise(function (resolve, reject) {
               try {
                   console.log("shippingMethod", JSON.stringify(shippingMethod));
                   const resp = self.getTransactionInfo(null, shippingMethod);
                   resolve(resp);                            
               } catch (err) {
                   const apErr = {
                       code: "-102",
                       contactField: "",
                       message: exMsg(err)
                   }
                   console.error("onShippingMethodSelected error.", exMsg(err));
                   reject({errors: [err]});
               }
           })                
       },
       onPaymentMethodSelected: function(paymentMethod) {
           const self = this;
           return new Promise((resolve, reject) => {
               try {
                   console.log("paymentMethod", JSON.stringify(paymentMethod));
                   const resp = self.getTransactionInfo(null, null, paymentMethod.type);
                   resolve(resp);                            
               } catch (err) {
                   const apErr = {
                       code: "-102",
                       contactField: "",
                       message: exMsg(err)
                   }
                   console.error("onPaymentMethodSelected error.", exMsg(err));
                   reject({errors: [err]});
               }
           })                
       },
       validateApplePayMerchant: function () {
           return new Promise((resolve, reject) => {
               try {
                   var xhr = new XMLHttpRequest();
                   xhr.open("POST", "https://api.cardknox.com/applepay/validate");
                   xhr.onload = function () {
                       if (this.status >= 200 && this.status < 300) {
                           console.log("validateApplePayMerchant", JSON.stringify(xhr.response));
                           resolve(xhr.response);
                       } else {
                           console.error("validateApplePayMerchant", JSON.stringify(xhr.response), this.status);
                           reject({
                               status: this.status,
                               statusText: xhr.response
                           });
                       }
                   };
                   xhr.onerror = function () {
                       console.error("validateApplePayMerchant", xhr.statusText, this.status);
                       reject({
                           status: this.status,
                           statusText: xhr.statusText
                       });
                   };
                   xhr.setRequestHeader("Content-Type", "application/json");
                   xhr.send();
               } catch (err) {
                   setTimeout(function () { console.log("getApplePaySession error: " + exMsg(err)) }, 100);
               }
           });
       },
       onValidateMerchant: function() {
           return new Promise((resolve, reject) => {
               try {
                   this.validateApplePayMerchant()
                   .then((response) => {
                       try {
                           console.log(response);
                           resolve(response);
                       } catch (err) {
                           console.error("validateApplePayMerchant exception.", JSON.stringify(err));
                           reject(err);
                       }
                   })
                   .catch((err) => {
                       console.error("validateApplePayMerchant error.", JSON.stringify(err));
                       reject(err);
                   });    
               } catch (err) {
                   console.error("onValidateMerchant error.", JSON.stringify(err));
                   reject(err);
               }
           });
       },
       authorize: function(applePayload, totalAmount) {
           return new Promise(function (resolve, reject) {
               var xhr = new XMLHttpRequest();
               xhr.open("POST", "https://<your domain>/<path to handle authorization>");
               xhr.onload = function () {
                   if (this.status >= 200 && this.status < 300) {
                       resolve(xhr.response);
                   } else {
                       reject({
                           status: this.status,
                           statusText: xhr.statusText
                       });
                   }
               };
               xhr.onerror = function () {
                   reject({
                       status: this.status,
                       statusText: xhr.statusText
                   });
               };
               const data = {
                   amount: totalAmount,
                   payload: applePayload
               };
               xhr.setRequestHeader("Content-Type", "application/json");
               xhr.send(JSON.stringify(data));
           });
       },
       onPaymentAuthorize: function(applePayload) {
           return new Promise((resolve, reject) => {
               try {
                   this.authorize(applePayload, this.totalAmount)
                   .then((response) => {
                       try {
                           console.log(response);
                           const resp = JSON.parse(response);
                           if (!resp)
                               throw "Invalid response: "+ response;
                           if (resp.xError) {
                               throw resp;
                           }
                           resolve(response);
                       } catch (err) {
                           throw err;
                           // reject(err);
                       }
                   })
                   .catch((err) => {
                       console.error("authorizeAPay error.", JSON.stringify(err));
                       apRequest.handleAPError(err);
                       reject(err);
                   });    
               } catch (err) {
                   console.error("onPaymentAuthorize error.", JSON.stringify(err));
                   apRequest.handleAPError(err);
                   reject(err);
               }
           });
       },
       onPaymentComplete: function(paymentComplete) {
           if (paymentComplete.response) { //Success
               const resp = JSON.parse(paymentComplete.response);
               if (resp.xRefNum) {
                   setTimeout(function(){ console.log("Thank you for your order:("+resp.xRefNum+")")}, 100);
               } else {
                   setTimeout(function(){ console.log("Thank you for your order.")}, 100);
               }
           } else if (paymentComplete.error) {
               console.error("onPaymentComplete", exMsg(paymentComplete.error));
               handleAPError(paymentComplete.error);
           }                        
       },
       handleAPError: function(err) {
           if (err && err.xRefNum) {
               setTimeout(function(){ alert("There was a problem with your order:("+err.xRefNum+")")}, 100);
           } else {
               setTimeout(function(){ alert("There was a problem with your order:"+exMsg(err))}, 100);
           }
       },
       initAP: function() {
           return {
               buttonOptions: this.buttonOptions,
               merchantIdentifier: "<Your Apple Merchant ID>",
               requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
               requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
               onGetTransactionInfo: "apRequest.onGetTransactionInfo",
               onGetShippingMethods: "apRequest.onGetShippingMethods",
               onShippingContactSelected: "apRequest.onShippingContactSelected",
               onShippingMethodSelected: "apRequest.onShippingMethodSelected",
               onPaymentMethodSelected: "apRequest.onPaymentMethodSelected",
               onValidateMerchant: "apRequest.onValidateMerchant",
               onPaymentAuthorize: "apRequest.onPaymentAuthorize",
               onPaymentComplete: "apRequest.onPaymentComplete",
               onAPButtonLoaded: "apRequest.apButtonLoaded",
               isDebug: true
           };
       },
       apButtonLoaded: function(resp) {
           if (!resp) return;
           if (resp.status === iStatus.success) {
               showHide(this.buttonOptions.buttonContainer, true);
               showHide("lbAPPayload", true);
           } else if (resp.reason) {
               console.log(resp.reason);
           }
       }
   }
   ```
2. **Let’s enable Apple Pay for the website:**

   ```javascript
   document.addEventListener("DOMContentLoaded", function(event) { 
       .....
       ckApplePay.enableApplePay({
           initFunction: 'apRequest.initAP',
           amountField: 'amount'
       });
       .....
   }
   ```
3. To see the full solution please click [**here**](/mobile-wallets/apple-pay-hosted-checkout/apple-pay-ifields-integration)**.**


# Apple Pay Features

## Overview

In this section we will describe the new Apple Pay features supported by Sola. Please note that every feature is supported starting with certain iOS version. This means that if you requesting a feature (Recurring for example) and it requires iOS 15.4 - Apple Pay button will be shown on consumer devices with iOS 15.4+

#### Available Features

* Address Validation
* Support Recurring
* Support Subscription - For subscriptions you have to follow [Apple Pay Guidelines](https://developer.apple.com/design/human-interface-guidelines/technologies/apple-pay/subscriptions-and-donations)

In order to take advantage of any new feature Sola supports, you need to request it through [ApplePayRequest](https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#applepayrequest) endpoint. The requiredFeatures object contains features from the [Available Features](https://docs.cardknox.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request#aprequiredfeatures) list.<br>

<table data-header-hidden><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Feature</strong></td><td><strong>Feature Code</strong></td></tr><tr><td>Address Validation</td><td><pre><code>APRequiredFeatures.address_validation
</code></pre></td></tr><tr><td>Support Recurring</td><td><pre><code>APRequiredFeatures.support_recurring
</code></pre></td></tr><tr><td>Support Subscription</td><td><pre><code>APRequiredFeatures.support_subscription
</code></pre></td></tr></tbody></table>

**Apple Pay Request example**

```
initAP: function() {
  return {
    buttonOptions: this.buttonOptions,
    merchantIdentifier: "<your merchant>",
    ..................................
    requiredFeatures: [APRequiredFeatures.address_validation, APRequiredFeatures.support_recurring],
    ..................................
    requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
    requiredShippingContactFields: ['postalAddress', 'name', 'phone', 'email'],
  };
}
```


# Set up Apple Pay Merchant ID with Sola

## Setting up Apple Pay Merchant ID

1. Login to <https://portal.solapayments.com/login>
2. Navigate to Gateway Settings > Payment Methods
3. Click on “Configure Apple Pay“<br>


# Click-To-Pay - Hosted Checkout

## Overview

Click-To-Pay Hosted Checkout is our simple integration that enables online Click-To-Pay processing through the Sola gateway. This landing page contains all of the links and references needed for setting up and maintaining Click-To-Pay Checkout Experience.

\
Please reference the **Initial Setup** and Click-To-Pay **Resources** sections below.

## Flow

There are three possible scenario:

1. **New User**\
   In this case Click-To-Pay Experience will be presented as a button\
   ![](/files/fZNJJen6xl4XeVdC04Af)
2. **Recognized User**\
   Consumer’s cards will be displayed\
   ![](/files/UJKmguSVzzRUXIPW2iTm)
3. **Recognized Device**\
   An email screen to identify the consumer and load his cards\
   ![](/files/soISUXM5NMSyYn2P9WAK)<br>

## Click-To-Pay Resources

The following pages can be found by viewing the navigation bar on the left side of the screen.

* [Initial Setup](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup)
* [Sample Code](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-sample-code)
* [iFields Integration](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-ifields-integration)
* [Request Objects](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-request)
* [Response Objects](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-response)


# Click-To-Pay Initial Setup

## Overview

Our simple iFields integration enables online Click-To-Pay processing through the Sola gateway.\
This document details the steps necessary to integrate Click-To-Pay with your site.

**Contents**

* [Prerequisites](#prerequisites)
* [Client-Side Integration](#client-side-integration)
  * [Adding Reference to iFields](#adding-reference-to-ifields)
  * [Adding JavaScript Objects for Click-To-Pay button](#adding-javascript-objects-for-click-to-pay-button)
  * [Enabling Click-To-Pay](#enable-click-to-pay)
* [Server-Side Integration](#server-side-integration)
  * [Server Endpoint Creation](#server-endpoint-creation)
  * [API Integration](#api-integration)

## Prerequisites

Register for Click-To-Pay: See \[insert link here]

## Implementing Click-To-Pay

### Client-Side Integration

#### Adding Reference to iFields

{% hint style="info" %}
Find the latest version of iFields at: [https://cdn.cardknox.com/ifields/versions.htm](https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcdn.cardknox.com%2Fifields%2Fversions.htm\&data=04%7C01%7Csaltman%40cardknox.com%7Cee27e2f8cee34d8eb64108d96965fb39%7Cbee12808a32d4518bad72e695a86fc91%7C0%7C0%7C637656709056206810%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000\&sdata=EkulORguWhCwZ%2BApGRr3WBqvzxcnnMsHj6w2nxzCwog%3D\&reserved=0)
{% endhint %}

&#x20;

**Step 1:** Add the iFields.js file after the \<head> tag on your payment page:

```html
<script src=https://cdn.cardknox.com/ifields/**ifields-version-number**/ifields.min.js></script>
```

&#x20;

#### Adding JavaScript Objects for Click-To-Pay button

**Step 1:** Add the following JS snippet inside the *\<body>* where the Click-To-Pay button is desired.

```html
<div id="click2payContainer">
</div>
```

&#x20;

**Step 2:** Create JavaScript object that holds all of the properties/methods required to process Click-To-Pay.

```javascript
           const click2payRequest = {
                paymentPrefill: function(){
                    const result = {
                        merchantRequestId: "Merchant defined request ID",
                        currencyCode: "USD",
                        description: "...corp Product",
                        orderId: "Merchant defined order ID",
                        promoCode: "Merchant defined promo code",
                        subtotal: roundTo(getAmount(), 2),
                        shippingHandling: "2.00",
                        tax: "2.00",
                        discount: "1.00",
                        giftWrap: "2.00",
                        misc: "1.00",
                        setTotal:  function() {
                            this.total = roundTo(
                                roundToNumber(this.subtotal, 2)
                                + roundToNumber(this.shippingHandling, 2)
                                + roundToNumber(this.tax, 2)
                                + roundToNumber(this.giftWrap, 2)
                                + roundToNumber(this.misc, 2)
                                - roundToNumber(this.discount, 2)
                            , 2);
                            delete this.setTotal;
                            return this;
                        },
                    }.setTotal();
                    logDebug({
                        label: "paymentPrefill",
                        data: result
                    });
                    return result;
		        },
                paymentCallback: function (payload) {
                    click2payRequest.setPayload(payload);
                },
                setPayload: function (value) {
                    document.getElementById('c2p-payload').value = JSON.stringify(value, null, 2);
                    showHide("divC2PPayload", value);
                }
            }
```

&#x20;                                       &#x20;

For a full sample code please refer to [Click-To-Pay Sample Code](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-sample-code)

&#x20;

**Step 3:** Implement desired callbacks.

For the list of available callbacks, please refer to [Click-To-Pay Request](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-request) object.

There are two main callbacks that must be implemented (the rest are optional):

* onPaymentPrefill - calculates total amount and sets transaction information.
* onPaymentSuccess - a callback that will be called after the consumer pays and Click-To-Pay returns a payload with all of the requested consumer information. This is where you need to make an ajax call to your server with the payload. The sample for making an ajax call is below:

*Sample Code for Making Ajax Call:*

```javascript
onPaymentSuccess: function(clickToPayResponse) {
    return new Promise(function (resolve, reject) {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "https://<your domain>/<path to handle authorization>");
        xhr.onload = function () {
            if (this.status >= 200 && this.status < 300) {
                resolve(xhr.response);
            } else {
                reject({
                    status: this.status,
                    statusText: xhr.statusText
                });
            }
        };
        xhr.onerror = function () {
            reject({
                status: this.status,
                statusText: xhr.statusText
            });
        };
        xhr.setRequestHeader("Content-Type", "application/json");
        xhr.send(JSON.stringify(clickToPayResponse));
    });
}
```

&#x20;

For full integration code, please refer to [Click-To-Pay iFields Integration](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-ifields-integration)

#### Enable Click-To-Pay

**window\.ckClickToPay object** - controls initialization of Click-To-Pay button

| **Method**       | **Call Required** | **Description**                              |
| ---------------- | ----------------- | -------------------------------------------- |
| enableClickToPay | Yes               | Initializes and enables Click-To-Pay Button. |

#### enableClickToPay Parameters

| **Name**       | **Type** | **Required** | **Description**                                                 |
| -------------- | -------- | ------------ | --------------------------------------------------------------- |
| initParameters | Object   | Yes          | Object that contains initialization parameters for Click-To-Pay |

{% hint style="info" %}
For full list of Init Parameters, please refer to [Click-To-Pay Request Object](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-request#clicktopayrequest)
{% endhint %}

***

{% code title="Enable Click-To-Pay example" %}

```javascript
ckClick2Pay.enableClickToPay({
    environment: c2pEnvironment.sandbox, 
    externalClientId: "<Your externalClientId>",
    click2payContainer: "click2payContainer", 
    onPaymentPrefill: click2payRequest.paymentPrefill,
    onPaymentSuccess: click2payRequest.paymentCallback
});   
```

{% endcode %}

***

### Server-Side Integration

#### Server Endpoint Creation

A server endpoint is needed in order to accept the Click-To-Pay Payload from your website.

**Step 1:** Create an endpoint and method for API Integration on your server side that takes a Click-To-Pay Payload and makes a call to Sola.

For full list of Returned Parameters, please refer to Click-To-Pay Response Reference

#### API Integration

This section assumes that you already know how to integrate other payments with [Sola API](/api/transaction).

**Below are the steps to integrate Click-To-Pay with the Sola API:**

Once the consumer confirms the payment, Click-To-Pay API generates a [Click-To-Pay Response](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-response#clicktopayresponse-object) in the form of a JSON string.

Integration Steps:

1. Set the required fields:
   1. xDigitalWalletType to ClickToPay
   2. xClickToPayTransactionId to clickToPayResponse.payload.transactionId
   3. xClickToPayExternalClientId to clickToPayResponse.payload.externalClientId
   4. xClickToPayEncryptionKey to clickToPayResponse.payload.encryptionKey
   5. xCardNum to clickToPayResponse.payload.token
   6. xAmount to clickToPayResponse.amount
   7. xCommand - Set to one of the values that starts with cc: like cc:sale, cc:auth, etc.
   8. xKey to "Your xKey"
   9. xVersion = "4.5.9"
   10. xSoftwareName to “Your Software Name"
   11. xSoftwareVersion to "Your Software Version"

Sample Request:

```javascript
public async Task<IActionResult> Authorize(clickToPayResponse resp) 
{
	var reqGateway = new
	{
		xKey = "Your xKey", 
		xDigitalWalletType = "ClickToPay",        
		xAmount = (decimal)resp.amount,
		xClickToPayTransactionId = resp.payload.transactionId,
		xClickToPayExternalClientId = resp.payload.externalClientId,
		xClickToPayEncryptionKey = resp.payload.encryptionKey,
		xCardNum = resp.payload.token,
		xCommand = "cc:sale",
		xVersion = "4.5.8",
		xSoftwareName= "Your Software Name",
		xSoftwareVersion = "Your Software Version"
	};
	var respMsg = "";
	using (var http = new HttpClient())
	{
		var resp = await http.PostAsJsonAsync("https://x1.cardknox.com/gatewayJSON", reqGateway);
		respMsg = await resp.Content.ReadAsStringAsync();
		.....
	}
	.....
}	
```

For more details, please contact your Sola Representative.

## Questions?

Contact <support@solapayments.com>

&#x20;

&#x20;


# Click-To-Pay Sample Code

1. **Let's define a helper object with all necessary components:**

   ```javascript
   const click2payRequest = {
       paymentPrefill: function(){
           const result = {
               merchantRequestId: "Merchant defined request ID",
               currencyCode: "USD",
               description: "...corp Product",
               orderId: "Merchant defined order ID",
               promoCode: "Merchant defined promo code",
               subtotal: roundTo(getAmount(), 2),
               shippingHandling: "2.00",
               tax: "2.00",
               discount: "1.00",
               giftWrap: "2.00",
               misc: "1.00",
               setTotal:  function() {
                   this.total = roundTo(
                       roundToNumber(this.subtotal, 2)
                       + roundToNumber(this.shippingHandling, 2)
                       + roundToNumber(this.tax, 2)
                       + roundToNumber(this.giftWrap, 2)
                       + roundToNumber(this.misc, 2)
                       - roundToNumber(this.discount, 2)
                   , 2);
                   delete this.setTotal;
                   return this;
               },
           }.setTotal();
           logDebug({
               label: "paymentPrefill",
               data: result
           });
           return result;
       },
       authorize: function(payload) {
           return new Promise(function (resolve, reject) {
               var xhr = new XMLHttpRequest();
               xhr.open("POST", "https://<your domain>/<path to handle authorization>");
               xhr.onload = function () {
                   if (this.status >= 200 && this.status < 300) {
                       resolve(xhr.response);
                   } else {
                       reject({
                           status: this.status,
                           statusText: xhr.statusText
                       });
                   }
               };
               xhr.onerror = function () {
                   reject({
                       status: this.status,
                       statusText: xhr.statusText
                   });
               };
               xhr.setRequestHeader("Content-Type", "application/json");
               xhr.send(JSON.stringify(payload));
           });
       },
       paymentSuccess: async function(clickToPayResponse) {
           return new Promise((resolve, reject) => {
               try {
                   const response = await this.authorize(clickToPayResponse);
                   console.log(response);
                   const resp = JSON.parse(response);
                   if (!resp)
                       throw "Invalid response: "+ response;
                   if (resp.xError) {
                       throw resp;
                   }
                   resolve(response);
               } catch (err) {
                   console.error("paymentSuccess error.", JSON.stringify(err));
                   reject(err);
               }
           });
       },a
       paymentCallback: function (clickToPayResponse) {
           click2payRequest.setPayload(clickToPayResponse);
       },
       cpButtonLoaded: function(resp) {
           if (!resp) return;
           if (resp.status === iStatus.success) {
               showHide("click2payContainer", true);
           } else if (resp.reason) {
               console.log(resp.reason);
           }
       },
       setPayload: function (value) {
           document.getElementById('c2p-payload').value = JSON.stringify(value, null, 2);
           showHide("divC2PPayload", value);
       }
   }
   ```
2. **Let’s enable Click-To-Pay for the website:**

   ```javascript
   document.addEventListener("DOMContentLoaded", function(event) { 
       .....
       ckClick2Pay.enableClickToPay({
         environment: c2pEnvironment.sandbox, 
         externalClientId: "<Your externalClientId>",
         click2payContainer: "click2payContainer", 
         onPaymentPrefill: click2payRequest.paymentPrefill,
         onPaymentSuccess: click2payRequest.paymentSuccess,
         onPaymentError: click2payRequest.paymentCallback,
         onPaymentCancel: click2payRequest.paymentCallback,
         onButtonLoaded: click2payRequest.cpButtonLoaded
     });
   .....
   }
   ```
3. To see the full solution please click [**here**](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-ifields-integration)**.**


# Click-To-Pay iFields Integration

{% code lineNumbers="true" %}

```javascript
<!-- Use the following src for the script on your form and replace ****version**** with the desired version: src="https://cdn.cardknox.com/ifields/****version****/ifields.min.js" -->     
<script src="ifields.min.js"></script> 
<script type="text/javascript">
    document.addEventListener("DOMContentLoaded", function(event) { 
        ckClick2Pay.enableClickToPay({
          environment: c2pEnvironment.sandbox, 
          externalClientId: "<Your externalClientId>",
          click2payContainer: "click2payContainer", 
          onPaymentPrefill: click2payRequest.paymentPrefill,
          onPaymentSuccess: click2payRequest.paymentSuccess,
          onPaymentError: click2payRequest.paymentCallback,
          onPaymentCancel: click2payRequest.paymentCallback,
          onButtonLoaded: click2payRequest.cpButtonLoaded
      });            
    });

    const click2payRequest = {
        paymentPrefill: function(){
            const result = {
                merchantRequestId: "Merchant defined request ID",
                currencyCode: "USD",
                description: "...corp Product",
                orderId: "Merchant defined order ID",
                promoCode: "Merchant defined promo code",
                subtotal: roundTo(getAmount(), 2),
                shippingHandling: "2.00",
                tax: "2.00",
                discount: "1.00",
                giftWrap: "2.00",
                misc: "1.00",
                setTotal:  function() {
                    this.total = roundTo(
                        roundToNumber(this.subtotal, 2)
                        + roundToNumber(this.shippingHandling, 2)
                        + roundToNumber(this.tax, 2)
                        + roundToNumber(this.giftWrap, 2)
                        + roundToNumber(this.misc, 2)
                        - roundToNumber(this.discount, 2)
                    , 2);
                    delete this.setTotal;
                    return this;
                },
            }.setTotal();
            logDebug({
                label: "paymentPrefill",
                data: result
            });
            return result;
        },
        authorize: function(payload) {
            return new Promise(function (resolve, reject) {
                var xhr = new XMLHttpRequest();
                xhr.open("POST", "https://<your domain>/<path to handle authorization>");
                xhr.onload = function () {
                    if (this.status >= 200 && this.status < 300) {
                        resolve(xhr.response);
                    } else {
                        reject({
                            status: this.status,
                            statusText: xhr.statusText
                        });
                    }
                };
                xhr.onerror = function () {
                    reject({
                        status: this.status,
                        statusText: xhr.statusText
                    });
                };
                xhr.setRequestHeader("Content-Type", "application/json");
                xhr.send(JSON.stringify(payload));
            });
        },
        paymentSuccess: async function(clickToPayResponse) {
            return new Promise((resolve, reject) => {
                try {
                    const response = await this.authorize(clickToPayResponse);
                    console.log(response);
                    const resp = JSON.parse(response);
                    if (!resp)
                        throw "Invalid response: "+ response;
                    if (resp.xError) {
                        throw resp;
                    }
                    resolve(response);
                } catch (err) {
                    console.error("paymentSuccess error.", JSON.stringify(err));
                    reject(err);
                }
            });
        },                
        paymentCallback: function (clickToPayResponse) {
            click2payRequest.setPayload(clickToPayResponse);
        },
        cpButtonLoaded: function(resp) {
            if (!resp) return;
            if (resp.status === iStatus.success) {
                showHide("click2payContainer", true);
            } else if (resp.reason) {
                console.log(resp.reason);
            }
        },
        setPayload: function (value) {
            document.getElementById('c2p-payload').value = JSON.stringify(value, null, 2);
            showHide("divC2PPayload", value);
        }
    };
    
    function showHide(elem, toShow) {
        if (typeof(elem) === "string") {
            elem = document.getElementById(elem);
        }
        if (elem) {
            toShow ? elem.classList.remove("hidden") : elem.classList.add("hidden");
        }
    }
    function getAmount () {
        return roundToNumber(document.getElementById("amount").value || "0", 2);
    }
</script>
<style> 
    body {
        margin: 10px;
    }
    div.main {
			width: 350px;
		}
    .c2p {
        display: block;
        border: 0;
        width: 260px;
        margin-bottom: 0;
    }
    .c2p .txt-signin{
        width: 90% !important;
    }

    input {
        border: 1px solid black;
        font-size: 14px;
        padding: 3px;
        width: 250px;
        margin-bottom: 12px;
    }

    .hidden {
        display: none;
    }

    textarea {
        border: 1px solid black;
        width: 100%;
    }
</style>
</head>
<body>
<div class="main">
<form id="payment-form" method="POST">
    <input id="amount" name="xAmount" placeholder="Amount" type="number" inputmode="decimal"></input>
    <br/>
    <div id="click2payContainer" class="c2p hidden">
        <br/>
    </div>
    <br/>
    <div id="divC2PPayload" class="hidden">
        <label id="lbc2pPayload">Click-To-Pay Payload: </label>
        <br />
        <textarea id="c2p-payload" rows="10" readonly="true"></textarea>
        <br/>
    </div>
</form>
</div>
</body>    
```

{% endcode %}


# Click-To-Pay Objects Reference (Request)

***For complete sample code please refer*** [***here***](/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-sample-code)

### **Available dictionary objects**

#### iStatus

```javascript
const iStatus = {
    success: 100,
    unsupported: -100,
    error: -200
}
```

**Use:** iStatus.success

#### c2pEnvironment

```javascript
const c2pEnvironment = {
    sandbox: 0,
    production: 1
}
```

**Use:** c2pEnvironment.sandbox

#### c2pReviewAction

```javascript
const c2pReviewAction = {
    pay: "PAY",
    continue: "CONTINUE"
}
```

**Use:** c2pReviewAction.pay

### **Request objects**

#### ClickToPayRequest

**The Main object that contains all the information necessary to communicate with Click-To-Pay API.**

| **Name**                         | **Type**                            | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                                                      |
| -------------------------------- | ----------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `environment`                    | [c2pEnvironment](#c2penvironment)   | Yes          | <p>Can be either<br><code>c2pEnvironment.sandbox</code> or<br><code>c2pEnvironment.production</code></p>                                                                                                                                                                                                                                                                             |
| `externalClientId`               | String                              | Yes          | <p>ID assigned to your merchant by<br>Click-To-Pay Registration</p>                                                                                                                                                                                                                                                                                                                  |
| `click2payContainer`             | String                              | Yes          | <p>ID of the main div that will host the<br>Click-To-Pay experience</p>                                                                                                                                                                                                                                                                                                              |
| `mainCssClass`                   | String                              | No           | <p>Default: <code>c2p-def</code><br>To override default styling, use<br>this field to provide the name of your<br>own css class</p>                                                                                                                                                                                                                                                  |
| `displayWaitScreenAfterCheckout` | Boolean                             | No           | <p>Default: <code>true</code><br>After checkout Click-To-Pay control<br>will be automatically reloaded.<br>This controls if “Wait“ screen is set<br>during that operation</p>                                                                                                                                                                                                        |
| `reviewAction`                   | [c2pReviewAction](#c2previewaction) | No           | <p>Default: <code>c2pReviewAction.pay</code><br>Controls final Button caption<br>consumer clicks to make the payment</p>                                                                                                                                                                                                                                                             |
| `onButtonLoaded`                 | Function                            | No           | <p>A callback function to be called when<br>Click-To-Pay button is loaded.<br>Accepts an object of type<br><a href="#cpbuttonloadedresult-object">CPButtonLoadedResult</a><br>Please click <a href="https://docs.cardknox.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-request#oncpbuttonloaded-callback-example">here</a> for the sample code</p> |
| `onPaymentPrefill`               | Function                            | Yes          | <p>A callback function that returns the<br>final price and tax calculations.<br>Please click <a href="#onpaymentprefill-callback-example">here</a> for the sample code</p>                                                                                                                                                                                                           |
| `onPaymentValidate`              | Function                            | No           | <p>A callback function to be called<br>before Payment is made.<br>Usually used to make custom<br>validations before the payment.<br>Please click <a href="#onpaymentvalidate-callback-example">here</a> for the sample code</p>                                                                                                                                                      |
| `onPaymentSuccess`               | Function                            | Yes          | <p>A callback function to be called when<br>Click-To-Pay Payment is authorized<br>for the completion of the transaction.<br>This function accepts a parameter of<br><a href="/pages/g2phzJSBRNpRUlMMeFQN#clicktopayresponse-object">ClickToPayResponse</a>.<br>Please click <a href="#onpaymentsuccess-callback-example">here</a> for the sample code</p>                            |
| `onPaymentCancel`                | Function                            | No           | <p>A callback function to be called when<br>user cancels.<br>Please click <a href="#onpaymentcancel-callback-example">here</a> for the sample code</p>                                                                                                                                                                                                                               |
| `onPaymentError`                 | Function                            | No           | <p>A callback function to be called when<br>payment errors out.<br>Please click <a href="#onpaymenterror-callback-example">here</a> for the sample code</p>                                                                                                                                                                                                                          |

#### **onCPButtonLoaded callback example**

```javascript
onCPButtonLoaded: function(resp) {
    if (!resp) return;
    if (resp.status === iStatus.success) {
        showHide("click2payContainer", true);
    } else if (resp.reason) {
        console.log(resp.reason);
    }
}
```

#### **onPaymentPrefill callback example**

```javascript
onPaymentPrefill: function(){
  const result = {
    merchantRequestId: "Merchant defined request ID",
    currencyCode: "USD",
    description: "...corp Product",
    orderId: "Merchant defined order ID",
    promoCode: "Merchant defined promo code",
    subtotal: roundTo(getAmount(), 2),
    shippingHandling: "2.00",
    tax: "2.00",
    discount: "1.00",
    giftWrap: "2.00",
    misc: "1.00",
    setTotal:  function() {
        this.total = roundTo(
            roundToNumber(this.subtotal, 2)
            + roundToNumber(this.shippingHandling, 2)
            + roundToNumber(this.tax, 2)
            + roundToNumber(this.giftWrap, 2)
            + roundToNumber(this.misc, 2)
            - roundToNumber(this.discount, 2)
        , 2);
        delete this.setTotal;
        return this;
    }
  }.setTotal();
  return result;
}
```

#### **onPaymentValidate callback example**

```javascript
onPaymentValidate: function () {
    return new Promise(function (resolve, reject) {
        try {
            //Do some validation here
            resolve(iStatus.success);
        } catch (err) {
            reject(err);
        }
    });
}
```

#### **onPaymentSuccess callback example**

```javascript
onPaymentSuccess: async function(clickToPayResponse) {
    return new Promise((resolve, reject) => {
        try {
            const response = await this.authorize(clickToPayResponse);
            console.log(response);
            const resp = JSON.parse(response);
            if (!resp)
                throw "Invalid response: "+ response;
            if (resp.xError) {
                throw resp;
            }
            resolve(response);
        } catch (err) {
            console.error("paymentSuccess error.", JSON.stringify(err));
            reject(err);
        }
    });
}
```

#### **onPaymentCancel callback example**

```javascript
onPaymentCancel: function (payload) {
    logError("Click-To-Pay Cancelled", payload);
    //Do some custom logic here
}
```

#### **onPaymentError callback example**

```javascript
onPaymentCancel: function (payload) {
    logError("Click-To-Pay Error", payload);
    //Do some custom logic here
}
```

***

#### CPButtonLoadedResult Object

| **Name** | **Type**            | **Description**                                                                                                                                                                                                                        |
| -------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status   | [iStatus](#istatus) | <p>There are be 3 possible cases:</p><ul><li>Click-To-Pay Button loaded successfully: <code>status = iStatus.success</code></li><li>An error occurred while loading Click-To-Pay Button: <code>status = iStatus.error</code></li></ul> |
| reason   | String              | If Click-To-Pay Button failed to load this field will be populated with the reason.                                                                                                                                                    |

***


# Click-To-Pay Objects Reference (Response)

### **Response objects**

***

#### ClickToPayResponse Object

| **Name**            | **Type**                                       | **Always exists** | **Description**                                                                    |
| ------------------- | ---------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------- |
| `status`            | String                                         | Yes               | Contains all transaction data. For more details please click on the link           |
| `amount`            | Decimal                                        | Yes               | This is a response object that's returned by Google after a payer approves payment |
| `merchantRequestId` | String                                         | No                | This is a response object that's returned by Google after a payer approves payment |
| `merchantOrderId`   | String                                         | No                | This is a response object that's returned by Google after a payer approves payment |
| `payload`           | [ClickToPayPayload](#clicktopaypayload-object) | Yes               | This is a response object that's returned by Google after a payer approves payment |

***

#### ClickToPayPayload Object

| **Name**           | **Type** | **Always exists** | **Description**                                                                                                                           |
| ------------------ | -------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionId`    | String   | Yes               | A unique identifier for this payment                                                                                                      |
| `externalClientId` | String   | Yes               | Information about the card used in the transaction.                                                                                       |
| `encryptionKey`    | String   | Yes               | A unique identifier for this payment                                                                                                      |
| `token`            | String   | Yes               | An object containing the encrypted payment data. **This is the object that needs to be Base64 Encoded and sent to gateway as** `xCardNum` |

***

**ClickToPayResponse object example**

```json
{
  "status": "success",
  "amount": 6,
  "merchantRequestId": "Merchant defined request ID",
  "merchantOrderId": "Merchant defined order ID",
  "payload": {
    "transactionId": "1947120568389887601",
    "externalClientId": "test123",
    "encryptionKey": "Pqdjv842Nv...8q14l",
    "token": "FPA6TTy0q457.....tCf+tqH5/ruIQ1Iz4FI9hE5NBD+EM="
  }
}
```


# Google Pay Hosted Checkout

## Overview <a href="#overview" id="overview"></a>

Google Pay Hosted Checkout is our simple integration that enables online Google Pay processing through the Sola gateway. This document details the steps necessary to integrate Google Pay Hosted Checkout with your site.

**Contents**

* Server-Side Integration
  * Server Endpoint Creation
  * API Integration
* Client-Side Integration
  * Adding Reference to iFields
  * Adding iFrame and JavaScript objects for the Google Pay button
  * Enabling Google Pay

## Implementing Google Pay Hosted Checkout <a href="#implementing-google-pay-hosted-checkout" id="implementing-google-pay-hosted-checkout"></a>

### Server-Side Integration <a href="#server-side-integration" id="server-side-integration"></a>

#### Server Endpoint Creation <a href="#server-endpoint-creation" id="server-endpoint-creation"></a>

A server endpoint is needed in order to accept the Google Payload from Hosted Checkout.

**Step 1:** Create an endpoint and method for API Integration on your server side that takes the [Google Payload](/mobile-wallets/google-pay-hosted-checkout/response-objects) and makes a call to Sola.<br>

#### API Integration <a href="#api-integration" id="api-integration"></a>

**Below are the steps to integrate Google Pay with the Sola API:**

Once the consumer confirms the payment, Google Pay API generates a token in the form of a JSON string.

Integration Steps:

1. Encode that token with Base64 encoding.
2. Set `xCardNum` field to the encoded token above.
3. Set `xDigitalWalletType` to `GooglePay`.
4. Set the remaining required fields:
   1. `xAmount` to `transactionInfo.totalPrice` - this is the consumer-approved amount from the Google Pay payment sheet.
   2. `xCommand` - Set to one of the values that start with `cc:` like `cc:sale`, `cc:auth`, etc.
   3. `xBillFirstName`
   4. `xBillLastName`
   5. `xBillStreet` if available
   6. `xBillCity` if available
   7. `xBillState` if available
   8. `xBillZip`

For more details, please contact your Sola Representative.

### Client-Side Integration <a href="#client-side-integration" id="client-side-integration"></a>

#### Adding Reference to iFields <a href="#adding-reference-to-ifields" id="adding-reference-to-ifields"></a>

{% hint style="info" %}
Find the latest version of iFields [here](https://cdn.cardknox.com/ifields/versions.htm).
{% endhint %}

**Step 1:** Add the iFields .js file after the \<head> tag on your payment page:

```javascript
<script src=https://cdn.cardknox.com/ifields/**ifields-version-number**/ifields.min.js></script>
```

#### Adding iFrame and JavaScript Objects for Google Pay button <a href="#adding-iframe-and-javascript-objects-for-google-pay-button" id="adding-iframe-and-javascript-objects-for-google-pay-button"></a>

**Step 1:** Add the following iFrame JS snippet inside the *\<body>* where the Google Pay button is desired.

* Make sure you have an attribute `data-ifields-id="igp"` as part of *\<iframe>* tag
* Make sure you have an attribute `data-ifields-oninit="gpRequest.initGP"` as part of *\<iframe>* tag where “gpRequest.initGP“ is a function name that initializes a [Google Pay Object](/mobile-wallets/google-pay-hosted-checkout/request-objects#GooglePayRequest)

```markup
<iframe id="igp" class="gp hidden" 
data-ifields-id="igp" data-ifields-oninit="gpRequest.initGP" 
src=https://cdn.cardknox.com/ifields/**ifields-version-number**/igp.htm 
allowpaymentrequest sandbox="allow-popups allow-modals allow-scripts allow-same-origin
allow-forms allow-popups-to-escape-sandbox allow-top-navigation"> 
</iframe>
```

**Step 2:** Create JavaScript object that holds all of the properties/methods required to process Google Pay.

```javascript
window.gpRequest = {
merchantInfo: {
merchantName: "Example Merchant"
},                
buttonOptions: {                               
buttonSizeMode: GPButtonSizeMode.fill
},                
billingParams: {
//phoneNumberRequired: true,
emailRequired: true,
billingAddressRequired: true,                               
billingAddressFormat: GPBillingAddressFormat.full                                        
}}
```

{% hint style="info" %}
Full a full sample code, refer to the iFields [document.](/products/ifields)
{% endhint %}

**Step 3:** Implement desired callbacks.

For the list of available callbacks, please refer to [Google Pay Object](/mobile-wallets/google-pay-hosted-checkout/request-objects#GooglePayRequest).

* The two main functions below need to be implemented (the rest are optional):
  * **onGetTransactionInfo:** calculates the total amount based on the charge amount, fees, taxes, shipping costs, etc.
  * **onProcessPayment** - a callback that will be called after the consumer pays and Google returns a token with all other requested consumer information like billing address, shipping address, etc. This is where you need to make an ajax call to your server with the Google Payload. The sample for making an ajax call please see below.

*Sample Code for making Ajax Call:*

```javascript
initGP: function authorizeGPay(googlePayload) {
    return new Promise(function (resolve, reject) {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", https://yourserver.com/your-endpoint);
        xhr.onload = function () {
            if (this.status >= 200 && this.status < 300) {
                resolve(xhr.response);
            } else {
                reject({
                    status: this.status,
                    statusText: xhr.statusText
                });
            }
        };
        xhr.onerror = function () {
            reject({
                status: this.status,
                statusText: xhr.statusText
            });
        };
        xhr.setRequestHeader("Content-Type", "application/json");
        xhr.send(JSON.stringify(googlePayload));
    });
}
```

{% hint style="info" %}
For full sample code, please refer to [Google Pay Sample Code](/mobile-wallets/google-pay-hosted-checkout/sample-code).
{% endhint %}

**Step 4:** Create JavaScript function that will initialize iFields.

```javascript
function initGP() {

    return {
        merchantInfo: gpRequest.merchantInfo,
        buttonOptions: gpRequest.buttonOptions,
        onGetTransactionInfo: "gpRequest.onGetTransactionInfo",
        environment: gpRequest.environment,
        billingParameters: gpRequest.billingParams,
        shippingParameters: {
            emailRequired: gpRequest.shippingParams.emailRequired,
            onGetShippingCosts: "gpRequest.shippingParams.onGetShippingCosts",
            onGetShippingOptions: "gpRequest.shippingParams.onGetShippingOptions"
        },

        onBeforeProcessPayment: "gpRequest.onBeforeProcessPayment",
        onProcessPayment: "gpRequest.onProcessPayment",
        onPaymentCanceled: "gpRequest.onPaymentCanceled",
        onGPButtonLoaded: "gpButtonLoaded"
    };
}
```

Make sure that the iFrame attribute`data-ifields-oninit` has the name of this function.

The initGP() function above returns [Google Pay Object.](/mobile-wallets/google-pay-hosted-checkout/request-objects#GooglePayRequest)

#### Enable Google Pay <a href="#enable-google-pay" id="enable-google-pay"></a>

**window\.ckGooglePay** **object** - controls initialization of Google Pay button.

| **Method**        | **Call Required** | **Description**                                                                                                                     |
| ----------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `enableGooglePay` | Yes               | <p>Initializes and enables Google Pay Button.<br>Takes <a href="#enablegooglepayparams-object">EnableGooglePayParams</a> object</p> |
| `updateAmount`    | Conditional       | Updates amount on Google Sheet.                                                                                                     |

You can provide either All, One or None of the parameters for `enableGooglePay` call.

* `amountField` specified - in this case, the Google Pay total amount will be automatically updated whenever the amount has changed.
* `amountField` *is not* specified - in this case, it’s up to you to provide the correct amount for Google Pay. One of the ways to do it is to call `window.ckGooglePay.updateAmount` manually.
* `iframeField` specified - this value will be used to communicate, with Google Pay button.\
  This option is especially helpful for Angular clients using shadow DOM.
* `iframeField` *is not* specified - its value will be calculated based on `data-ifields-id` attribute.\
  In this case, it must be set to “igp“: `data-ifields-id="igp"`.

#### **EnableGooglePayParams Object**

| **Name**      | **Type**       | **Required** | **Description**                                                                                                                          |
| ------------- | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `amountField` | String\|Object | No           | <p>Field containing <code>amount</code>.<br>Could be either the name of the field (String) or the<br>field itself (Object)</p>           |
| `iframeField` | String\|Object | No           | <p>Field containing iFrame with Google Pay button.<br>Could be either the name of the field (String) or the<br>field itself (Object)</p> |

#### **Enable Google Pay example**

`ckGooglePay.enableGooglePay({amountField: 'amount'});`<br>

## Questions? <a href="#questions" id="questions"></a>

Check out the Google Pay FAQ page [here](/mobile-wallets/google-pay-hosted-checkout/google-pay-faq).

For additional questions, contact <support@solapayments.com>


# Google Pay Control Object

#### window\.ckGooglePay object - controls initialization of Google Pay button.

| **Method**      | **Call Required** | **Description**                                                                         |
| --------------- | ----------------- | --------------------------------------------------------------------------------------- |
| enableGooglePay | Yes               | <p>Initializes and enables Google Pay Button.<br>Takes EnableGooglePayParams object</p> |
| updateAmount    | Conditional       | Updates amount on Google Sheet.                                                         |

You can provide either All, One or None of the parameters for enableGooglePay call.

* `amountField` specified - in this case Google Pay total amount will be automatically updated whenever amount has changed
* `amountField` *is not* specified - in this case it’s up to you to provide the correct amount for Google Pay. One of the ways to do it is to call `window.ckGooglePay.updateAmount` manually.
* `iframeField` specified - this value will be used to communicate with Google Pay button.\
  This option is especially helpful for Angular clients using shadow DOM.
* `iframeField` *is not* specified - it’s value will be calculated based on `data-ifields-id` attribute. In this case it must be set to “igp“: `data-ifields-id="igp"`.

#### EnableGooglePayParams Object

| **Name**    | **Type**       | **Required** | **Description**                                                                                                                  |
| ----------- | -------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| amountField | String\|Object | No           | <p>Field containing amount.<br>Could be either name of the field (String) or<br>field itself (Object)</p>                        |
| iframeField | String\|Object | No           | <p>Field containing iframe with Google Pay button.<br>Could be either name of the field (String) or<br>field itself (Object)</p> |

**Enable Google Pay example**

```
ckGooglePay.enableGooglePay({amountField: 'amount'});
```


# Google Pay Request Objects

#### *For complete sample code please refer* [*here*](/mobile-wallets/google-pay-hosted-checkout/sample-code) <a href="#for-complete-sample-code-please-refer-here" id="for-complete-sample-code-please-refer-here"></a>

## **Available dictionary objects** <a href="#available-dictionary-objects" id="available-dictionary-objects"></a>

### iStatus <a href="#istatus" id="istatus"></a>

```
const iStatus = {
    success: 100,
    unsupported: -100,
    error: -200
}
```

**Use:** `iStatus.success`

### GPEnvironment <a href="#gpenvironment" id="gpenvironment"></a>

```
const GPEnvironment = {
    test: "TEST",
    production: "PRODUCTION"
}
```

**Use:** `GPEnvironment.test`

### GPButtonColor <a href="#gpbuttoncolor" id="gpbuttoncolor"></a>

```
const GPButtonColor = {
    default: "default",
    black: "black",
    white: "white"
}
```

**Use:** `GPButtonColor.white`

### GPButtonType <a href="#gpbuttontype" id="gpbuttontype"></a>

```
const GPButtonType = {
    buy: "buy",
    donate: "donate",
    plain: "plain"
}
```

**Use:** `GPButtonType.buy`

### GPButtonSizeMode <a href="#gpbuttonsizemode" id="gpbuttonsizemode"></a>

```
const GPButtonSizeMode = {
    static: "static",
    fill: "fill"
}
```

**Use:** `GPButtonSizeMode.fill`

### GPBillingAddressFormat <a href="#gpbillingaddressformat" id="gpbillingaddressformat"></a>

```
const GPBillingAddressFormat = {
    min: "MIN",
    full: "FULL"
}
```

**Use:** `GPBillingAddressFormat.min`

## **Request objects** <a href="#request-objects" id="request-objects"></a>

### GooglePayRequest <a href="#googlepayrequest" id="googlepayrequest"></a>

The Main object that contains all the information necessary to communicate with Google Pay API.

| **Name**                 | **Type**                                                                                                   | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `merchantInfo`           | [*MerchantInfo*](/mobile-wallets/google-pay-hosted-checkout/request-objects#merchantinfo-object)           | No           | Describes the Merchant name and website. For more information please click the link                                                                                                                                                                                                                                                                                                            |
| `onGPButtonLoaded`       | String                                                                                                     | No           | <p>Name of a callback function to be called when Google Pay button is loaded.<br>Accepts an object of type <a href="/pages/-MifnqGDG_DaUyeMgmQK#GPButtonLoadedResult-Object">GPButtonLoadedResult</a>.</p>                                                                                                                                                                                     |
| `onGetTransactionInfo`   | String                                                                                                     | Yes          | <p>Name of a callback function to be called that returns the final price and tax calculations.<br>Please click <a href="/pages/-Miv6jnGN55hA0RbZU8Y">here</a> for the sample code</p>                                                                                                                                                                                                          |
| `onBeforeProcessPayment` | String                                                                                                     | No           | <p>Name of a callback function to be called when consumer clicked the button but before Google Pay sheet is loaded . Usually used to make validations before the payment.<br>Please click <a href="/pages/-Miv6jnGN55hA0RbZU8Y">here</a> for the sample code</p>                                                                                                                               |
| `onProcessPayment`       | String                                                                                                     | Yes          | <p>Name of a callback function to be called when Google Payment is authorized for the completion of the transaction.<br>This function accepts a parameter of <a href="https://docs.cardknox.com/mobile-wallets/google-pay-hosted-checkout/response-objects#paymentresponse-object">PaymentResponse</a>.<br>Please click <a href="/pages/-Miv6jnGN55hA0RbZU8Y">here</a> for the sample code</p> |
| `onPaymentCanceled`      | String                                                                                                     | No           | <p>Name of a callback function to be called when Google Pay sheet is closed/canceled without completing the transaction.<br>Please click <a href="/pages/-Miv6jnGN55hA0RbZU8Y">here</a> for the sample code</p>                                                                                                                                                                                |
| `environment`            | String                                                                                                     | No           | <p>Google Pay Environment. Could be either “TEST“ or “PRODUCTION“.<br>If omitted, defaults to “TEST“</p>                                                                                                                                                                                                                                                                                       |
| `billingParameters`      | [BillingParameters](/mobile-wallets/google-pay-hosted-checkout/request-objects#billingparameters-object)   | No           | <p>Sets Billing parameters, including transactionId.<br>For more information please click the link</p>                                                                                                                                                                                                                                                                                         |
| `shippingParameters`     | [ShippingParameters](/mobile-wallets/google-pay-hosted-checkout/request-objects#shippingparameters-object) | No           | Sets various Shipping Options. For more information please click the link                                                                                                                                                                                                                                                                                                                      |
| `buttonOptions`          | [ButtonOptions](/mobile-wallets/google-pay-hosted-checkout/request-objects#buttonoptions-object)           | No           | <p>Provides Google Pay button customization options.<br>For more information please click the link</p>                                                                                                                                                                                                                                                                                         |

&#x20;**Payment Request example**

```
initGP: function() {
    return {
        merchantInfo: this.merchantInfo,
        buttonOptions: this.buttonOptions,
        environment: this.getGPEnvironment(),
        billingParameters: this.billingParams,
        shippingParameters: {
            emailRequired: this.shippingParams.emailRequired,
            onGetShippingCosts: "gpRequest.shippingParams.onGetShippingCosts",
            onGetShippingOptions: "gpRequest.shippingParams.onGetShippingOptions"
        },
        onGetTransactionInfo: "gpRequest.onGetTransactionInfo",
        onBeforeProcessPayment: "gpRequest.onBeforeProcessPayment",
        onProcessPayment: "gpRequest.onProcessPayment",
        onPaymentCanceled: "gpRequest.onPaymentCanceled",
        onGPButtonLoaded: "gpRequest.gpButtonLoaded"
    };
}
```

**onGPButtonLoaded example**

```
gpButtonLoaded: function(resp) {
    if (!resp) return;
    if (resp.status === iStatus.success) {
        showHide("divGpay", true);
        showHide("lbGPPayload", true);
    } else if (resp.reason) {
        alert(resp.reason);
    }
}
```

**onGetTransactionInfo example**

```
onGetTransactionInfo: function () {
    let amt = this.getAmount();
    return {
        displayItems: [
            {
                label: "Subtotal",
                type: "SUBTOTAL",
                price: amt.toString(),
            },
            {
                label: "Tax",
                type: "TAX",
                price: (0.1 * amt).toString(),
            }
        ],
        countryCode: 'US',
        currencyCode: "USD",
        totalPriceStatus: "FINAL",
        totalPrice: (1.1 * amt).toString(),
        totalPriceLabel: "Total"
    }
}
```

**onBeforeProcessPayment callback example**

```
onBeforeProcessPayment: function () {
    return new Promise(function (resolve, reject) {
        try {
            //Do some validation here
            resolve(iStatus.success);
        } catch (err) {
            reject(err);
        }
    });
}
```

**onProcessPayment callback example**

```
onProcessPayment: function (paymentRequest) {
    let self = this;
    return new Promise(function (resolve, reject) {
        setTimeout(function () {
            try {
                console.log("paymentRequest", JSON.stringify(paymentRequest));
                paymentToken = paymentRequest.paymentData.paymentMethodData.tokenizationData.token;
                console.log("paymentToken", paymentToken);
                const amt = (chained([paymentRequest, "transactionInfo", "totalPrice"]) && paymentRequest.transactionInfo.totalPrice) || 0;
                try {
                    if (amt <= 0) 
                        throw "Payment is not authorized. Invalid amount. Amount must be greater than 0";
                    authorizeGPay({ token: paymentToken, amount: amt})
                    .then((resp) => {
                        gpRequest.handleResponse(resp);
                        resolve(resp);
                    })
                    .catch((rej) => {
                        console.error("Payment is not authorized", JSON.stringify(rej));
                        setTimeout(function () { alert("Payment is not authorized. Please check the logs") }, 500);
                        reject(rej);
                    });
                } catch (err) {
                    const emsg = JSON.stringify(err);
                    console.error(emsg);
                    setTimeout(function () { alert(emsg) }, 500);
                    reject({error: err});
                }
            } catch (e) {
                reject(e);
            }
        }, 100); //3000);
    });
}
```

**onPaymentCanceled callback example**

```
onPaymentCanceled: function(respCanceled) {
    setTimeout(function () { alert("Payment was canceled") }, 500);
}
```

### MerchantInfo Object <a href="#merchantinfo-object" id="merchantinfo-object"></a>

| **Name**       | **Type** | **Required** | **Description**                                                                                                                                                                                                                                                           |
| -------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `merchantName` | String   | Yes          | <p><em>From Google documentation</em>:<br>Merchant name encoded as UTF-8. Merchant name is rendered in the payment sheet. In <code>TEST</code> environment, or if a merchant isn't recognized, a “Pay Unverified Merchant” message is displayed in the payment sheet.</p> |

**Merchant Info example**

```
merchantInfo: {
    merchantName: "Example Merchant"
}
```

### GPButtonLoadedResult Object <a href="#gpbuttonloadedresult-object" id="gpbuttonloadedresult-object"></a>

| **Name** | **Type**                                                                      | **Description**                                                                                                                                                                                                                                                                                             |
| -------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status` | [iStatus](/mobile-wallets/google-pay-hosted-checkout/request-objects#iStatus) | <p>There are 3 possible cases:</p><ul><li>Google Pay Button loaded successfully: <code>status = iStatus.success</code></li><li>Google Pay not supported: <code>status = iStatus.unsupported</code></li><li>An error occurred while loading Google Pay Button: <code>status = iStatus.error</code></li></ul> |
| `reason` | String                                                                        | If Google Pay Button failed to load this field will be populated with the reason.                                                                                                                                                                                                                           |

### BillingParameters Object <a href="#billingparameters-object" id="billingparameters-object"></a>

| **Name**                   | **Type**                                                                                                    | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `transactionId`            | String                                                                                                      | No           | <p><em>From Google documentation</em>:<br>A unique ID that identifies a transaction attempt.<br>If not provided will be automatically generated by iFields API. Will be sent back on paymentRequest..transactionInfo response object.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `allowedAuthMethods`       | String\[]                                                                                                   | No           | <p>If not provided will be defaulted to <code>\["PAN\_ONLY", "CRYPTOGRAM\_3DS"]</code><br><em>From Google documentation</em>:<br>Fields supported to authenticate a card transaction.</p><ul><li><code>PAN\_ONLY</code>: This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year.</li><li><code>CRYPTOGRAM\_3DS</code>: This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.</li></ul> |
| `allowedCardNetworks`      | String\[]                                                                                                   | No           | <p>If not provided will be defaulted to <code>\["AMEX", "DISCOVER", "MASTERCARD", "VISA"]</code><br><em>From Google documentation</em>:<br>One or more card networks that you support, also supported by the Google Pay API.</p><ul><li><code>AMEX</code></li><li><code>DISCOVER</code></li><li><code>INTERAC</code></li><li><code>JCB</code></li><li><code>MASTERCARD</code></li><li><code>VISA</code></li></ul>                                                                                                                                                                                                                                                              |
| `assuranceDetailsRequired` | Boolean                                                                                                     | No           | <p><em>From Google documentation</em>:<br>Set to <code>true</code> to request <code>assuranceDetails</code>. This object provides information about the validation performed on the returned payment data.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `billingAddressRequired`   | Boolean                                                                                                     | No           | <p><em>From Google documentation</em>:<br>Set to <code>true</code> if you require a billing address. A billing address should only be requested if it's required to process the transaction.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `billingAddressFormat`     | [GPBillingAddressFormat](/mobile-wallets/google-pay-hosted-checkout/request-objects#GPBillingAddressFormat) | No           | <p><em>Has an effect when billingAddressRequired is set to true</em><br><em>From Google documentation</em>:<br>Billing address format required to complete the transaction.</p><ul><li><code>MIN</code>: Name, country code, and postal code (default).</li><li><code>FULL</code>: Name, street address, locality, region, country code, and postal code.</li></ul>                                                                                                                                                                                                                                                                                                            |
| `phoneNumberRequired`      | Boolean                                                                                                     | No           | <p><em>Has an effect when billingAddressRequired is set to true</em><br><em>From Google documentation</em>:<br>Set to <code>true</code> if a phone number is required to process the transaction.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

**Billing Parameters example**

```
billingParameters: {
    transactionId: "b65c7435-b57a-407e-a6e0-b166518d5d97",
    allowedAuthMethods: ["PAN_ONLY"],
    allowedCardNetworks: ["VISA", "MASTERCARD"],
    emailRequired: true
    billingAddressRequired: true,
    billingAddressFormat: GPBillingAddressFormat.min,
    phoneNumberRequired: true
}
```

### ShippingParameters Object <a href="#shippingparameters-object" id="shippingparameters-object"></a>

| **Name**                  | **Type**  | **Required** | **Description**                                                                                                                                                                                             |
| ------------------------- | --------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onGetShippingOptions`    | String    | No           | <p>When shipping is required you need to provide the name of <code>your</code> function that returns a list of shipping options.<br>For an example - please see below</p>                                   |
| `onGetShippingCosts`      | String    | No           | <p>When shipping is required you need to provide the name of <code>your</code> function that returns a list of shipping costs.<br>For an example - please see below</p>                                     |
| `shippingAddressRequired` | Boolean   | No           | <p><em>From Google documentation</em>:<br>Set to <code>true</code> to request a full shipping address..</p>                                                                                                 |
| `emailRequired`           | Boolean   | No           | <p><em>From Google documentation</em>:<br>Set to <code>true</code> to request an email address.</p>                                                                                                         |
| `phoneNumberRequired`     | Boolean   | No           | <p><em>From Google documentation</em>:<br>Set to <code>true</code> if a phone number is required for the provided shipping address.</p>                                                                     |
| `allowedCountryCodes`     | String\[] | No           | <p><em>From Google documentation</em>:<br>ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. If this object isn't specified, will be defaulted to <code>US</code> only.</p> |

**Shipping Parameters example**

```
shippingParams: {
    allowedCountryCodes: ['US'],
    onGetShippingCosts: function (shippingData) {
        logDebug({
            label: "onGetShippingCosts",
            data: shippingData
        });
        return {
            "shipping-001": "0.00",
            "shipping-002": "1.99",
            "shipping-003": "10.00"
        }
    },
    onGetShippingOptions: function (shippingData) {
        logDebug({
            label: "onGetShippingOptions",
            data: shippingData
        });
        let selectedOptionid = "shipping-001";
        if (shippingData && shippingData.shippingOptionData && shippingData.shippingOptionData.id !== "shipping_option_unselected") {
            selectedOptionid = shippingData.shippingOptionData.id;
        }
        return {
            defaultSelectedOptionId: selectedOptionid,
            shippingOptions: [
                {
                    "id": "shipping-001",
                    "label": "Free: Standard shipping",
                    "description": "Free Shipping delivered in 5 business days."
                },
                {
                    "id": "shipping-002",
                    "label": "$1.99: Standard shipping",
                    "description": "Standard shipping delivered in 3 business days."
                },
                {
                    "id": "shipping-003",
                    "label": "$10: Express shipping",
                    "description": "Express shipping delivered in 1 business day."
                },
            ]
        };
    }
}
```

### ShippingData Object

| **Name**             | **Type**                                         | **Description**                                                                                   |
| -------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| `shippingAddress`    | [ShippingAddress](#shippingaddress-object)       | An Address containing `countryCode`, `postalCode`, `locality`(city), `administrativeArea`(state). |
| `shippingOptionData` | [ShippingOptionData](#shippingoptiondata-object) | An object containing a selected option                                                            |

**ShippingData object example**

```
{
  "shippingAddress": {
    "countryCode": "US",
    "postalCode": "10601",
    "locality": "White Plains",
    "administrativeArea": "NY"
  },
  "shippingOptionData": {
    "id": "shipping-001"
  }
}
```

### ShippingAddress Object

| **Name**             | **Type** | **Description**                                                                                   |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------- |
| `postalCode`         | String   | <p><em>From Google documentation</em>:<br>The postal or ZIP code.</p>                             |
| `countryCode`        | String   | <p><em>From Google documentation</em>:<br>ISO 3166-1 alpha-2 country code.</p>                    |
| `locality`           | String   | <p><em>From Google documentation</em>:<br>City, town, neighborhood, or suburb.</p>                |
| `administrativeArea` | String   | <p><em>From Google documentation</em>:<br>A country subdivision, such as a state or province.</p> |

### ShippingOptionData Object

| **Name** | **Type** | **Description**                |
| -------- | -------- | ------------------------------ |
| `id`     | String   | id of selected shipping option |

### ButtonOptions Object <a href="#buttonoptions-object" id="buttonoptions-object"></a>

| **Name**         | **Type**                                                                                        | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                                        |
| ---------------- | ----------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `buttonColor`    | [GPButtonColor](/mobile-wallets/google-pay-hosted-checkout/request-objects#GPButtonColor)       | No           | <p><em>From Google documentation</em>:</p><ul><li><code>default</code>: A Google-selected default value. Currently <code>black</code> but it may change over time (default).</li><li><code>black</code>: A black button suitable for use on white or light backgrounds.</li><li><code>white</code>: A white button suitable for use on colorful backgrounds.</li></ul> |
| `buttonType`     | [GPButtonType](/mobile-wallets/google-pay-hosted-checkout/request-objects#GPButtonType)         | No           | <p><em>From Google documentation</em>:</p><ul><li><code>buy</code>: "Buy with Google Pay" button (default).</li><li><code>donate</code>: "Donate with Google Pay" button.</li><li><code>plain</code>: Google Pay button without additional text.</li></ul>                                                                                                             |
| `buttonSizeMode` | [GPButtonSizeMode](/mobile-wallets/google-pay-hosted-checkout/request-objects#GPButtonSizeMode) | No           | <p><em>From Google documentation</em>:</p><ul><li><code>static</code>: Button has a static width and height (default).</li><li><code>fill</code>: Button size changes to fill the size of its container.</li></ul>                                                                                                                                                     |

**Button Options example**

```
buttonOptions: {
    buttonColor: GPButtonColor.white,
    buttonType: GPButtonType.buy,
    buttonSizeMode: GPButtonSizeMode.full
}
```


# Google Pay Response Objects

#### *For complete sample code please refer* [*here*](/mobile-wallets/google-pay-hosted-checkout/sample-code) <a href="#for-complete-sample-code-please-refer-here" id="for-complete-sample-code-please-refer-here"></a>

## Available Response Objects

### PaymentResponse Object

This Object contains Google Pay response.

| **Name**          | **Type**                                   | **Always exists** | **Description**                                                                    |
| ----------------- | ------------------------------------------ | ----------------- | ---------------------------------------------------------------------------------- |
| `transactionInfo` | [TransactionInfo](#transactioninfo-object) | Yes               | Contains all transaction data. For more details please click on the link           |
| `paymentData`     | [PaymentData](#paymentdata-object)         | Yes               | This is a response object that's returned by Google after a payer approves payment |

### TransactionInfo Object

| **Name**           | **Type**    | **Always exists** | **Description**                                                                                                                                                                                  |
| ------------------ | ----------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `displayItems`     | DisplayItem | Yes               | Array of line items describing the charge. For more details please click on the link                                                                                                             |
| `countryCode`      | String      | Yes               | ISO 3166-1 alpha-2 country code                                                                                                                                                                  |
| `currencyCode`     | String      | Yes               | ISO 4217 alphabetic currency code.                                                                                                                                                               |
| `totalPriceStatus` | String      | Yes               | Set to `FINAL`                                                                                                                                                                                   |
| `totalPrice`       | String      | Yes               | Total amount consumer should be charged. This is a sum of all DisplayItems                                                                                                                       |
| `transactionId`    | String      | Yes               | A unique ID that identifies a transaction attempt. Can be passed on the Request through [billingParameters](/mobile-wallets/google-pay-hosted-checkout/request-objects#BillingParameters-Object) |

### DisplayItem Object

| **Name** | **Type** | **Always exists** | **Description**                                                                                                                                                                                                   |
| -------- | -------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `label`  | String   | Yes               | <p><em>From Google documentation</em>:<br>The label to be displayed for the given option</p>                                                                                                                      |
| `type`   | String   | Yes               | <p><em>From Google documentation</em>:<br>Type of displayed line item:</p><ul><li><code>LINE\_ITEM</code></li><li><code>SUBTOTAL</code></li></ul>                                                                 |
| `price`  | String   | Yes               | <p><em>From Google documentation</em>:<br>The monetary value of the cart item with an optional decimal precision of two decimal places. Negative values are allowed.</p>                                          |
| `status` | String   | Yes               | <p><em>From Google documentation</em>:<br>The following variables define price variance:</p><ul><li><code>FINAL</code></li><li><code>PENDING</code></li></ul><p>Default to <code>FINAL</code> if not provided</p> |

#### **TransactionInfo example**

```
"transactionInfo": {
    "displayItems": [
        {
		"label": "Subtotal",
		"type": "SUBTOTAL",
		"price": "2"
        }, 
        {
		"label": "Tax",
		"type": "TAX",
		"price": "0.2"
        }, 
        {
		"type": "LINE_ITEM",
		"label": "Shipping cost",
		"price": "0.00",
		"status": "FINAL"
        }
    ],
    "countryCode": "US",
    "currencyCode": "USD",
    "totalPriceStatus": "FINAL",
    "totalPrice": "2.2",
    "totalPriceLabel": "Total",
    "transactionId": "1200640e-5ed3-45d3-870b-5491d5af8248"
}
```

### PaymentData Object

| **Name**             | **Type**                                           | **Always exists** | **Description**                                                                                  |
| -------------------- | -------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------ |
| `apiVersion`         | Number                                             | Yes               | <p><em>From Google documentation</em>:<br>Major API version</p>                                  |
| `apiVersionMinor`    | Number                                             | Yes               | <p><em>From Google documentation</em>:<br>Minor API version</p>                                  |
| `paymentMethodData`  | [PaymentMethodData](#paymentmethoddata-object)     | Yes               | <p><em>From Google documentation</em>:<br>Data about the selected payment method</p>             |
| `email`              | String                                             | No                | Email address, if `emailRequired` is set to `true` in the *request*                              |
| `shippingOptionData` | [SelectionOptionData](#selectionoptiondata-object) | No                | <p><em>From Google documentation</em>:<br>The selected shipping option in the payment sheet.</p> |
| `shippingAddress`    | [Address](#address-object)                         | No                | Shipping address, if `shippingAddressRequired` is set to `true` in the request                   |

### SelectionOptionData Object

| **Name** | **Type** | **Always exists** | **Description**                    |
| -------- | -------- | ----------------- | ---------------------------------- |
| `id`     | String   | Yes               | Id of the selected Shipping Option |

### PaymentMethodData Object

| **Name**           | **Type**                                                               | **Always exists** | **Description**                                                                                                               |
| ------------------ | ---------------------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `description`      | String                                                                 | Yes               | <p><em>From Google documentation</em>:<br>User-facing message to describe the payment method that funds this transaction.</p> |
| `info`             | [CardInfo](#cardinfo-object)                                           | Yes               | <p><em>From Google documentation</em>:<br>Data about the selected payment method</p>                                          |
| `tokenizationData` | [PaymentMethodTokenizationData](#paymentmethodtokenizationdata-object) | No                | <p><em>From Google documentation</em>:<br>Payment tokenization data for the selected payment method.</p>                      |
| `type`             | String                                                                 | Yes               | Will be always set to `CARD`                                                                                                  |

### CardInfo Object

| **Name**           | **Type**    | **Always exists** | **Description**                                                                                                                                                                                                                 |
| ------------------ | ----------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cardNetwork`      | String      | Yes               | <p><em>From Google documentation</em>:<br>The payment card network of the selected payment.</p>                                                                                                                                 |
| `cardDetails`      | String      | Yes               | <p><em>From Google documentation</em>:<br>The details about the card. This value is commonly the last four digits of the selected payment account number.</p>                                                                   |
| `assuranceDetails` | String      | Yes               | <p><em>From Google documentation</em>:<br>This object provides information about the validation performed on the returned payment data if <code>assuranceDetailsRequired</code> is set to <code>true</code> on the request.</p> |
| `billingAddress`   | **Address** | No                | <p><em>From Google documentation</em>:<br>The billing address associated with the provided payment method, if <code>billingAddressRequired</code> is set to <code>true</code> in the request</p>                                |

### PaymentMethodTokenizationData Object

| **Name** | **Type** | **Always exists** | **Description**                                                        |
| -------- | -------- | ----------------- | ---------------------------------------------------------------------- |
| `type`   | String   | Yes               | Will be always set to `PAYMENT_GATEWAY`                                |
| `token`  | String   | No                | A JSON object string that contains a chargeable token issued by Google |

#### PaymentData Example

```
{
  "apiVersion": 2,
  "apiVersionMinor": 0,
  "paymentMethodData": {
    "type": "CARD",
    "description": "Visa •••• 1234",
    "info": {
      "cardNetwork": "VISA",
      "cardDetails": "1234"
    },
    "tokenizationData": {
      "type": "PAYMENT_GATEWAY",
      "token": "examplePaymentMethodToken"
    }
  }
}
```

### Address Object

| **Name**             | **Address format** | **Description**                                                                                                                                  |
| -------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`               | MIN                | <p><em>From Google documentation</em>:<br>The full name of the addressee.</p>                                                                    |
| `postalCode`         | MIN                | <p><em>From Google documentation</em>:<br>The postal or ZIP code.</p>                                                                            |
| `countryCode`        | MIN                | <p><em>From Google documentation</em>:<br>ISO 3166-1 alpha-2 country code.</p>                                                                   |
| `phoneNumber`        | MIN                | <p><em>From Google documentation</em>:<br>A telephone number, if <code>phoneNumberRequired</code> is set to <code>true</code> in the request</p> |
| `address1`           | FULL               | <p><em>From Google documentation</em>:<br>The first line of the address.</p>                                                                     |
| `address2`           | FULL               | <p><em>From Google documentation</em>:<br>The second line of the address.</p>                                                                    |
| `address3`           | FULL               | <p><em>From Google documentation</em>:<br>The third line of the address.</p>                                                                     |
| `locality`           | FULL               | <p><em>From Google documentation</em>:<br>City, town, neighborhood, or suburb.</p>                                                               |
| `administrativeArea` | FULL               | <p><em>From Google documentation</em>:<br>A country subdivision, such as a state or province.</p>                                                |
| `sortingCode`        | FULL               | <p><em>From Google documentation</em>:<br>The sorting code.</p>                                                                                  |

#### Address Example

```json
{
  "name": "John Doe",
  "address1": "c/o Google LLC",
  "address2": "1600 Amphitheatre Pkwy",
  "address3": "Building 40",
  "locality": "Mountain View",
  "administrativeArea": "CA",
  "countryCode": "US",
  "postalCode": "94043",
  "sortingCode": ""
}
```

### Full Response Object

```json
{
  "transactionInfo": {
    "displayItems": [
      {
        "label": "Subtotal",
        "type": "SUBTOTAL",
        "price": "2"
      },
      {
        "label": "Tax",
        "type": "TAX",
        "price": "0.2"
      },
      {
        "type": "LINE_ITEM",
        "label": "Shipping cost",
        "price": "0.00",
        "status": "FINAL"
      }
    ],
    "countryCode": "US",
    "currencyCode": "USD",
    "totalPriceStatus": "FINAL",
    "totalPrice": "2.2",
    "totalPriceLabel": "Total",
    "transactionId": "aff9e1-3209-4b2c-8037-120d2c0d"
  },
  "paymentData": {
    "apiVersionMinor": 0,
    "apiVersion": 2,
    "paymentMethodData": {
      "description": "Mastercard •••• 1771",
      "tokenizationData": {
        "type": "PAYMENT_GATEWAY",
        "token": "{\"signature\":\"MEUCI+slJGaKBHZmphgIgJ8GKHlrPKnQcObF/lGfYjDmt1pu3kzPOYoBmdjdUFvw\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQca0NVUE0gp/9xbueVNmy1o+NTcInbX/9ZN0QbXr8mng\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1614913712991\\\"}\",\"signatures\":[\"MEUCIQDb6d5nYqcL57Q09DPDrDKWxMgIgKaiLAEfdwNwG7S6nMvX1gRvQ\\u003d\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"9gmVUfk1Jua03felBqSUY4yXwzDzlhSHE2jm4VHDgsQ3xnzjQrlTAiyM87dP+8Cx9cks6SbrrK6vyWR7WmrPFhOaNFlulCvn9fI213ofHjRz7ebP71IFRCpgjeqG+nMQJXY8zjkhwXkUJTtOJ4SpXV7ByLyIXb/UJU7pg3O1m3Tl1zpe8C+hLQpKvAIZSAwEl4EBRafbcE33JyuV7RNLMlAerlELsGPUm0c04mM11vF3vdBVfgiyvVw5pJD2Gk/DX7fHdrUpPnzRt5ZoFU0jWZq/8rsj57cEzR+MK2MJVZE014D7iB8+7qcFjJ5H6Tdc/DCsyO5XDVp3Lu5aWZrIqJ6b9BkNPGiCDrV1OKRngc4OYPIGj7OrP7nQgIeU97EYT2xLzqWnfZ/PNCtj89mvT9mKp8y7V6eCJmK8BJsH9MLH08olwGo9pcU7Av2OXo837qUkcCxrkDrYh+wSbqS4p1SyoqgW+2BR+2zRoXU/\\\",\\\"ephemeralPublicKey\\\":\\\"BAAqw+C7aP+Z6KL2HLiP5J7Y/gEWpLQedowh7+r/7taxfNbNuC4\\\\u003d\\\",\\\"tag\\\":\\\"jkqoAh5l16mzlpmqVzpFx/k64\\\\u003d\\\"}\"}"
      },
      "type": "CARD",
      "info": {
        "cardNetwork": "MASTERCARD",
        "cardDetails": "1771",
        "billingAddress": {
          "address3": "",
          "sortingCode": "",
          "address2": "",
          "countryCode": "US",
          "address1": "123 Main Street",
          "postalCode": "07103",
          "name": "John Smith",
          "locality": "Newark",
          "administrativeArea": "NJ"
        }
      }
    },
    "shippingOptionData": {
      "id": "shipping-001"
    },
    "shippingAddress": {
      "address3": "",
      "sortingCode": "",
      "address2": "",
      "countryCode": "US",
      "address1": "123 Main Street",
      "postalCode": "10601",
      "name": "Test Test",
      "locality": "White Plains",
      "administrativeArea": "NY"
    },
    "email": "jsmith1234@abc.com"
  }
}
```


# Google Pay Sample Code

1. **Let's define a helper object with all necessary components:**

   ```javascript
   window.gpRequest = {
       environment: GPEnvironment.test,
       merchantInfo: {
           merchantName: "Example Merchant"
       },
       buttonOptions: {
           buttonSizeMode: GPButtonSizeMode.fill
       },
       billingParams: {
           billingAddressRequired: true,
           billingAddressFormat: GPBillingAddressFormat.full                        
       },
       shippingParams: {
           emailRequired: true,
           onGetShippingCosts: function (shippingData) {
               logDebug({
                   label: "onGetShippingCosts",
                   data: shippingData
               });
               return {
                   "shipping-001": "0.00",
                   "shipping-002": "1.99",
                   "shipping-003": "10.00"
               }
           },
           onGetShippingOptions: function (shippingData) {
               logDebug({
                   label: "onGetShippingOptions",
                   data: shippingData
               });
               let selectedOptionid = "shipping-001";
               if (shippingData && shippingData.shippingOptionData && shippingData.shippingOptionData.id !== "shipping_option_unselected") {
                   selectedOptionid = shippingData.shippingOptionData.id;
               }
               return {
                   defaultSelectedOptionId: selectedOptionid,
                   shippingOptions: [
                       {
                           "id": "shipping-001",
                           "label": "Free: Standard shipping",
                           "description": "Free Shipping delivered in 5 business days."
                       },
                       {
                           "id": "shipping-002",
                           "label": "$1.99: Standard shipping",
                           "description": "Standard shipping delivered in 3 business days."
                       },
                       {
                           "id": "shipping-003",
                           "label": "$10: Express shipping",
                           "description": "Express shipping delivered in 1 business day."
                       },
                   ]
               };
           }
       },
       onGetTransactionInfo: function () {
           let amt = getAmount();
           return {
               displayItems: [
                   {
                       label: "Subtotal",
                       type: "SUBTOTAL",
                       price: amt.toString(),
                   },
                   {
                       label: "Tax",
                       type: "TAX",
                       price: (0.1 * amt).toString(),
                   }
               ],
               countryCode: 'US',
               currencyCode: "USD",
               totalPriceStatus: "FINAL",
               totalPrice: (1.1 * amt).toString(),
               totalPriceLabel: "Total"
           }
       },    
       onBeforeProcessPayment: function () {
           return new Promise(function (resolve, reject) {
               try {
                   //Do some validation here
                   resolve(iStatus.success);
               } catch (err) {
                   reject(err);
               }
           });
       },
       onProcessPayment: function (paymentResponse) {
           return new Promise(function (resolve, reject) {
                   try {
                       // show returned data in developer console for debugging
                       console.log("paymentResponse", JSON.stringify(paymentResponse));
                       paymentToken = paymentResponse.paymentData.paymentMethodData.tokenizationData.token;
                       console.log("paymentToken", paymentToken);
                       const amt = (paymentResponse && paymentResponse.transactionInfo && paymentResponse.transactionInfo.totalPrice) || 0;
                       try {
                       if (amt <= 0) {
                           throw "Payment is not authorized. Invalid amount. Amount must be greater than 0";
                       }
                       authorizeGPay(paymentResponse)
                           .then((resp) => {
                               gpRequest.handleResponse(resp);
                               setGPPayload(JSON.stringify(paymentResponse, null, 2));
                               resolve(resp);
                           })
                           .catch((rej) => {
                               console.error("Payment is not authorized", JSON.stringify(rej));
                               setGPPayload("");
                               setTimeout(function () { alert("Payment is not authorized. Please check the logs") }, 500);
                               reject(rej);
                           });
                       } catch (err) {
                           const emsg = JSON.stringify(err);
                           console.error(emsg);
                           setTimeout(function () { alert(emsg) }, 500);
                           reject({error: err});
                       }
               } catch (err) {
                   reject(err);
               }
           });
       },
       onPaymentCanceled: function(respCanceled) {
           setTimeout(function () { alert("Payment was canceled") }, 500);
       },
       handleResponse: function (resp) {
           const respObj = JSON.parse(resp);
           if (respObj) {
               if (respObj.xError) {
                   setTimeout(function () { alert(`There was a problem with your order (${respObj.xRefNum})!`) }, 500);
               } else
                   setTimeout(function () { alert(`Thank you for your order (${respObj.xRefNum})!`) }, 500);
           }
       },
   };
   ```
2. **Object with necessary properties to initialize Google Pay:**

   ```javascript
   function initGP() {
       return {
           merchantInfo: gpRequest.merchantInfo,
           buttonOptions: gpRequest.buttonOptions,
           onGetTransactionInfo: "gpRequest.onGetTransactionInfo",
           environment: gpRequest.environment,
           billingParameters: gpRequest.billingParams,
           shippingParameters: {
               emailRequired: gpRequest.shippingParams.emailRequired,
               onGetShippingCosts: "gpRequest.shippingParams.onGetShippingCosts",
               onGetShippingOptions: "gpRequest.shippingParams.onGetShippingOptions"
           },
           onBeforeProcessPayment: "gpRequest.onBeforeProcessPayment",
           onProcessPayment: "gpRequest.onProcessPayment",
           onPaymentCanceled: "gpRequest.onPaymentCanceled",
           onGPButtonLoaded: "gpButtonLoaded"
       };
   }
   ```

   For more information please refer to [Request](/mobile-wallets/google-pay-hosted-checkout/request-objects) object<br>
3. **Google Pay iField:**

   ```html
   <style> 
       ......
       iframe {
           border: 0 solid black;
           width: 600px;
           height: 28px;
           padding: 0px;
           margin-bottom: 5px;
       }
       iframe.gp {
           display: block;
           border: 0;
           width: 250px;
           height: 45px;
           padding: 0px;
           margin: 0px;
       }
       .hidden {
           display: none;
       }
       .....
   </style>   
   <body>
     <form id="payment-form" method="POST">
       .....
       <input id="amountId" name="xAmount" placeholder="Amount"></input>
       .....
       <iframe id="igp" class="gp hidden" data-ifields-id="igp" data-ifields-oninit="initGP" src="igp.htm"
               allowpaymentrequest
               sandbox="allow-popups allow-modals allow-scripts allow-same-origin"
               title="GPay checkout page">
       </iframe>
       .....
   </form>
   </body>    
   ```
4. **Let’s enable Google Pay for the website:**

   ```javascript
   document.addEventListener("DOMContentLoaded", function(event) { 
       .....
       ckGooglePay.enableGooglePay({amountField: 'amount'}); 
       .....
   }
   ```

   For more information please refer to [Google Pay Control Object](/mobile-wallets/google-pay-hosted-checkout/google-pay-control-object)<br>
5. To see the full solution please click [**here**](/mobile-wallets/google-pay-hosted-checkout/ifields-integration)**.**


# iFields Integration

The code below is a source of ifield-sample.htm

```html
<!DOCTYPE html>
<html>
    <head>
		<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
		<meta content="utf-8" http-equiv="encoding">

        <!-- Use the following src for the script on your form and replace ****version**** with the desired version: src="https://cdn.cardknox.com/ifields/****version****/ifields.min.js" -->     
        <script src="https://cdn.cardknox.com/ifields/2.9.2109.2701/ifields.min.js"></script> 
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", function(event) {               
                if (/[?&](is)?debug/i.test(window.location.search)){
                    setDebugEnv(true);
                }
         
                /*
                 * [Contitional]
                 * Required if you want to enable Google Pay payment method on your website
                 * For more information please refer to documentation 
                 */
                ckGooglePay.enableGooglePay({amountField: 'amount'});
            });

            //Google Pay
            window.gpRequest = {
                merchantInfo: {
                    merchantName: "Example Merchant"
                },
                buttonOptions: {
                    buttonSizeMode: GPButtonSizeMode.fill
                },
                billingParams: {
                    //phoneNumberRequired: true,
                    emailRequired: true,
                    billingAddressRequired: true,
                    billingAddressFormat: GPBillingAddressFormat.full                        
                },
                shippingParams: {
                    phoneNumberRequired: true,
                    emailRequired: true,
                    onGetShippingCosts: function (shippingData) {
                        logDebug({
                            label: "onGetShippingCosts",
                            data: shippingData
                        });
                        return {
                            "shipping-001": "0.00",
                            "shipping-002": "1.99",
                            "shipping-003": "10.00"
                        }
                    },
                    onGetShippingOptions: function (shippingData) {
                        logDebug({
                            label: "onGetShippingOptions",
                            data: shippingData
                        });
                        let selectedOptionid = "shipping-001";
                        if (shippingData && shippingData.shippingOptionData && shippingData.shippingOptionData.id !== "shipping_option_unselected") {
                            selectedOptionid = shippingData.shippingOptionData.id;
                        }
                        return {
                            defaultSelectedOptionId: selectedOptionid,
                            shippingOptions: [
                                {
                                    "id": "shipping-001",
                                    "label": "Free: Standard shipping",
                                    "description": "Free Shipping delivered in 5 business days."
                                },
                                {
                                    "id": "shipping-002",
                                    "label": "$1.99: Standard shipping",
                                    "description": "Standard shipping delivered in 3 business days."
                                },
                                {
                                    "id": "shipping-003",
                                    "label": "$10: Express shipping",
                                    "description": "Express shipping delivered in 1 business day."
                                },
                            ]
                        };
                    }
                },
                onGetTransactionInfo: function () {
                    let amt = getAmount();
                    return {
                        displayItems: [
                            {
                                label: "Subtotal",
                                type: "SUBTOTAL",
                                price: amt.toString(),
                            },
                            {
                                label: "Tax",
                                type: "TAX",
                                price: (0.1 * amt).toString(),
                            }
                        ],
                        countryCode: 'US',
                        currencyCode: "USD",
                        totalPriceStatus: "FINAL",
                        totalPrice: (1.1 * amt).toString(),
                        totalPriceLabel: "Total"
                    }
                },    
                onBeforeProcessPayment: function () {
                    return new Promise(function (resolve, reject) {
                        try {
                            //Do some validation here
                            resolve(iStatus.success);
                        } catch (err) {
                            reject(err);
                        }
                    });
                },
                onProcessPayment: function (paymentResponse) {
                    return new Promise(function (resolve, reject) {
                            try {
                                // show returned data in developer console for debugging
                                console.log("paymentResponse", JSON.stringify(paymentResponse));
                                paymentToken = paymentResponse.paymentData.paymentMethodData.tokenizationData.token;
                                console.log("paymentToken", paymentToken);
                                const amt = (paymentResponse && paymentResponse.transactionInfo && paymentResponse.transactionInfo.totalPrice) || 0;
                                try {
                                if (amt <= 0) {
                                    throw "Payment is not authorized. Invalid amount. Amount must be greater than 0";
                                }
								setGPPayload(JSON.stringify(paymentResponse, null, 2));
								resolve({status: iStatus.success});
                                } catch (err) {
                                    const emsg = JSON.stringify(err);
                                    console.error(emsg);
                                    setGPPayload("");
                                    setTimeout(function () { alert(emsg) }, 500);
                                    reject({error: err});
                                }
                        } catch (err) {
                            setGPPayload("");
                            reject(err);
                        }
                    });
                },
                onPaymentCanceled: function(respCanceled) {
                    setTimeout(function () { alert("Payment was canceled") }, 500);
                },
                handleResponse: function (resp) {
                    const respObj = JSON.parse(resp);
                    if (respObj) {
                        if (respObj.xError) {
                            setTimeout(function () { alert(`There was a problem with your order (${respObj.xRefNum})!`) }, 500);
                        } else
                            setTimeout(function () { alert(`Thank you for your order (${respObj.xRefNum})!`) }, 500);
                    }
                },
                getGPEnvironment: function () {
                    if (/[?&]prod/.test(window.location.search)) {
                        return GPEnvironment.production;
                    }
                    return GPEnvironment.test;
                },
                initGP: function() {
                    return {
                        merchantInfo: this.merchantInfo,
                        buttonOptions: this.buttonOptions,
                        environment: this.getGPEnvironment(),
                        billingParameters: this.billingParams,
                        shippingParameters: {
                            emailRequired: this.shippingParams.emailRequired,
                            onGetShippingCosts: "gpRequest.shippingParams.onGetShippingCosts",
                            onGetShippingOptions: "gpRequest.shippingParams.onGetShippingOptions"
                        },
                        onGetTransactionInfo: "gpRequest.onGetTransactionInfo",
                        onBeforeProcessPayment: "gpRequest.onBeforeProcessPayment",
                        onProcessPayment: "gpRequest.onProcessPayment",
                        onPaymentCanceled: "gpRequest.onPaymentCanceled",
                        onGPButtonLoaded: "gpRequest.gpButtonLoaded",
                        isDebug: isDebugEnv
                    };
                },
                gpButtonLoaded: function(resp) {
                    if (!resp) return;
                    if (resp.status === iStatus.success) {
                        showHide("divGpay", true);
                        showHide("lbGPPayload", true);
                    } else if (resp.reason) {
                        alert(resp.reason);
                    }
                }
            };
            function setGPPayload(value) {
                const gpTxt = document.getElementById('gp-payload');
                gpTxt.value = value;
                showHide(gpTxt, value);
            }

            function showHide(elem, toShow) {
                if (typeof(elem) === "string") {
                    elem = document.getElementById(elem);
                }
                if (elem) {
                    toShow ? elem.classList.remove("hidden") : elem.classList.add("hidden");
                }
            }
            function getAmount () {
                return roundToNumber(document.getElementById("amount").value || "0", 2);
            }
        </script>
        <style> 
            body {
                margin: 10px;
            }

            iframe.gp {
                display: inline-block;
                border: 0;
                width: 250px;
                height: 45px;
                padding: 0px;
                margin-bottom: 12px;
                overflow: hidden;
                position: absolute;
            }
            div.gp {
                overflow: hidden;
                display: inline-block;
                overflow: hidden;
                margin-bottom: 20px;
            }
            input {
                border: 1px solid black;
                font-size: 14px;
                padding: 3px;
                width: 243px;
                margin-bottom: 12px;
            }

            .hidden {
                display: none;
            }

            textarea {
                border: 1px solid black;
                width: 350px;
            }
        </style>
    </head>
    <body>
        <form id="payment-form" method="POST">
            <input id="amount" name="xAmount" placeholder="Amount" type="number" inputmode="decimal"></input>
            <br/>
            <div id="divGpay" class="gp hidden">
                <iframe id="igp" class="gp" data-ifields-id="igp" data-ifields-oninit="gpRequest.initGP" src="https://cdn.cardknox.com/ifields/2.9.2109.2701/igp.htm"
                        allowpaymentrequest
                        sandbox="allow-popups allow-modals allow-scripts allow-same-origin allow-forms allow-popups-to-escape-sandbox allow-top-navigation"
                        title="GPay checkout page">
                </iframe>
                <br/>
            </div>
            <br />
            <br />
            <label id="lbGPPayload" class="hidden">Google Pay Payload: </label>
            <br />
            <textarea id="gp-payload" class="hidden" rows="10" readonly="true"></textarea>
        </form>
    </body>
</html>
```


# Google Pay FAQ

#### **Q:** Can I run Test transactions with Google Pay?

**A:** Yes, just follow these steps:

1. Setup your Google Pay Wallet with your real card
2. Point Google Pay to Test Environment (in your init Google Pay function set `environment` to `GPEnvironment.test`)
3. Let Sola representative know that you want to use Google Pay Test environment for your Sandbox account.

Your real card won’t be charged, the transaction will run against test Visa card 4111…1111.

&#x20;

#### **Q:** What’s the maximum allowed amount for the Test transaction

**A:** The maximum amount for test transaction allowed by Sola is $10


# Netsuite

## Overview <a href="#overview" id="overview"></a>

The Sola bundle for NetSuite is an easy integration that allows users to accept payments via the Sola gateway directly within NetSuite. This plugin also supports the secure storage of customer payment methods for future transactions.

{% hint style="info" %}
**Note:** Only NetSuite administrators can install this bundle.
{% endhint %}

### Bundle Components <a href="#bundle-components" id="bundle-components"></a>

![](/files/-Me03xVef7qbIVGZtxqC)

## Install the Bundle <a href="#install-the-bundle" id="install-the-bundle"></a>

### Prerequisites: <a href="#prerequisites" id="prerequisites"></a>

* An existing Sola account (live or sandbox) with a token and transaction key.
* Provide Sola with your NetSuite ID by emailing it to <developersupport@solapayments.com>. We will enable the bundle for your NetSuite ID and enable the license for NetSuite on your Sola account.

### Installation:

1. Navigate to Customization > Suite Bundler > Search & Install Bundles.
2. Search and install the ‘xPayment’ bundle (you can also install ‘xPayment Beta’ for additional features).

### Setup <a href="#step-by-step-process" id="step-by-step-process"></a>

#### **Configure Account Settings:**

1. Navigate to Setup > Company > PE Merchant Account to create a new PE merchant account record.
   * **Name**: Name of the merchant account.
   * **PE Transaction Key:** API key.
   * **PE Token Key:** iFields key
   * **PE Void When Canceled:** Voids the Sola transaction if a NetSuite transaction is voided.
   * **PE Accept ACH:** Accept ACH payments with Sola.\
     Note: The merchant account needs to be set up for ACH as well.
   * **PE Allow Undeposited Funds:** This allows the system to accept a payment in the Undeposited Funds account. Note: Make sure to change all credit card types to ‘Group with Undeposited Funds’ (Setup > Accounting > Accounting Lists > Card Type > Edit > Account Tab > Group with Undeposited Funds).
   * **PE Void Transaction When Declined:** Automatically void the NetSuite transaction If a Sola transaction gets declined or fails.

     Note: Only use this setting if the 'PE Require Charge Button' setting is unchecked.
   * **PE Require Charge Button Transaction:** does not process if the 'PE PROCESS TRANSACTION' button was not selected. Note: This does not apply to sales orders or transactions in edit mode.
   * **PE Send Record Type ID:** Send the record type and ID of the record along with transaction to the gateway as the 'xCustom01' field.
   * **PE Description Field ID:** NetSuite Field ID to send along with the transaction to the gateway as the ‘xDescription’ field. If this field is empty, or the field is not found on the form that submits the transaction, the system does not send a description as part of the transaction.
2. Navigate to Setup > Accounting > Accounting preferences
   * **Void Transactions Using Reversing Journals:** Enable this setting.

#### Form Setup

Add the “PE” fields to the forms that accept payments (cash sale, cash refund, customer deposit, customer payment, customer refund, sales order). Make sure to hide the NetSuite fields that the plugin is replacing.

| Name                  | Description                                                                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| PE Stored Credit Card | The payment method saved with the customer.                                                                                                 |
| PE Credit Card Number | The credit card number.                                                                                                                     |
| PE CVV Code           | The security code of the credit card.                                                                                                       |
| PE Account Number     | The ACH account number (only needed if ACH is enabled).                                                                                     |
| PE Routing Number     | The ACH routing number (only needed if ACH is enabled).                                                                                     |
| PE Get Authorization  | Perform an Authorize Only transaction (only needed by sales order).                                                                         |
| PE Retry Transaction  | Try charging the card again.                                                                                                                |
| PE Merchant Account   | The name of the merchant account that should be used. It defaults to the first merchant account created.                                    |
| PE Charge Card        | The button that the merchant needs to select for the transaction to process. It should be renamed on the refund form to **PE Refund Card**. |

**Step 3: Upload Existing Customer Card**\
Use a regular .CSV upload and map the fields to PE Stored Credit Card.

**Step 4: Use a Card Reader**\
To use the card reader, select the **PE Credit Card Number** field, then swipe or insert the card to populate the field with the card data.

**Step 5: Test the Installation**\
From Sola, request a sandbox account with a token and transaction key. Follow the installation steps above to perform the setup.

What to Test:

* Approved transaction
* Declined transaction
* Ensure that all scripts are running by creating a transaction and adding a stored payment.
* Verify that the Sola log shows the transaction history.
* Make sure that other users in NetSuite have access to the bundle and that the scripts run.

NetSuite recommends that administrators installing a bundle test that bundle using a NetSuite sandbox account.

### Use the Bundle <a href="#use-the-bundle" id="use-the-bundle"></a>

**Roles and Permissions**

Make sure the roles using this plugin have permission for the following:

* Transaction Logs: Saved Search and Audience (Roles and Employees) need to be set for all users using this bundle (Transaction logs > Edit > Audience).
* Accounting lists need at least View rights (Role > Permissions > Setup > Accounting lists ).
* Customers need at least View rights (Role > Permissions > Lists > Customers).
* PE Merchant Account needs at least View rights (Role > Permissions > Custom Record).
* PE Payment Logs need at least Create rights (Role > Permissions > Custom Record).
* PE Stored Credit Card needs Edit rights (Role > Permissions > Custom Record).

**User Procedures**

Add a Stored Card to a Customer

1. In the customer record, select Financials > PE Stored Card.
2. Select the new **PE Stored Card** button.

You can also add a new card to a transaction screen that has the **PE Stored Card** field. Check the plus symbol (+) to add a new card.

### Miscellaneous <a href="#miscellaneous" id="miscellaneous"></a>

**How the Plugin Pulls Customer Billing and Shipping Values**

The plugin retrieves customer billing and shipping values from various locations in a specific order of preference. The order is as follows:

1. From the current record itself. If the Bill To or Ship To values are set, they are used. (Exception: a customer payment with a single applied invoice. See Note below.)
   * If the current record doesn’t have the Bill To or Ship To values set, then the plugin pulls the values from the parent record (if one exists).
   * If no parent record exists, or the parent record does not have the values set, the plugin pulls the values from the address list on the customer record:
     1. The default billing and shipping addresses are used if they are set.
     2. If the defaults are not set, the first address is used.

**Note:** For customer payments with a single applied invoice, the plugin pulls the values from the applied invoice first. If the values are not set on the applied invoice (or if multiple invoices are applied), the plugin pulls the values from the address list on the customer record.

### Update the Bundle <a href="#update-the-bundle" id="update-the-bundle"></a>

Use SuiteBundler to update when a new version is available. SuiteBundler capabilities may change over time; verify the current SuiteBundler features as described in the NetSuite Help Center topic, Updating Bundles in the Bundle Repository.

### Uninstall the Bundle <a href="#uninstall-the-bundle" id="uninstall-the-bundle"></a>

Use SuiteBundler to uninstall the bundle completely. Note that this completely removes all history of Sola payments.

Uninstalling this bundle should generally follow the steps provided in the NetSuite Help Center topic, Uninstalling Bundles into Your NetSuite Account. The SuiteBundler capabilities may change over time; review this help topic to verify the current behavior of uninstalling bundles.


# NetSuite Features and Demo

## Overview <a href="#overview" id="overview"></a>

Our plugin is a NetSuite bundle that lets you use the Sola gateway to accept integrated payments with NetSuite. It also allows you to securely store payment methods for future transactions.

Sola currently does not support the following NetSuite integrations:

* SCA (NS eComm shopping cart)
* SCIS (NS Retail)

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

1. Create an account with Sola (live or sandbox).
2. Obtain your token and transaction key.
3. Request a NetSuite license (create a sandbox account [here](https://solapayments.com/devsdk/)).
4. Provide Sola with your NetSuite ID (<developersupport@solapayments.com>). Sola will share the bundle with you.

## Installation <a href="#installation" id="installation"></a>

**Note:** Only NetSuite administrators can install this bundle.

Find and install the “xPayment” (and xPayment beta) bundle in the “Search & Install Bundles“ section.

The following video demonstrates these steps:

## FAQs <a href="#faqs" id="faqs"></a>

**Q: How do I add credit card information and save it?**

A: To store a customer’s credit card with their record:

1. Open the customer record and click the Transactions tab.
2. In the Payments section, click the plus sign ( + ) next to the **PE Store Payment** field.
3. On the PE Stored Payment pop-up, fill in the required fields.
4. Click the **Save** button on the pop-up to save and close the pop-up.
5. Select the **PE Get Authorization** checkbox.
6. Click the **Save** button at the bottom of the screen.

The following video demonstrates these steps:

**Q: How do I perform a sales order (PreAuth/AuthOnly/Capture)?**

A: To process a sales order:

1. Open the customer record and click the Transactions tab.
2. In the Items section, add as many items as necessary.
3. In the Payment section, type in the credit card information.
4. Select the **PE Get Authorization** checkbox.
5. Click the **Save** button. At the top of the screen, the system displays a message that confirms the transaction was saved. Below this is the message "Pending Approval."
6. Click the **Approve** button. The system displays the message "Pending Fulfillment."
7. Click the **Fulfill** button. The system displays the Item Fulfillment screen.
8. Under the text "To Be Generated," click the **Save** button. At the top of the screen, the system displays a message that confirms the transaction was saved.
9. Click the **Bill** button. The system displays the Cash Sale screen.
10. Under the text "To Be Generated," click the **Save** button.

The following video demonstrates these steps:

**Q: How do I process a cash sale?**

A: To process a cash transaction:

1. Open the customer record and click the Transactions tab.
2. In the Items section, add as many items as necessary.
3. In the Billing section, enter information in the following fields\
   \- **Payment Method**\
   \- **Expires**\
   \- **Name on Card**
4. Type the card number into the **PE Credit Card Number** field.
5. Click the **Save** button.

The following video demonstrates these steps:

**Q: How do I process a cash refund?**

A: Open the cash refund transaction that needs to be refunded. In the upper left of the screen, click the **Refund** button.

The following video demonstrates this step:

**Q: How do I process a customer deposit?**

A: To process a customer deposit:

1. Open the Customer Deposit screen.
2. In the **Customer** field, choose the customer.
3. Type in an amount in the **Payment Amount** field.
4. In the **PE Stored Payment** field, select the payment method.
5. Click the **Save** button. At the top of the screen, the system displays a message that confirms the transaction was saved.

The following video demonstrates these steps:

**Q: How do I process a customer payment?**

A: To process a customer payment for an invoice:

1. Open the invoice for which you will accept payment.
2. Click the Accept button. NetSuite opens the Payment screen.
3. Scroll down to the Payment Method section.
4. In the **PE Payment Method** field, select the payment method.
5. Click the **Save** button. At the top of the screen, the system displays a message that confirms the transaction was saved.

The following video demonstrates these steps:

{% file src="/files/-MbwDrfRNgOtAlkf61q0" %}
Customer Payment Video
{% endfile %}


# WooCommerce

## Overview

Our WooCommerce plugin is an easy integration that allows users to accept payments online through their WooCommerce online site.

## Installing the Plugin

Our official WooCommerce plugin can be found here: <https://wordpress.org/plugins/woo-cardknox-gateway/>

After installing and activating the plugin, navigate to the plugin settings and enter your API Key and iFields Key. There are several additional optional settings available. You can hover over each setting to view a brief description of its functionality.<br>

If you plan to enable **Apple Pay** or **Google Pay**, please ensure that your checkout page uses the shortcode `[woocommerce_checkout]` rather than the block-based checkout.<br>

Before activating the Sola plugin, please deactivate any other payment methods or processors to avoid conflicts.

{% hint style="info" %}
Please note that after installation, the plugin may still appear in your plugin list under our former name, Cardknox.
{% endhint %}

## Customer Usage <a href="#customer-usage" id="customer-usage"></a>

### New transaction: <a href="#new-transaction" id="new-transaction"></a>

1. Go to the checkout page.
2. Select Credit Card (or the title that was specified for Sola in the settings page).

### New card: <a href="#new-card" id="new-card"></a>

1. Select "use a new payment method."
2. Enter the card data.
3. Select "save to account" if you would like to save the card for future use.

### Card on file: <a href="#card-on-file" id="card-on-file"></a>

1. Select the card you would like to use.
2. Select "place order."

### Add payment method (card on file): <a href="#add-payment-method-card-on-file" id="add-payment-method-card-on-file"></a>

1. Select my account > payment methods.
2. Click "add payment method."
3. Enter card data.
4. Click "add payment method."

Add payment method image:

![](/files/-Me-pXZS0s-9xvkkaaFd)

### Delete payment method: <a href="#delete-payment-method" id="delete-payment-method"></a>

1. Select my account > payment methods.
2. Click "delete" on the right of the payment method.

Delete payment method:

![](/files/-Me01n3YlX5-m15n9ReF)

### New subscription: <a href="#new-subscription" id="new-subscription"></a>

1. Select subscription item.
2. Pay the same as with a regular transaction.

### Change subscription: <a href="#change-subscription" id="change-subscription"></a>

1. Go to my account > select subscriptions.
2. Click "view" on the subscription.
3. Apply modifications.

Edit subscription image:

![](/files/-Me01sJ4JSE6mCJZi5h6)

## Merchant <a href="#merchant" id="merchant"></a>

### Refund a transaction: <a href="#refund-a-transaction" id="refund-a-transaction"></a>

This will refund the transaction. You can specify the amount to refund.\
Refund images:

![](/files/-Me01x8_HYnFdJSZDdil)

### Change order status from on hold to processing: <a href="#change-order-status-from-on-hold-to-processing" id="change-order-status-from-on-hold-to-processing"></a>

If the plugin is set to not capture the transaction, this will capture the transaction.

### Change order status from on hold to completed: <a href="#change-order-status-from-on-hold-to-completed" id="change-order-status-from-on-hold-to-completed"></a>

If the plugin is set to not capture the transaction, this will capture the transaction.

### Change order status from on hold to canceled: <a href="#change-order-status-from-on-hold-to-canceled" id="change-order-status-from-on-hold-to-canceled"></a>

If the order is not yet captured, this will void the auth only transaction.

### Change order status from on hold to refunded: <a href="#change-order-status-from-on-hold-to-refunded" id="change-order-status-from-on-hold-to-refunded"></a>

If the order is not yet captured, this will void the auth only transaction.&#x20;

Change order status image:

![](/files/-Me02_zfHZxjq85HiL8o)

### Recurring / Subscriptions: <a href="#recurring-subscriptions" id="recurring-subscriptions"></a>

**Process Renewal:**\
Charge the subscription instead of waiting.

**Add / Update Token Manually:**\
Click on the pencil near "payment details."

Update the token masked card number and card type.


# Magento Plugin

The Magento Sola plugin will allow you to charge credit cards via the Sola gateway. Sola enables credit card payments for both customers on the storefront and for merchants in the Admin portal. The plugin supports Authorize Only, Capture, Void, Cancel, and Refund transactions. As a merchant, your web servers remain out of scope of the transaction, keeping card data secure and simplifying PCI compliance.

## Installation

#### **Install the plugin**

Install the plugin from <https://marketplace.magento.com/cardknox-cardknox.html> .

#### Install the Sola Plugin

To install the Sola plugin:

1. Unzip the folder to app/code/CardknoxDevelopment/Cardknox (create the directories if needed)
2. Run the below commands in the Magento root directory (bash).

{% hint style="info" %}
If you are using versions 2.0 – 2.1, contact cardknox for a compatible version. For 2.1.0 - 2.1.3, comment out lines 278 – 282 in Cardknox/etc/di.xml. On higher versions, no changes are needed.
{% endhint %}

**Enable the module**

```
php bin/magento module:enable CardknoxDevelopment_Cardknox --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```

**Optionally flush the cache**

```
php bin/magento cache:clean
php bin/magento cache:flush
```

## Setup

Navigate to Stores > Configuration > Payment Methods > Sola which will bring you to the configuration page (see below).

## Configuration Options

| **Item**                             | **Description**                                                                                                                                                                      |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enabled                              | This enables the Sola / Cardknox Module. Set to ‘Yes’ to enable Sola payments.                                                                                                       |
| Title                                | Name of payment method. This will appear to users when selecting a payment method. We recommend selecting ‘Credit Card.’                                                             |
| Vault Enabled                        | This enables the customer to save cards for later use on the site.                                                                                                                   |
| Vault Title                          | Name of vault payment method. This will appear to users when selecting a card on file. We recommend selecting ‘Stored Cards.’                                                        |
| Sola Transaction Key                 | Your Sola API transaction Key.                                                                                                                                                       |
| Sola Token Key                       | Your Sola token key (iFields key).                                                                                                                                                   |
| Debug                                | Logs transaction data for troubleshooting purposes.                                                                                                                                  |
| Payment Action                       | Sets the transaction payment mode. If ‘Authorize’ is selected, all transactions will need to be captured when invoicing an order.                                                    |
| Enable Split Capture For Credit Card | When Payment action is set to Authorize, this will allow you to [split capture](https://docs.cardknox.com/cardknox-products/split-capture) when capturing (invoicing) a transaction. |
| Payment from Applicable Countries    | Select ‘Specific Countries’ to only allow payment from the ‘Payment From Specific Countries’ whitelist.                                                                              |
| Payment from Specific Countries      | Select countries you wish to whitelist.                                                                                                                                              |
| Sola Gateway Endpoint                | Sola URL to which transactions are routed (this setting should not be modified unless advised to do so by Sola Support).                                                             |
| Google reCAPTCHA V2 Enable           | This enables Google reCAPTCHA V2                                                                                                                                                     |
| Google API Key V2                    | Your Google reCaptcha Site Key V2                                                                                                                                                    |
| Google API Secret Key V2             | Your Google reCaptcha Secret key V2                                                                                                                                                  |
| Sort Order                           | Priority of Sola in list of payment methods.                                                                                                                                         |

{% hint style="info" %}
If you do not have a key, you can obtain it by signing into your account in the Sola portal and navigating to Key Management.
{% endhint %}

## Sola Google Pay <a href="#cardknox-google-pay" id="cardknox-google-pay"></a>

| **Item** | **Description** |
| -------- | --------------- |

| **Item**                           | **Description**                                                                                                                                                                                                                            |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enabled                            | <p>This enables Sola Google Pay . Set to ‘Yes’ to enable Google Pay. Please ensure that your Sola account is configured for Google Pay.<br>Please contact <a href="mailto:gatewaysupport@solapayments.com">Sola support</a> to confirm</p> |
| Title                              | Name of payment method. This will appear to users when selecting a payment method. We recommend selecting ‘Google Pay’                                                                                                                     |
| Merchant Name                      | Enter the merchant name (DBA)                                                                                                                                                                                                              |
| Environment                        | Sets the Google Pay environment. This must match the environment set on the Sola account. Please contact [Sola support](mailto:gatewaysupport@solapayments.com) to confirm                                                                 |
| GooglePay Payment Action           | Sets the transaction payment mode. If ‘Authorize’ is selected, all transactions will need to be captured when invoicing an order.                                                                                                          |
| Enable Split Capture For GooglePay | When Payment action is set to Authorize, this will allow you to [split capture](https://docs.cardknox.com/cardknox-products/split-capture) when capturing (invoicing) a transaction.                                                       |
| Button Style                       | This sets the Google Pay button style                                                                                                                                                                                                      |
| Payment from Applicable Countries  | Select ‘Specific Countries’ to only allow payment from the ‘Payment From Specific Countries’ whitelist.                                                                                                                                    |
| Payment from Specific Countries    | Select countries you wish to whitelist.                                                                                                                                                                                                    |
| Sort Order                         | Priority of Google Pay in list of payment methods.                                                                                                                                                                                         |

## Sola Apple Pay

{% hint style="info" %}
Please complete the Apple Pay Domain Registration [here ](https://portal.solapayments.com/account-settings/payment-methods)prior to enabling Cardknox Apple Pay
{% endhint %}

| **Item** | **Description** |
| -------- | --------------- |

| **Item**                          | **Description**                                                                                                                                                                                                                        |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enabled                           | <p>This enables Sola Apple Pay. Set to ‘Yes’ to enable Apple Pay. Please ensure that your Sola account is configured for Apple Pay.<br>Please contact <a href="mailto:gatewaysupport@solapayments.com">Sola support</a> to confirm</p> |
| Title                             | Name of payment method. This will appear to users when selecting a payment method. We recommend selecting ‘Apple Pay’                                                                                                                  |
| Merchant Identifier               | The default value is merchant.cardknox.com                                                                                                                                                                                             |
| Environment                       | Sets the Apple Pay environment.                                                                                                                                                                                                        |
| Apple Pay Button Style            | This sets the Apple Pay button style                                                                                                                                                                                                   |
| Apple Pay Button Style            | This sets the Apple Pay button style                                                                                                                                                                                                   |
| Payment Action                    | Sets the transaction payment mode. If ‘Authorize’ is selected, all transactions will need to be captured when invoicing an order.                                                                                                      |
| Payment from Applicable Countries | Select ‘Specific Countries’ to only allow payment from the ‘Payment From Specific Countries’ whitelist.                                                                                                                                |
| Payment from Specific Countries   | Select countries you wish to whitelist.                                                                                                                                                                                                |
| Sort Order                        | Priority of Apple Pay in list of payment methods                                                                                                                                                                                       |

## Usage

### New Order

Select Credit Card as the payment method in the Payment & Shipping Information section (see Title in the Configuration Options section of this document).

### Capture

If ‘Authorize’ is selected as the Payment Action in the Sola module settings (see Payment Actions in the Configuration Options section of this page), select ‘Capture Online’ to capture the transaction before submitting the invoice. Please note that previously voided transactions cannot be captured and will result in an error.

### Void

Use ‘Void’ to cancel transactions on orders that have not yet been invoiced. This is only available if ‘Authorize’ is selected as the Payment Action in the Sola module settings (see Payment Actions in the Configuration Options section of this document). Once an order has been invoiced, use ‘Credit Memo’ to refund the transaction.

Please note that ‘Void’ cancels the credit card transaction but does not cancel the order. To cancel the order as well, see the Cancel section below.

### Cancel

Use Cancel to void an un-captured transaction and cancel the associated order.

### Credit Memo

Issue a Credit Memo to refund an order that has already been invoiced.

### Retrieving Sola Reference Number

Sola transaction reference numbers can be found in the Transaction History section of any order page and are listed as **Transaction ID**. This can be useful when viewing your transactions on the Sola Gateway portal or when contacting Sola Support regarding specific transactions.


# RMH (Retail Management Hero)

## Setup

* Download the Updater. <https://cdn.cardknox.com/dl/updater.exe>
* When prompted for program name, enter “PaymentEngineRMH”
* Follow the installation instructions:
  * The default download location is **C:\Program Files (x86)\Retail Hero\RMH POS\Extensions\PaymentEngineRMH**
* In the POS Manager **Setup > Financial > Tender Types**:
  * A type with the description “Credit Card” is required.
  * For Gift Card, a type with the description “Gift Card” is required.
* Add the Custom POS buttons (see below)
* Restart the POS.

## Custom Buttons

* In the POS Manager **Setup > Hardware > Custom POS Buttons**
* For Settings Management, add a custom button with the following information:
  1. Style : Internal Command
  2. Caption : Settings
  3. Command: `CustomActionCommand "paymentenginemanager65b4fe30-6fa4-4e71-af5b-71c9c1a07802"`
* There should be two options:
  * **Change Key**: This allows changing the xKey stored in the database.
  * **Change Settings**: This allows modifying the settings.

Changing the key from the settings window will update the xKey stored in the database.

* For **Gift Card:Balance**, add a custom button with the following command:
  1. Style: Internal Command
  2. Caption: Gift Balance
  3. Command: `CustomActionCommand "giftcardgetbalancee62227dd-ee9b-41b0-8390-161226f95436"`

## EBT <a href="#ebt" id="ebt"></a>

**Step 1: Configure or create EBTFS and EBTCB as tender types**

**EBT Tender**

1. Open the store Store Operations Manager and go to Financial > Tender Types.
2. If “EBTFS” is listed as an existing tender type, select it, click on Properties, and continue to the next step. If it is not listed:
   1. Click **New**
   2. Set Description: “EBT Food Stamp”
   3. Set Tender Code: `EBTFS`
3. For tender type, select “Food Stamp”

**EBT Cash Tender**

1. Open the store Store Operations Manager and go to Financial > Tender Types.
2. If “EBTCB” is listed as an existing tender type, select it, click on Properties, and continue to the next step. If it is not listed:
   1. Click **New**
   2. Set Description: “EBT Cash Benefit”
   3. Set Tender Code: EBTCB
3. For tender type, select “Debit Card”

**Step 2: Setting EBT Balance Custom Button**

**EBT Balance Command**

For EBT Balance, add a custom button with the following information:

1. Style: Internal Command
2. Caption: EBT Balance
3. Command: `CustomActionCommand ebtBalance_0586D912-FC34-401B-A55E-0B977C7F47B0`

{% hint style="info" %}
To enable the saved card feature, open the Sola settings >> RMH settings and choose **Enable Tokenization.**

To enable Device Display Items, open the Sola settings >> RMH settings and choose **Device Display Items.**
{% endhint %}

## Receipts

#### Viewing Receipt Information <a href="#viewing-receipt-information" id="viewing-receipt-information"></a>

To display receipt of payments made with Sola extension supported tender types (Credit/Debit card, EBT, Gift etc.), the application uses RMH's `Tender.Data` property to populate the custom receipt data string for these mentioned tender types. To display this value on the receipt, the property should be included in the tender iteration block.

Receipt will show in POS as shown below. The highlighted area is `Tender.Data` value.

<figure><img src="/files/Mb1bray171FsKbkj9TaG" alt=""><figcaption></figcaption></figure>

#### **Displaying additional data such as Balance, AuthCode for EBT, EBTCS, Gift** <a href="#displaying-additional-data-such-as-balance-authcode-for-ebt-ebtcs-gift" id="displaying-additional-data-such-as-balance-authcode-for-ebt-ebtcs-gift"></a>

Sales receipts can show card info with balances for EBT and gift cards. The details can be displayed at the highlighted area.

<figure><img src="/files/kjwbM0uihrLnTqjhES6f" alt=""><figcaption></figcaption></figure>

To display **Balance**, **AuthCode** of RMH plugin uses the `Tender.Data2` variable. which can be used in receipt file as below.

The highlighted block for including `Tender.Data2` is added just below the the "`Tendered`" line. This will print the additional tender details (card number, auth code, balance) for each tender if it contains additional details (such as custom payment methods like Credit Card, EBT, or Gift Card).

<figure><img src="/files/Bq8QJFl6pmgs5szOUkj0" alt=""><figcaption></figcaption></figure>

A sample receipt is shown below, which shows tender details. The receipt below shows a split payment example, containing a credit card and EBT payment. The credit card transaction displays Card Number and Auth Code. The EBT payment displays Card Number, Auth Code and the remaining balance on the card.

<figure><img src="/files/096NDY3i3H5EtmHqXrqF" alt=""><figcaption></figcaption></figure>

**NOTE**: `Tender.Data2` is not limited to EBT. It can contain additional details for other Cardknox payment methods such as EBTFS, Gift Card, and more.


# RMS (Retail Management Systems)

## System Requirements <a href="#system-requirements" id="system-requirements"></a>

.Net Framework 4 and above

## Installation Instructions for Credit Cards <a href="#installation-instructions-for-credit-cards" id="installation-instructions-for-credit-cards"></a>

Enable Sola payment processing on RMS point-of-sale systems.

**PART 1: Prepare each computer**

1. Run a Z Report:
   1. Open the Store Operations POS.
   2. Press **F5**.
   3. Select **Print Z Report**.
2. Close the Store Operations POS.
3. Go to the Store Operations Administrator and click\
   **File > Configuration > EDC**.
4. Select **Do not use electronic capture draft software** and click **OK**.
5. Repeat steps 1 and 2 on each register.

**PART 2: Download and run the software**

1. Download the Sola Updater plugin:\
   <https://cdn.cardknox.com/dl/updater.exe>
2. Right-click on the downloaded program (Updater.exe), then click **Run as administrator** and choose **Yes** when prompted.
3. An input box will appear. Type fidelipayrms and click **Enter**.
4. You will be prompted to enter your Sola key and Merchant ID. (Developers\
   should use their Sola test key and 123456 for the MID for testing.)

## Installation Instructions for Other Payment Types <a href="#installation-instructions-for-other-payment-types" id="installation-instructions-for-other-payment-types"></a>

The following steps will enable additional payment types on the Sola\
gateway.

### **Installing Credit Card Capabilities** <a href="#installing-credit-card-capabilities" id="installing-credit-card-capabilities"></a>

1. Open the Store Operations Manager and go to **Database > Tender Types**.
2. If **Credit Card** is not listed:
   1. Click on **New**.
   2. Type Credit Card in the **Description** field.
   3. Set the **Tender Code** and **Display Order** values.
3. Click **OK**.
4. Click **Close**.

### &#x20;**Installing EBT Capabilities** <a href="#hardbreak-installing-ebt-capabilities-hardbreak" id="hardbreak-installing-ebt-capabilities-hardbreak"></a>

**PART 1: Configure or create EBTFS as a tender type**

1. Open the Store Operations Manager and go to **Database >** **Tender Types**.
2. If **EBTFS** is listed as an existing tender type, select it, click on **Properties**, and continue to the next step. If it is *not* listed:
   1. Click on **New**.
   2. Type EBTFS in the **Description** field.
   3. Set the **Tender Code** and **Display Order** values.
3. In the **Tender Type** dropdown, select **Food Stamps**.
4. Click **OK**.
5.

**PART 2: Add an EBTFS button**

1. Go to **Database** **> Registers > Custom POS Buttons**.
2. Click **New**.
3. On the popup window, fill in several fields:
   1. For the **Style** box, choose **COM OBJECT (Session Object)**.
   2. For **Caption**, type EBT Balance.
   3. For **Command**, type\
      FidelipayRMS.GetEBTFSBalance.
4. Click **OK**.
5. Click **Close**.

### Installing Gift Card Capabilities <a href="#installing-gift-card-capabilities" id="installing-gift-card-capabilities"></a>

\
**PART 1: Configure or create gift cards as a tender type**

1. Open the Store Operations Manager and go to **Database >** **Tender Types**.
2. If **Gift Card** is listed as an existing tender type, select it and click **Properties**. Continue to the next step. If it is *not* listed:
   1. Click on **New**.
   2. Type Gift Card in the **Description** field.
   3. Type GC as the **Tender Code**.
   4. Set the **Display Order** value you desire.
3. In the **Tender Type** dropdown, select **Other**.
4. Click **OK**.

**PART 2: Add a Gift Card button**

1. Navigate to **Database > Registers > Custom POS Buttons**.
2. Click **New**.
3. In the window the pops up, you’ll need to fill in several fields:
   1. For the **Style** box, choose **COM OBJECT (Session Object)**.
   2. For **Caption**, type Gift Card Balance.
   3. For **Command**, type\
      FidelipayRMS.GetGiftBalance.
4. Click **OK**.

**PART 3: Set option to enter the price at POS**

1. Navigate to **Database > Items**.
2. Check if the Gift Card item exists. The description for the item should be\
   Gift Card. If it is listed, select the item and click on **Properties** and continue to the next step. If it is not listed:
   1. Click on **New**.
   2. Select on **Standard Item** and click **OK**.
   3. Set **Item Lookup Code** as gc.
3. Select the **Inventory** tab and enter the appropriate\
   information.
4. Select the **Options** tab.
5. Enable **Must enter price at the POS**.
6. Click **OK**.

## Installing Tokens <a href="#installing-tokens" id="installing-tokens"></a>

The following steps will enable you to securely save cardholder information for future use.

**PART 1: Enable tokens on your POS**

1. Run C:\FPS\_RMS\_Plugin\FidelipayRMS.exe.
2. Go to the **FidelipayRMSSettings** tab:
   1. EnableTokenization, 1
   2. DB\_Database, \[*YourDatabaseName*]
   3. DB\_Username, \[*YourDatabaseUserName*]
   4. DB\_Server, \[*YourServerIpAddress*]
   5. DB\_Password \[*YourPassword*]
   6. Click **Test Connection**.
3. Close and save the Settings file.

\
**PART 2: Add a Tokens button**

1. Open the Store Operations Manager and go to\
   **Database > Registers > Custom POS Buttons**.
2. Click **New**.
3. On the popup window, fill in several fields:
   1. For the **Style** box, choose\
      **COM OBJECT (Session Object)**.
   2. For **Caption**, type Save Card.
   3. For **Command**, type FidelipayRMS.SaveCard.
4. Click **OK**.
5. If Store Operations POS is currently running, restart it. If not, open it.
6. Click on **Saved Card** to test.

## Connecting a Credit Card Pin Pad <a href="#connecting-a-credit-card-pin-pad" id="connecting-a-credit-card-pin-pad"></a>

**PART 1: Download the device drivers**\
For VeriFone Mx devices: 32 bit:\
[cdn.cardknox.com/pe/drivers/verifone/verifone\_unified\_driver\_installer\_32.msi](https://cdn.cardknox.com/pe/drivers/verifone/verifone_unified_driver_installer_32.msi)

64 bit:\
[cdn.cardknox.com/pe/drivers/verifone/verifone\_unified\_driver\_installer\_64.msi](https://cdn.cardknox.com/pe/drivers/verifone/verifone_unified_driver_installer_64.msi)

**PART 2: Connect your terminal to RMS**&#x20;

1. Navigate to C:\FPS\_RMS\_Plugin\FidelipayRMS.exe.
2. Complete the form with the appropriate device settings.
3. Restart RMS and run a test transaction.

## Add Sola variables to receipt <a href="#receipts-updater" id="receipts-updater"></a>

To show the Sola information on the RMS receipt, you need to add **Session.Variable1** in the XML receipt. It includes the information below.

Card number\
Card Type\
Auth Code\
Tender Amount\
Transaction Type\
Response

**XML to add:**

```xml
<IF>
      <CONDITION> Len(Session.Variable1) </CONDITION>
      <THEN>
          <TABLE>
              <BORDER> tbNone </BORDER>
              <COLUMNHEADER>
                  <ALIGNMENT> "&lt;"  </ALIGNMENT>
                  <WIDTH>     PageWidth  </WIDTH>
                  <TEXT>      Session.Variable1  </TEXT>
              </COLUMNHEADER>
          </TABLE>
      </THEN>
  </IF>
```

**Update existing receipt in RMS**

**PART 1: Locate the receipt currently in use**

1. In Store Operations Manager, go to **Database > Registers > Register List**.
2. Select a register that is currently used and on which you wish to base the receipt.
3. Click **Properties**.
4. Click on the **Receipt Printer 1** tab.
5. The receipt currently in use can be found in the **Receipt Format** field.

\
**PART 2: Save the current receipt**

1. In the Store Operations Manager, go to **Database > Registers > Receipt Formats**.
2. Select the sales receipt that is currently used.
3. Click **Properties.**
4. Use the **Save As** command to save the receipt as\
   CurrentReceipt to the following location:\
   C:\Program Files\Microsoft Retail Management System\StoreOperations\ReceiptTemplates

**PART 3: Add Session.Variable1 to the receipt**

1. Open the receipt in a text editor.
2. Choose the SUB in the XML receipt where you want to display the Cardknox information.
3. Copy paste the XML to add as listed in the “Add Cardknox variables to receipt“ section above and save it.<br>

**PART 4: Update RMS through the desktop icon**

1. Open Store Operations Manager and go to **Database > Registers > Receipt Formats**.
2. On the right side of the window, click **New**.
3. Type plugin\_receipt into both the **Title** and **Description** fields.
4. In the **Sales** field, click the magnifying glass.
5. Go to the following plugin folder:\
   C:\Program Files\Microsoft RetailManagementSystem\StoreOperations\ReceiptTemplates\Plugin
6. Select the current receipt name and click **Open**.
7. When you are prompted to update all transaction types, click **Yes**.
8. The **Report** box will still not have a file. Click the magnifying glass, select **XReport.xml**, and click **Open**.
9. Click **OK** and close the Receipt Formats window.

\
**PART 5: Select the receipt format for each register**

1. Go to **Database > Registers > Register List** and complete the following steps for each register:
   1. Select the register and click **Properties**.
   2. Choose the **Receipt Printer 1** tab.
   3. In the **Receipt Format** box, click the magnifying glass.
   4. Select **plugin\_receipt** and click **OK**.
2. After this has been completed for all of the registers, close the Registers window and restart the POS.

### Display EBT Balance on Receipt

To display the EBT balance on the RMS receipt:<br>

1. In the Cardknox plugin advanced settings set `EBTFSBalanceVariable` to a number from 1-9. Note: Ensure that the (`EBTFSBalanceVariable`) variable doesn't conflict with the following variables in the settings: "GiftCardBalanceVariable", "ReceiptHookVariable", and "RetailPointBalanceVariable".
2. Add `Session.Variable{x}`  to the receipt. For example, `Session.Variable1` . The number, in this case "1", should match the number entered in step 1 above.

Sample receipt snippet:

```
<IF>
<CONDITION> Len(Session.Variable1) </CONDITION>
<THEN>
<ROW> "Available EBTFS Balance|" Session.Variable1 "|" </ROW>
</THEN>
</IF>
```

To display the GIFT balance on the RMS receipt:

1. In the Cardknox plugin advanced settings set `GiftCardBalanceVariable` to a number from 1-9. Note: Ensure that the `GiftCardBalanceVariable` variable doesn't conflict with the following variables in the settings "EBTFSBalanceVariable", "ReceiptHookVariable" and "RetailPointBalanceVariable".
2. Add `Session.Variable{x}`  to the receipt. For example `Session.Variable2` The number,  in this case "2", should match the number entered in step 2 above

Sample receipt snippet:

```
<IF>
<CONDITION> Len(Session.Variable2) </CONDITION>
<THEN>
<ROW> "Available EBTFS Balance|" Session.Variable2 "|" </ROW>
</THEN>
</IF>
```

## Additional Features

### Enable Cashback

#### Cashback Prompt on device

1. Navigate to **Advanced Settings** and set **Allow Cashback** = True
2. Set **Enable Cashback** = True

#### Add Cashback as an item

1. Navigate to **FidelipayRMSSettings** tab
2. Set **Cashback Fee Item** to a non inventory item
3. Navigate to **Advanced Settings**. Set **CashbackAmountIncludedInAmount** to True

### Offline Transactions

#### Enable Offline transaction

1. Enable Offline Transactions in the **FidelpayRMS Settings** panel
2. Click **“Display Prompt Before Continue”**: This will bring a pop up on RMS before continuing to Offline mode.
3. Selecting **"Require Customer Selection"** will require a customer selected for offline.
4. Designate the max amount allowed for Offline transactions.
5. Select the Transaction Type allowed in Offline mode.

{% hint style="warning" %}
RMS database Version minimum SQL 2005
{% endhint %}

### eWIC

**Step 1: Create a new tender**

1. Navigate to the RMS Manager > Database > Tender Types
2. Click on NEW
3. Set **Description** as eWIC
4. Set **Tender Code** as EBTW

**Step 2: Enable eWIC**

1. Enable **eWIC** in the **FidelipayRMS Settings** panel
2. "Secondary UPC Field Name": This can be used to use the Sub description for the UPC or PLU for eWIC.
3. "Discount item": Set a non-inventory item to be used for eWIC partial auth
4. "Discount reason code": Set a reason code to be used for eWIC partial auth
5. Ensure that your items lookup code matches the expected eWIC UPC or PLU code


# Frequently Asked Questions

### Question: Is there a way to specify that only numbers can be entered into a credit card number field or a CVV iFields field? Or can the system generate an error message if the format is not valid? <a href="#question-is-there-a-way-to-specify-that-only-numbers-can-be-entered-into-a-credit-card-number-field" id="question-is-there-a-way-to-specify-that-only-numbers-can-be-entered-into-a-credit-card-number-field"></a>

**Answer:** As of the v2.6.1912.1301-beta, you can specify an event to trigger a callback-based on events in the iField using the function `addIfieldCallback (event, callback)`. This callback will receive some data about events in the iField, such as whether the card number and/or CVV are valid. The card number validation is based on minimum and maximum lengths and whether it passes the Luhn check. The CVV validation is based on the length, depending on the card issuer.

You can use a callback to prevent the call to get tokens. We recommend you perform the least client-side validation necessary because a mistake in the validation logic could prevent a transaction from being processed when it would otherwise have been approved. See the iField Key Pressed Callback section in the iFields documentation for an example of a callback being used to change the iField style based on whether the data in it is valid.

### Question: How do I obtain an API key? <a href="#question-how-do-i-obtain-an-api-key" id="question-how-do-i-obtain-an-api-key"></a>

**Answer:** You can generate an API directly from your Merchant Portal Settings, please see Key Managment in the Sola Merchant Portal guide for more information.

### Question: What devices are supported for in-store payments? <a href="#question-what-devices-are-supported-for-in-store-payments" id="question-what-devices-are-supported-for-in-store-payments"></a>

**Answer:** Sola supports a wide variety of terminals and card readers from manufacturers such as IDTech, Verifone, and more. See the complete list at Supported EMV Equipment.

### Question: How do I close a batch so I can get funded? <a href="#question-how-do-i-close-a-batch-so-i-can-get-funded" id="question-how-do-i-close-a-batch-so-i-can-get-funded"></a>

**Answer:** Sola closes batches automatically, so there is no need for you to manually close a batch. Learn more about Sola batch processing at Batch Processing.

### Question: When integrating with the Sola transaction API, how can I ensure that the customer receives a receipt of the transaction details when they place an order on a merchant’s website? <a href="#question-when-integrating-with-the-cardknox-transaction-api-how-can-i-ensure-that-the-customer-recei" id="question-when-integrating-with-the-cardknox-transaction-api-how-can-i-ensure-that-the-customer-recei"></a>

**Answer:** You can do this by setting the `xCustReceipt` field to True along with the transaction request to send a receipt to the customer via the email address specified in the xEmail field.

### Question: Does Sola support Magento 2? <a href="#question-does-cardknox-support-magento-2" id="question-does-cardknox-support-magento-2"></a>

**Answer:** Yes, there is a Sola plugin for Magento 2 that connects to Sola directly. See Magento Payment Gateway for more information about the Sola Magento 2 plugin.

### Question: Does Sola support Magento 1? <a href="#question-does-cardknox-support-magento-1" id="question-does-cardknox-support-magento-1"></a>

**Answer:** Yes. You can do this by setting up Magento 1 with the Authorize.Net AIM option available in the Magento settings and then changing the endpoint URL to Sola.

### Question: What is the Sola mobile app? <a href="#question-what-is-the-cardknox-mobile-app" id="question-what-is-the-cardknox-mobile-app"></a>

**Answer:** Sola Mobile is an app you can download to your mobile device to securely accept credit card transactions on your Sola account.

[Android App](https://play.google.com/store/apps/details?id=com.gateway.cardknox.android)\
[iOS App](https://apps.apple.com/us/app/cardknox-payments/id1358857120)

### Question: Does the Sola mobile app work with an external credit card device? <a href="#question-does-the-cardknox-mobile-app-work-with-an-external-credit-card-device" id="question-does-the-cardknox-mobile-app-work-with-an-external-credit-card-device"></a>

**Answer:** No, not at this time. We are working toward achieving this goal in 2024.

### Question: What is Sola iFields? <a href="#question-what-is-cardknox-ifields" id="question-what-is-cardknox-ifields"></a>

**Answer:** Sola iFields technology uses iframe fields to replace credit card and CVV data on the website and sends the card information directly to Sola. Since sensitive card information bypasses the merchant’s server, this solution enables merchants to remain out of PCI scope. In addition, this Sola solution allows developers to fully customize how payment forms are designed. Learn more about Sola iFields technology at Sola iFields.

### Question: Does Sola support contactless payments? <a href="#question-does-cardknox-support-contactless-payments" id="question-does-cardknox-support-contactless-payments"></a>

**Answer:** Yes, Sola has several terminals that support near-field communication (NFC) technology for contactless payments. See the complete list of EMV terminals.


# How to Build POS Integration Flows

When you build integrations for different POS devices, there are three distinct types of credit card processing flows. Read on to better understand each integration method.

### **Credit Card Processing Flow 1**

**Payment Engine → Cardknox Gateway → Bank**\
The credit card device is used to obtain card information, but the transaction flows from Payment Engine to the Cardknox Gateway and then to the bank.

<figure><img src="/files/uiXQlDEvDoNw30eVZMI9" alt=""><figcaption></figcaption></figure>

1. The **POS software** communicates the intended transaction to **Payment Engine**.
2. **Payment Engine** prompts the user for their card information via the **credit card device**.
3. The **credit card device** transfers transaction data to **Payment Engine**.
4. **Payment Engine** transfers transaction data to the **Cardknox gateway**.
5. The **Cardknox gateway** transfers transaction data to the **bank** for processing.
6. The **bank** communicates the transaction response (approval or decline) to the **Cardknox gateway**.
7. The **Cardknox gateway** communicates the bank’s transaction response to **Payment Engine**.
8. **Payment Engine** communicates the bank's transaction response to the **POS software**.

### Credit Card Processing Flow 2

**Payment Engine → Credit Card Device → Cardknox Gateway → Bank**\
The credit card device plays an active role in the transaction flow, with the transaction passing from Payment Engine, to the device, to the Cardknox Gateway, and then to the bank.

<figure><img src="/files/iuBv6u7AShq84uac4Xzw" alt=""><figcaption></figcaption></figure>

1. The **POS software** communicates the intended transaction to **Payment Engine**.
2. **Payment Engine** communicates the intended transaction to the **credit card device**.
3. The **credit card device** prompts the user for their card information.
4. The **credit card device** transfers transaction data to the **Cardknox gateway**.
5. The **Cardknox gateway** transfers transaction data to the **bank** for processing.
6. The **bank** communicates the transaction response (approval or decline) to the **Cardknox gateway**.
7. The **Cardknox gateway** communicates the bank’s transaction response to the **credit card device**.
8. The **credit card device** communicates the bank’s transaction response to **Payment Engine**.
9. **Payment Engine** communicates the bank’s transaction response to the **POS software**.

### Credit Card Processing Flow 3

**Payment Engine → Credit Card Device → Bank**\
The transaction flows directly from Payment Engine to the credit card device and then to the bank. As in the first two flows, Sola is still involved in the reporting and integration processes.

<figure><img src="/files/doMMHaQ5TfNdp2MazeIo" alt=""><figcaption></figcaption></figure>

1. The **POS software** communicates the intended transaction to **Payment Engine**.
2. **Payment Engine** communicates the intended transaction to the **credit card device**.
3. The **credit card device** prompts the user for their card information.
4. The **credit card device** transfers transaction data to the **bank** for processing.
5. The **bank** communicates the transaction response (approval or decline) to the **credit card device**.
6. The **credit card device** provides the bank’s transaction response to **Payment Engine**.
7. **Payment Engine** communicates the bank's transaction response to the **POS software**.
8. **Payment Engine** notifies the Sola **gateway** of the transaction so that the data is recorded in the Merchant’s Sola account.

## Ways to Integrate – Considerations <a href="#ways-to-integrate-considerations" id="ways-to-integrate-considerations"></a>

### SDK (Payment Engine) <a href="#sdk-payment-engine" id="sdk-payment-engine"></a>

[Payment Engine SDK](/sdk/payment-engine-sdk)

**Supported devices:**

* All Sola supported devices

**Benefits:**

* Supports all Sola devices

**Limitations:**

* Only supported on Windows

### BBPOS <a href="#bbpos" id="bbpos"></a>

[BBPOS](/products/bbpos)

**Supported devices:**

* All Sola supported devices

**Benefits:**

* Supports all Sola devices

**Limitations:**

* Only supported on Windows and Mac (The installation on Mac can be difficult)
* Requires the BBPOS application to be installed and needs to run in the background all the time

### API + Keyboard Emulator <a href="#api--keyboard-emulator" id="api--keyboard-emulator"></a>

[Transaction API](/api/transaction)

**Supported devices:**

* ID Tech Augusta and VP8300

**Benefits:**

* Minimal integration
* Plug n Play Devices

**Limitations:**

* Supports a limited number of devices
* Does not support PIN entry
* Augusta does not support tap
* The US Only


# Card Present Integration Guide

### Payment Engine .NET SDK <a href="#payment-engine-.net-sdk" id="payment-engine-.net-sdk"></a>

[Payment Engine SDK](/sdk/payment-engine-sdk)

**Supported Devices:**\
All Sola-supported devices

**Benefits:**

* Seamless integration with all Sola-supported devices.

**Limitations:**

* Only compatible with Windows operating systems.

### BBPOS  <a href="#bbpos" id="bbpos"></a>

[BBPOS](/products/bbpos)

**Supported Devices:**\
All Sola-supported devices

**Benefits:**

* Works with all Sola-supported devices.

**Limitations:**

* Compatible only with Windows and Mac.
* Installation on Mac can be challenging.
* Requires the BBPOS application to be installed and actively running in the background.\ <br>

### Cloud IM  <a href="#cloud-im" id="cloud-im"></a>

[CloudIM Developer Guide | Cardknox](https://docs.cardknox.com/cardknox-products/cloudim-developer-guide)

**Supported Devices:**\
PAX A77, A35, A80, A920, and A920 Pro

**Benefits:**

* API-driven integration with minimal setup.
* No installation required for operation.

**Limitations:**

* Supports a limited range of devices.
* Some commands and features are not yet fully supported.

### API + Keyboard Emulator <a href="#api--keyboard-emulator" id="api--keyboard-emulator"></a>

[Transaction API](/api/transaction)

**Supported Devices:**\
ID Tech Augusta and VP8300

**Benefits:**

* Simple integration through API.
* Plug-and-play devices for quick setup.

**Limitations:**

* Only supports a limited number of devices.
* Lacks support for PIN entry.
* Augusta does not support tap functionality.
* Only supported in the US

<br>


# Supported Currencies

| **AlphaCode** | **NumericCode** |
| ------------- | --------------- |
| USD           | 840             |
| AED           | 784             |
| AFN           | 971             |
| ALL           | 008             |
| AMD           | 051             |
| ANG           | 532             |
| AOA           | 973             |
| ARS           | 032             |
| AUD           | 036             |
| AWG           | 533             |
| AZN           | 944             |
| BAM           | 977             |
| BBD           | 052             |
| BDT           | 050             |
| BGN           | 975             |
| BHD           | 048             |
| BIF           | 108             |
| BMD           | 060             |
| BND           | 096             |
| BOB           | 068             |
| BOV           | 984             |
| BRL           | 986             |
| BSD           | 044             |
| BTN           | 064             |
| BWP           | 072             |
| BYN           | 933             |
| BZD           | 084             |
| CAD           | 124             |
| CDF           | 976             |
| CHE           | 947             |
| CHF           | 756             |
| CHW           | 948             |
| CLF           | 990             |
| CLP           | 152             |
| CNY           | 156             |
| COP           | 170             |
| COU           | 970             |
| CRC           | 188             |
| CUC           | 931             |
| CUP           | 192             |
| CVE           | 132             |
| CZK           | 203             |
| DJF           | 262             |
| DKK           | 208             |
| DOP           | 214             |
| DZD           | 012             |
| EGP           | 818             |
| ERN           | 232             |
| ETB           | 230             |
| EUR           | 978             |
| FJD           | 242             |
| FKP           | 238             |
| GBP           | 826             |
| GEL           | 981             |
| GHS           | 936             |
| GIP           | 292             |
| GMD           | 270             |
| GNF           | 324             |
| GTQ           | 320             |
| GYD           | 328             |
| HKD           | 344             |
| HNL           | 340             |
| HRK           | 191             |
| HTG           | 332             |
| HUF           | 348             |
| IDR           | 360             |
| ILS           | 376             |
| INR           | 356             |
| IQD           | 368             |
| IRR           | 364             |
| ISK           | 352             |
| JMD           | 388             |
| JOD           | 400             |
| JPY           | 392             |
| KES           | 404             |
| KGS           | 417             |
| KHR           | 116             |
| KMF           | 174             |
| KPW           | 408             |
| KRW           | 410             |
| KWD           | 414             |
| KYD           | 136             |
| KZT           | 398             |
| LAK           | 418             |
| LBP           | 422             |
| LKR           | 144             |
| LRD           | 430             |
| LSL           | 426             |
| LYD           | 434             |
| MAD           | 504             |
| MDL           | 498             |
| MGA           | 969             |
| MKD           | 807             |
| MMK           | 104             |
| MNT           | 496             |
| MOP           | 446             |
| MRU           | 929             |
| MUR           | 480             |
| MVR           | 462             |
| MWK           | 454             |
| MXN           | 484             |
| MXV           | 979             |
| MYR           | 458             |
| MZN           | 943             |
| NAD           | 516             |
| NGN           | 566             |
| NIO           | 558             |
| NOK           | 578             |
| NPR           | 524             |
| NZD           | 554             |
| OMR           | 512             |
| PAB           | 590             |
| PEN           | 604             |
| PGK           | 598             |
| PHP           | 608             |
| PKR           | 586             |
| PLN           | 985             |
| PYG           | 600             |
| QAR           | 634             |
| RON           | 946             |
| RSD           | 941             |
| RUB           | 643             |
| RWF           | 646             |
| SAR           | 682             |
| SBD           | 090             |
| SCR           | 690             |
| SDG           | 938             |
| SEK           | 752             |
| SGD           | 702             |
| SHP           | 654             |
| SLL           | 694             |
| SOS           | 706             |
| SRD           | 968             |
| SSP           | 728             |
| STN           | 930             |
| SVC           | 222             |
| SYP           | 760             |
| SZL           | 748             |
| THB           | 764             |
| TJS           | 972             |
| TMT           | 934             |
| TND           | 788             |
| TOP           | 776             |
| TRY           | 949             |
| TTD           | 780             |
| TWD           | 901             |
| TZS           | 834             |
| UAH           | 980             |
| UGX           | 800             |
| USN           | 997             |
| UYI           | 940             |
| UYU           | 858             |
| UZS           | 860             |
| VEF           | 937             |
| VND           | 704             |
| VUV           | 548             |
| WST           | 882             |
| XAF           | 950             |
| XCD           | 951             |
| XDR           | 960             |
| XOF           | 952             |
| XPF           | 953             |
| XSU           | 994             |
| XUA           | 965             |
| YER           | 886             |
| ZAR           | 710             |
| ZMW           | 967             |
| ZWL           | 932             |


# Glossary of Terms

Navigating through a sea of technical terms, phrases, and acronyms can be confusing, even for someone familiar with the payment processing industry. Here is a list of some of the most commonly used payment processing terms to help you.

***

[A](#account-number)   [B](#bank-card)   [C](#card-association)   [D](#dcc)   [E](#ebt)   [F](#federal-reserve-bank)   [G](#gateway-only-provider)   [H](#holdback)   [I](#ifields-technology)   [K](#kyc)   [L](#loyalty-program)   [M](#magnetic-stripe)   [N](#nfc)   [O](#omnichannel-processing)   [P](#payfac)   [S](#sdk)   [T](#transaction)   [V](#var)   [Z](#zip-code)   [#](#3d-secure-technology)

***

### Account number

A unique sequence of numbers assigned to a cardholder account that identifies the issuer and type of financial transaction card.

***

### Account Updater

A tool that, in conjunction with tokenization, automatically keeps credit cards in the Sola data vault updated to ensure subsequent transactions are not declined.

***

### ACH

Automated Clearing House – Electronic network used to transfer money and payment information between bank accounts. See <https://www.solapayments.com/ach-payments> for more information.

***

### Acquirer

A licensed member that maintains the merchant relationship and acquires the data relating to a transaction from the merchant or card acceptor and submits that data into interchange, either directly or indirectly.

***

### AFT

Automatic Funds Transfer – A transaction in which funds are securely transferred from one bank account to another via electronic or telecommunications technology.

***

### AML

Anti-Money Laundering – A set of laws, regulations, and procedures intended to prevent criminals from disguising illegally obtained funds as legitimate income. See KYC for more information.

***

### Annual fee

A yearly fee charged by some independent sales organizations (ISOs) and acquirers to maintain a merchant’s account. This is also called a renewal fee, subscription fee, or membership fee.

***

### API

Application Programming Interface – A technological interface or communication protocol between a client and a server intended to simplify the building of client-side software. See <https://www.solapayments.com/features-platform> for more information.

***

### ATM

Automated Teller Machine – An unattended, magnetic stripe-reading or EMV (Europay, Mastercard®, and Visa®) chip-enabled terminal that dispenses cash, accepts deposits and loan payments, enables a bank customer to order transfers among accounts, and make account inquiries.

***

### Authorization

A process defined in operations regulations whereby a transaction is approved by or on behalf of an issuer; commonly understood to be receiving of a sales validation by the merchant, telephone, or authorization terminal.

***

### Authorization code

A code notifying you that you have obtained the authorization for a specific card transaction.

***

### AVS

Address Verification System – Also referred to as Address Verification Service, AVS is a system used to verify whether the billing address given by the customer matches the credit card used for the transaction. This system checks the billing address of the credit card provided by the user with the address on file at the credit card company. If a merchant chooses not to use AVS, Visa and Mastercard will not support their transactions and will charge an additional percentage on those sales.

***

### AVS Precheck

Sola feature that enables the AVS response to occur before the authorization so that if the transaction is declined, there is no temporary hold on the customer’s card.

***

### Bank card

A debit or credit card issued by an issuing bank. Also referred to as “bankcard.”

***

### Batch

A collection of credit card transactions saved for submitting at one time, usually each day. Merchants who do not have real-time verification systems must submit their transactions manually through a point-of-sale (POS) terminal. Batch fees are charged to encourage a merchant to submit his or her transactions at one time, rather than throughout the day.

***

### BBPOS

Browser-Based POS – Sola application that allows a POS running in a browser to accept EMV payments while remaining out of PCI scope.

***

### Billing Cycle

The interval between periodic billings for goods sold or services rendered, typically sent on a monthly basis.

***

### BIN

Bank Identification Number – The first 6 digits of a credit or debit card number. Also referred to as Issuer Identification Number (IIN)

***

### Card association

A payment card industry governing body that sets rules and interchange rates. Visa, Mastercard, Discover, and American Express are the four largest card associations in North America.

***

### Cardholder

The customer to whom a card has been issued, or the individual authorized to use the card.

***

### Chargeback

A chargeback occurs when a cardholder disputes a credit card transaction with his or her credit card issuer. The card issuer initiates a chargeback against the merchant account. The amount of the disputed transaction is immediately withdrawn from the merchant’s bank account, and the merchant has 10 days in which to dispute the chargeback with supporting documentation such as proof of purchase, customer signature, proof of delivery, etc. A chargeback is ultimately decided and resolved by the card association. A chargeback fee is usually assessed to the merchant on top of the actual transaction. See also Retrieval request.

***

### Check

A bill of exchange or draft on a bank drawn against deposited funds to pay a specified sum of money to a specified entity (e.g., a person or business) on demand. A check is considered cash and is negotiable when endorsed.

***

### Clear

The collection of funds on which a check is drawn and payment of those funds to the holder of the check.

***

### Clearing

The process of exchanging financial transaction details between an acquirer and an issuer to facilitate posting of a cardholder’s account and reconciliation of a customer’s settlement position.

***

### Clearing House Funds

Funds represented by checks or drafts that pass between banks through the Federal Reserve system.

***

### CNP

Card Not Present – A transaction made with a payment card in which the customer does not physically present the card to the merchant at the time of the transaction. Examples include online, mobile, and MOTO transactions.

***

### Code 10 authorization

A voice authorization code that you might initiate when you suspect a card is stolen or counterfeit, or when a customer is acting suspiciously.

***

### Contactless

A payment method that uses near field communication (NFC) technology to enable purchases using an NFC-enabled EMV chip card, or other payment-enabled device such as a mobile phone, at the point of sale without having physical contact with the payment terminal. See NFC for more information.

***

### Credit

A refund or return of goods by a consumer to the merchant.

***

### Credit card

A transaction card bearing an account number assigned to a cardholder with a credit limit that can be used to purchase goods and services and to obtain cash disbursements on credit. The cardholder is subsequently billed by an issuer for repayment of the credit extended at once or on an installment basis.

***

### Credit card processors

Merchant services providers that handle the details of processing credit card transactions between merchants, issuing banks, and merchant account providers. Also referred to as “third-party processors.”

***

### Currency conversion

The process by which the transaction currency is converted into the currency of settlement or the currency of the issuer for the purpose of facilitating transaction authorization, clearing, and settlement reporting. The currency of transaction is determined by the acquirer; the currency of the issuer is the preferred currency used by the issuer, and most often, the currency in which the cardholder will be billed.

***

### CVV

Card Verification Value – Security feature used with card-not-present transactions. The CVV is a 3- or 4-digit code either printed or embossed on a credit or debit card. Also known as Card Security Code (CSC). Issuer variations:

• American Express, Discover – CID\
• Mastercard – CVC,CVC2\
• Visa – CVV, CVV2

***

### DCC

Dynamic Currency Conversion – A credit card processing solution that allows merchants to offer international customers the choice to pay with Visa and Mastercard in either their local currency, or the merchant’s base currency.

The exchange rate includes a 3% margin which is displayed on the receipt along with the conversion. By paying in their local currency, tourists and business travelers can make informed decisions about their purchases and feel confident knowing the exact amount they are paying. In addition, cardholders have the choice of opting out and paying without converting the sale to avoid being charged international fees when their issuer does not charge. Revenue split is available to merchant.

***

### Debit card

A transaction card used to initiate a debit transaction. In general, these transactions are used primarily to purchase goods and services and to obtain cash, for which the cardholder’s asset account is debited by the issuer.

***

### Debit fees

Fees based on the debit network that issues the debit card. Debit fees are comprised of network fees and transaction fees, and usually consist of a flat fee and a statement fee.

***

### Decline re-routing

Sola feature that enables a transaction to be re-routed to an alternate processor if the transaction was initially declined.

***

### Digital wallet

A consumer account set up to allow e-commerce transactions through a particular credit card processing system. Before the consumer can make a purchase, he or she must first establish an account with the credit card processor, who provides an identification number and password. The consumer can then make purchases at any Web site that supports the digital wallet system.

***

### Discount rate

The rate charged to a merchant for payment processing services on debit and credit card transactions.

***

### EBT

Electronic Benefits Transfer – An electronic system used in the United States that allows state welfare departments to issue benefits via a magnetically encoded payment card. See <https://solapayments.com/features-in-persons-payments/#EBTsystems> for more information.

***

### E-commerce

The buying and selling of goods and services, or the transmitting of funds or data, over an electronic network, primarily the Internet. These business transactions occur either as business-to-business (B2B), business-to-consumer (B2C), consumer-to-consumer, or consumer-to-business.

***

### EDC

Electronic draft capture – A system in which the transaction data is captured at the merchant location for processing and storage.

***

### EFT

Electronic funds transfer – A paperless transfer of funds initiated from a terminal, computer, telephone instrument, or magnetic tape.

***

### EMV

Europay, MasterCard and Visa – EMV is a global standard created by Europay, Mastercard, and Visa for authenticating payment card transactions. See <https://www.cardknox.com/emv/> for more information.

***

### EMV card

A credit or debit card with an embedded microchip and associated technology designed to enable secure payments at compatible point-of-sale terminals. Also referred to as “chip card,” “PIN-and-chip,” and “smart card.” See <https://www.cardknox.com/emv/> for more information.

***

### ERP

Enterprise Resource Planning – Software application used to integrate all of the processes needed to run a company with a single system.

***

### eWIC card

WIC (Women, Infants, and Children) – WIC is a federal grant program designed to provide supplemental nutritious food and nutrition education to low-income pregnant, breastfeeding, and non-breastfeeding postpartum women, and to infants and children up to age five who are found to be at nutritional risk. An eWIC card is WIC’s electronic payment card issued to participants in the program used to obtain nutrition benefits. See also “EBT card.” See <https://solapayments.com/features-in-persons-payments/#EBTsystems> for more information.

***

### Federal Reserve Bank

A bank that, along with its branches, is one of 12 banks that make up the Federal Reserve System. The role of each Federal Reserve Bank is to monitor the commercial and savings banks in its region to ensure that they follow Federal Reserve Board regulations. The reserve banks act as depositories for member banks in their regions, providing money transfer and other services.

***

### Financial Institution

An institution that collects funds from the public to place in financial assets such as stocks, bonds, money market instruments, bank deposits, or loans. Depository institutions such as banks, savings and loans, credit unions, and savings banks, pay interest on deposits and invest the deposit money mostly in loans.

***

### Floor limit

A specific dollar limit used to determine which card transactions you must authorize. For example, if your business has a floor limit of $1,000, you must get authorization for any transaction over that amount. Note: All airline, telephone, and mail order transactions must be authorized, even if the amount is under your floor limit.

***

### Fraud

A wrongful or criminal deceptive activity used to obtain money, assets, or other property.

***

### Gateway-only provider

Option that enables a merchant the flexibility to process transactions under their own merchant account. The Sola gateway-only option also offers pre-processing functions such as fraud screening and processor routing.

***

### Holdback

A portion of the revenue from a merchant’s credit card transactions held in reserve by the merchant account provider to cover possible disputed charges, chargeback fees, and other expenses. Also referred to as a “reserve.” After a predetermined time, holdbacks are turned over to the merchant. Note: merchant account providers almost never pay interest on holdbacks.

***

### iFields technology

A Sola technology solution that integrates into your payment forms, enabling you to design and customize the look and feel of your payment and checkout flows. You can process transactions without having sensitive card data touch your server, keeping you out of PCI scope.

***

### Intelligent routing

Sola's proprietary Interchange Qualification Monitoring (IQM) technology that gathers transaction data and routes every transaction to the payment processing platform that can process the payment for the lowest cost.

***

### Interchange fee

The fee that the card association charges the merchant to get the funds into the merchant’s bank (acquiring bank) and to get the billing information to the cardholder’s bank (issuing bank). Interchange fees are determined based on credit card regulations and how the appropriate data is captured, including card swipe or dip, address, and electronic signature as needed. These fees are also based on the timeliness of the settlement of transactions.

***

### ISO

Independent Sales Organization – A company that sells credit card processing services independently from a financial firm or bank, allowing a business to accept credit card payments.

***

### Issuer

The member bank that enters into a contractual agreement with card associations to issue cards.

***

### Issuing bank

The bank that maintains the consumer’s credit card account and which must pay out to the merchant’s account in a credit card purchase. The issuing bank bills the customer for the debt.

***

### ISV

Independent Software Vendor – An individual or organization that develops, markets, and sells software products that run on third-party software and hardware platforms.

***

### IVR

Interactive Voice Response – Technology that allows a computer to interact with humans through the use of voice and dual tone multi-frequency (DTMF) signal input using a touch tone keypad. In telecommunications, IVR allows customers to interact with a company’s host system via a telephone keypad or by speech recognition. See <https://www.cardknox.com/phonepay/> for more information.

***

### KYC

Know Your Customer – The process of a business identifying and verifying the identity of its clients and assessing their suitability, along with the potential risks of illegal intentions towards the business relationship. The term is also used to refer to the bank regulations and anti-money laundering regulations which govern these activities.

***

### Loyalty program

A rewards program a merchant offers to its customers who meet certain criteria, such as making frequent purchases.

***

### Magnetic stripe

The magnetically encoded stripe on the bank card that contains information pertinent to the cardholder account. The physical and magnetic characteristics of the magnetic stripe are specified in ISO Standards 7810, 7811, and 7813.

***

### Magnetic stripe reader

A device that reads information recorded on the magnetic stripe of a card. Also known as a “card swipe reader.”

***

### MCP

Multi Currency Pricing – An e-commerce solution that converts the merchant’s base currency into the customer’s foreign currency. Merchants are funded in US currency at a guaranteed rate without any fluctuation risk.

***

### Member

An institution that participates in the programs offered by card associations such as issuers and acquirers.

***

### Merchant

A retailer, or any other person, firm, or corporation that (pursuant to a merchant agreement) agrees to accept credit cards, debit cards, or both, when properly presented.

***

### Merchant account

A specialized bank-approved and issued account to process credit card transactions. It is one of three parts needed to accept credit cards. The other required parts are a local bank checking account (to deposit funds) and a processing solution (to access the merchant account) such as a terminal or gateway.

***

### Merchant bank

A bank that has entered into an agreement with a merchant to accept deposits generated by bank card transactions; also referred to as the “acquirer” or “acquiring bank.”

***

### Merchant Identification Number

The number that a financial institution assigns to a merchant to identify the business.

***

### Mobile payment

Payment made with a mobile payment application using a mobile device such as a smartphone or tablet. Examples include Apple Pay, Cash App, Google Pay, Venmo, and Zelle.

***

### Monthly minimum

The minimum amount in fees and percentages charged by a merchant services provider in a given month. If account activity does not generate the monthly minimum, the account holder must make up the difference.

***

### MOTO

The discount rate charged by the merchant account provider for credit card transactions in which the actual credit card was not available to the merchant. MOTO discount rates are generally higher than swipe discount rates to account for the increased chance of fraud or nonpayment.

***

### NFC

Near Field Communication – A set of communication protocols that enable two electronic devices, one of which is usually a portable device such as a smartphone, to establish communication by bringing them within 1 to 2 inches of each other.

***

### Omnichannel processing

Technical solution enabling a merchant to accept cashless payments across all channels, including online, in-store, mobile, e-wallet, and MOTO.

***

### PayFac

Payment Facilitator – Merchant service provider that simplifies the merchant account enrollment process by enabling a business to sign up as a sub-merchant under the payment facilitator’s merchant account.

***

### Payment aggregator

A service provider that allows merchants to process mobile or e-commerce payments. Payment aggregators enable businesses to accept credit and debit card payments without setting up a merchant account through a bank.

***

### PCI DSS

Payment Card Industry Data Security Standard – The PCI information security standard for organizations that handle branded credit cards from the major card issuers.

The PCI Standard is mandated by the card brands but is administered by the Payment Card Industry Security Standards Council (PCI SSC). The standard was created to increase controls around cardholder data to reduce credit card fraud. Validation of compliance is performed annually or quarterly, either by an external Qualified Security Assessor (QSA) or by a firm specific Internal Security Assessor (ISA) that creates a Report on Compliance for organizations handling large volumes of transactions, or by Self-Assessment Questionnaire (SAQ) for companies handling smaller volumes.

***

### PCI DSS Level 1 Compliance

A set of requirements developed by the PCI SSC to ensure that companies that store, transmit, or process credit card data comply with the highest standards of security. Within the PCI DSS standards, there are 4 levels of PCI compliance. These levels are based on the annual number of transactions for any given merchant.

PCI DSS Level 1 is the highest level of compliance and is defined as follows:

Processing greater than 6 million Mastercard or Visa transactions annually, OR,\
A merchant that has experienced an attack resulting in compromised card data, OR,\
A merchant deemed Level 1 by a card association

***

### PCI SSC

Payment Card Industry Security Standards Council – Global forum that brings together payments industry stakeholders to develop and drive adoption of data security standards and resources for safe payments worldwide.

***

### Payment gateway

The code that transmits a customer’s order to and from a merchant’s bank’s transaction-authorizing agent, usually a merchant account provider. See also “real-time processing.” See <https://solapayments.com/> for more information about the Sola payment gateway.

***

### Payment gateway provider

A company that provides code and/or software for an e-commerce site enabling it to transfer information from its shopping cart to the acquiring bank, and on through the rest of the credit card transaction process. See also “payment gateway.”

***

### PIN

Personal Identification Number – A four-to-twelve character secret code that allows an issuer to positively authenticate the cardholder for the purpose of approving an ATM or terminal machine transaction occurring at a point-of-interaction device.

***

### PIN debit

Secure PIN debit card processing feature which results in the lowest processing fees.

***

### Plugin

A software component, also called an extension, that adds a specific feature to an existing program to enable customization.

***

### POS

Point of Sale – A location where a transaction takes place between a merchant and a customer when a product or service is purchased, commonly using a point-of-sale system to complete the transaction. POS can also refer to point-of-sale hardware and software, such as electronic cash register systems, touch-screen displays, barcode scanners, and receipt printers.

***

### POS terminal

A device that allows a customer to swipe, tap, or insert a credit card to make a charge. Also known as a “terminal machine.” See <https://www.cardknox.com/supported-emv-equipment/> for more information.

***

### Postal code

A 6-digit alphanumeric string of characters that form part of a postal address in Canada that follows the province or territory abbreviation.

***

### Processing solution

A device, software, or virtual product that allows a merchant to connect to a merchant account. Without a processing solution like a credit card terminal, there would be no way to verify, approve, and deposit credit card transactions.

***

### PSP

Payment Service Provider – A company that combines the functions of both a payment gateway and a payment processor, and can connect to multiple acquiring and payment networks.

***

### P2PE

Point-to-Point Encryption – a security standard created by the Payment Card Industry (PCI) to ensure payment card data remains secure from the beginning to the end of the transaction process.

***

### Real-time processing

The process of having a customer’s credit card information validated and processed automatically and in real-time. The credit card will be charged and the money will be deposited into your bank account all automatically.

***

### Receipt

A hardcopy document representing a transaction that took place at the point of sale, with a description that usually includes the transaction date, merchant name/location, primary account number, amount, and reference number.

***

### Recurring fees

Regularly occurring charges for maintaining a merchant account. Recurring fees include the discount rate, transaction fees, statement fee, and monthly minimum.

***

### Recurring payment

Regularly scheduled customer payments that occur over time at specific intervals, such as daily, weekly, monthly, quarterly, or annually.

***

### Refund

Money returned to a customer in exchange for the return of purchased goods or services, or when the purchased goods or services were unsatisfactory or unfulfilled.

***

### Reserve

See “Holdback.”

***

### Retrieval request

A retrieval request occurs when a cardholder cannot remember a credit card transaction, or when the bank wants order information. The card issuer initiates the retrieval request, and the merchant has 10 days to respond with the order information or the retrieval request will turn into a chargeback. Retrieval requests usually include a fee issued against the merchant.

***

### Routing number

A 9-digit number established by the American Bankers Association (ABA) used to identify a bank or financial institution when clearing funds or processing checks. Also referred to as a routing transit number.

***

### SDK

Software Development Kit – A collection of software used for developing applications for a specific device or operating system. SDKs typically include a compiler, which is used to create applications from source code files, and an integrated development environment (IDE) enabling a developer to write source code, fix program errors, and edit a program’s graphical user interface (GUI). See <https://solapayments.com/features-platforms/> for more information.

***

### SSL

Secure Socket Layer – A system for encrypting data sent over the Internet, including e-commerce transactions and passwords. With SSL, client and server computers exchange public keys, allowing them to encode and decode their communication.

***

### Settlement

The process by which merchant and cardholder banks exchange financial data and value resulting from sales transactions, cash disbursements, and merchandise credits.

***

### Setup fees

Fees charged for establishing a merchant account, including application fees, software licensing fees, and equipment purchases.

***

### Smart card

A payment transaction card that contains an embedded computer chip (either a memory chip or a microprocessor) that stores and transmits data. This data is usually associated with either value, information, or both and is stored and processed within the card’s chip.

***

### Stored-value card

A transaction card, such as a gift card or prepaid card, containing a computer chip that can store electronic “money.” Unlike a credit card, a stored-value card can only spend out the dollar amount its owner has already put into the card account. It is similar in function to a prepaid calling card but is available for all purchases.

***

### Subscription

A recurring payment that occurs on a regular, fixed schedule. Examples include memberships, charitable donations, and rent.

***

### Swipe discount rate

The discount rate charged by a merchant account provider for transactions in which a credit card is available for inspection by the merchant. Swipe discount rates are generally lower than MOTO discount rates because the merchant can match signatures and perform other checks for fraud or misuse.

***

### Transaction

An exchange or transfer of goods, services, or funds between a customer and a merchant.

***

### Transaction date

The date on which a cardholder effects a card purchase of goods, services, or other things of value, or effects a cash disbursement.

***

### Transaction fee

A charge for each credit card transaction, collected by the merchant account provider or ISO.

***

### Tokenization

A process that replaces sensitive cardholder data with a string of unique characters to safeguard payment card information during a transaction.

***

### VAR

Value Added Reseller – A company that adds features or services to an existing product, then resells it (usually to end-users) as an integrated product or complete turnkey solution.

***

### Void

Identifies a transaction canceled by a merchant before it settles through a customer’s payment card account.

***

### ZIP code

A 5- to 9-digit numeric code used by the United States Postal Service (USPS) to identify a particular postal delivery area in the United States. The 9-digit code is referred to as “ZIP+4” with the last 4 digits identifying a specific delivery route within a delivery area.

***

### 3D Secure technology

A set of fraud prevention protocols that enables a real-time, secure, information-sharing connection between merchants, payment networks, and financial institutions to authenticate customers more accurately and reduce fraud in card-not-present transactions. Each card network (Visa, Mastercard, American Express, and Discover) has their own version of 3-D Secure.

* 3D Secure version 2.0 improvements over version 1.0: Stronger authentication methods – Biometric and risk-based authentication methods replace static passwords
* Improved customer experience – No need to enter a password or complete a sign-up form
* Browser-based and in-application support for more devices – Enables mobile, in-app, and digital wallet payment applications


