On This Page

{#jumplink-list}  
[Markdown](/docs/cybs/en-us/echeck/user/all/rest/echeck-user-guide/echeck-api-intro/echeck-api-cre-token-with-txn.md)  
Filter  
FILTER BY TAG

Creating an eCheck Token and Processing an eCheck Transaction Using the REST API {#echeck-api-cre-token-with-txn}
=================================================================================================================

This section shows how to create an eCheck transaction along with an eCheck transaction using the REST API.

> IMPORTANT The token can also be used for future eCheck transactions for this customer.

Creating an eCheck Token and Processing an eCheck Transaction
-------------------------------------------------------------

Follow these steps to create an eCheck token for your customer and process an eCheck transaction at the same time:

1. Create the message with the required API fields.
2. Send the message to one of these endpoints:
   * Production: `POST ``https://api.cybersource.com``/pts/v2/payments`
   * Test: `POST ``https://apitest.cybersource.com``/pts/v2/payments`
3. Verify the response messages to make sure that the request was successful. A 200-level HTTP response code indicates success. See [Transaction Response Codes](https://developer.cybersource.com/api/reference/response-codes.md "").

Required Fields for Creating an eCheck Token and Processing an eCheck Transaction {#echeck-api-cre-token-with-txn-req-fields}
=============================================================================================================================

[clientReferenceInformation.code](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-code.md "")
:
Order reference or tracking number.

[orderInformation.amountDetails.currency](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-currency.md "")
:
Set the value to `USD`.

[orderInformation.amountDetails.totalAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-total-amount.md "")
:
Grand total for the order. This value cannot be negative. You can include a decimal point (.), but no other special characters. `Cybersource` truncates the amount to the correct number of decimal places.
:
This field is required if line items *are not present* in the downstream service.
:
> IMPORTANT
> If line items *are present* in the downstream service, this value (if present) takes precedence over the sum of the line items.

[orderInformation.billTo.address1](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-address1.md "")
:

[orderInformation.billTo.administrativeArea](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-admin-area.md "")
:
Set the value to a valid USPS two-letter state or possession abbreviation.

[orderInformation.billTo.country](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-country.md "")
:
Set the value to `US`.

[orderInformation.billTo.email](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-email.md "")
:

[orderInformation.billTo.firstName](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-first-name.md "")
:

[orderInformation.billTo.lastName](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-last-name.md "")
:

[orderInformation.billTo.locality](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-locality.md "")
:

[orderInformation.billTo.phoneNumber](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-phone-num.md "")
:

[orderInformation.billTo.postalCode](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-postal-code.md "")
:

[paymentInformation.bank.account.number](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-bank-account-num.md "")
:

[paymentInformation.bank.account.type](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-bank-account-type.md "")
:

[paymentInformation.bank.routingNumber](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-bank-routing-number.md "")
:

[paymentInformation.paymentType.name](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-payment-type-name.md "")
:
Set the value to `check`.

[processingInformation.actionList](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-action-list.md "")
:
Set the value to `TOKEN_CREATE`.

[processingInformation.actionTokenTypes](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-action-token-types.md "")
:
Indicates the type of `Token Management Service` (`TMS`) token to be created in the request. Possible values for this use case:

    * `customer`
    * `instrumentIdentifier`
    * `paymentInstrument`

Optional Fields for Creating an eCheck Token and Processing an eCheck Transaction {#echeck-api-cre-token-with-txn-opt-fields}
=============================================================================================================================

[clientReferenceInformation.applicationName](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-application-name.md "")
:

[clientReferenceInformation.applicationUser](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-application-user.md "")
:

[clientReferenceInformation.applicationVersion](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-application-version.md "")
:

[orderInformation.billTo.address2](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-address2.md "")
:

[orderInformation.billTo.company.name](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-company-name.md "")
:

[processingInformation.bankTransferOptions.secCode](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-bank-transfer-options-sec-code.md "")
:
Specifies the authorization method for the transaction. Possible values for this use case:

    * `CCD`: Corporate cash disbursement.
    * `PPD`: Prearranged payment and deposit entry.
    * `TEL`: Telephone-initiated entry.
    * `WEB`: Internet-initiated entry.

[processingInformation.commerceIndicator](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/processing-info-aa/processing-info-commerce-ind.md "")
:
Type of transaction. Possible values for this use case:

    * `internet` (default): Order placed from a website.
    * `moto`: Mail order or telephone order.
    * `recurring`: Recurring payment that is a US transaction or non-US mail order or telephone order (MOTO) transaction. For merchant-initiated transactions on `Visa Platform Connect` with Mastercard in India or with an India-issued card, the recurring value is used for the recurring payment scenario.

REST Example: Creating an eCheck Token and Processing an eCheck Transaction {#echeck-api-cre-token-with-txn-example}
====================================================================================================================

Request

```
{
    "paymentInformation": {
        "paymentType": {
            "name": "check"
        },
        "bank": {
            "routingNumber": "071923284",
            "account": {
                "number": "12345678901234567",
                "type": "C"
            }
        }
    },
    "clientReferenceInformation": {
        "code": "TC1-060"
    },
    "processingInformation": {
        "actionList": [
            "TOKEN_CREATE"
        ],
        "actionTokenTypes": [
            "customer"
        ]
    },
    "orderInformation": {
        "billTo": {
            "country": "US",
            "firstName": "John",
            "lastName": "Doe",
            "phoneNumber": "2053040804",
            "address1": "12th Ave",
            "postalCode": "98105",
            "locality": "Seattle",
            "administrativeArea": "WA",
            "email": "test@example.com"
        },
        "amountDetails": {
            "currency": "USD",
            "totalAmount": "10.20"
        }
    }
}
```

Response

```
{
    "id": "7271075033691234567890",
    "reconciliationId": "0TT46FR91BDT7Y6",
    "submitTimeUtc": "2024-09-23T16:05:04Z",
    "status": "PENDING",
    "clientReferenceInformation": {
        "code": "TC1-060"
    },
    "orderInformation": {
        "amountDetails": {
            "currency": "USD",
            "totalAmount": “10.20"
        }
    },
    "paymentInformation": {},
    "tokenInformation": {
        "instrumentIdentifierNew": “false”,
        "customer": {
            "id": "22CC4C8BCC82EE54E0634136CF0A86E8"
        },
        "instrumentIdentifier": {
            "id": "E8C05D69D9C53AB1E0534136CF0AF328",
            "state": "ACTIVE"
        },
        "paymentInstrument": {
            "id": "22CC4C8BCC8AEE54E0634136CF0A86E8"
        }
    }
}
```

RELATED TO THIS PAGE

