# Use eChecks

eChecks (electronic checks) are a secure, efficient, and cost-effective digital payment method that allows merchants to process payments directly from a customer's bank account. Using the Automated Clearing House (ACH) network, eChecks streamline transactions by replacing traditional paper checks with electronic processing.

This method is ideal for recurring payments, large transactions, or industries where ACH payments are commonly used.

## Supported currencies

eChecks support only USD transactions.

## Workflow

1. Collect the following information from your customers:
   * Account holder name
   * Bank Routing number
   * Account number
   * Account type
     * Use value "S" for SAVINGS accounts and "C" for CHECKING accounts in API
2. Create the order object. Use **DIRECT\_DEBIT\_ACH** as the type in the `PaymentDetails` object and pass the collected information through the `PaymentMethod` object.
3. Place the order.

## Request parameters

<table><thead><tr><th width="114.800048828125">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect. The <code>sessionID</code> expires in 10 minutes.</td></tr><tr><td><a href="/pages/ntYqWA3pWPLrpvzTn87M"><code>Order</code></a></td><td><strong>Required (object)</strong><br>Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details. See code sample for more details.</td></tr></tbody></table>

### Request sample

```php
<?php
declare(strict_types=1);
class Configuration
{
    public const MERCHANT_CODE = 'MERCHANT';
    public const MERCHANT_KEY = 'SECRET_KEY';
    public const URL = 'https://api.2checkout.com/soap/6.0';
    public const ACTION = 'placeOrder';

    public const PAYLOAD =  <<<JSON
{
    "Currency": "USD",
    "Language": "EN",
    "Country": "us",
    "CustomerIP": "91.220.121.21",
    "Source": "sourceAPI.net",
    "LocalTime": "2022-01-13 09:41:59",
    "CustomerReference": 421820775,
    "Items": [\
        {\
            "Code": "TA-TuneUp-M-RENEW"\
        }\
    ],
    "BillingDetails": {
        "Address1": "Test Address",
        "City": "LA",
        "State": "California",
        "CountryCode": "US",
        "Email": "testcustomer@2Checkout.com",
        "FirstName": "Customer",
        "LastName": "2Checkout",
        "Zip": "12345"
      },
    "PaymentDetails": {
        "Type": "DIRECT_DEBIT_ACH",
        "Currency": "USD",
        "CustomerIP": "91.220.121.21",
        "PaymentMethod": {
            "AccountHolderName": "John Doe",
            "BankRoutingNumber": "222371863",
            "AccountNumber": "999999999",
            "AccountType": "S",
            "RecurringEnabled": true
        }
    }
}
JSON;

}
class Client
{
    public function call(
        string $url = Configuration::URL,
        $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?object {
        if (is_array($payload)) {
            $payload = json_encode($payload);
        }
        if (!empty($payload)) {
            // SoapClient works with objects(StdClass)
            $payload = json_decode($payload);
        }
        $soapClient = $this->getClient($url);
        $sessionId = $this->getSession($soapClient);
        $args = array_filter([$sessionId, $payload]);
        return $soapClient->$action(...$args);
    }

    public function getClient(string $url): SoapClient
    {
        return new SoapClient(
            $url.'?wsdl',
            [\
                'location' => $url,\
                'cache_wsdl' => WSDL_CACHE_NONE,\
            ]
        );
    }

    public function getSession(SoapClient $client)
    {
        $date = gmdate('Y-m-d H:i:s');
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $string = strlen($merchantCode).$merchantCode.strlen($date).$date;
        $algo = 'sha256';
        $hash = hash_hmac($algo, $string, $key);
        $client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
        return $client->login($merchantCode, $date, $hash, $algo);
    }
}
try {
    $client = new Client();
    var_dump($client->call());
} catch (Exception $ex) {
    var_dump($ex);
}
```

## Response parameters

<table><thead><tr><th width="177.7333984375">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><a href="/pages/010708cd78f3efa4929d4374cb2abe08c3d2b686"><code>Order information</code></a></td><td><strong>Object</strong><br>Object containing order information.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/place-orders-with-catalog-products/use-echecks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
