Creating an eCheck Token and Processing an eCheck Transaction Using the REST API
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:
- Create the message with the required API fields.
- Send the message to one of these endpoints:
- Production:POSThttps://api.cybersource.com/pts/v2/payments
- Test:POSThttps://apitest.cybersource.com/pts/v2/payments
- Verify the response messages to make sure that the request was successful. A 200-level HTTP response code indicates success.
Required Fields for Creating an eCheck Token and Processing an eCheck Transaction
- clientReferenceInformation.code
- Order reference or tracking number.
- orderInformation.amountDetails.currency
- Set the value toUSD.
- orderInformation.amountDetails.totalAmount
- Grand total for the order. This value cannot be negative. You can include a decimal point (.), but no other special characters.Cybersourcetruncates the amount to the correct number of decimal places.
- This field is required if line itemsare not presentin the downstream service.
- IMPORTANTIf line itemsare presentin the downstream service, this value (if present) takes precedence over the sum of the line items.
- orderInformation.billTo.address1
- orderInformation.billTo.administrativeArea
- Set the value to a valid USPS two-letter state or possession abbreviation.
- orderInformation.billTo.country
- Set the value toUS.
- orderInformation.billTo.email
- orderInformation.billTo.firstName
- orderInformation.billTo.lastName
- orderInformation.billTo.locality
- orderInformation.billTo.phoneNumber
- orderInformation.billTo.postalCode
- paymentInformation.bank.account.number
- paymentInformation.bank.account.type
- paymentInformation.bank.routingNumber
- paymentInformation.paymentType.name
- Set the value tocheck.
- processingInformation.actionList
- Set the value toTOKEN_CREATE.
- processingInformation.actionTokenTypes
- Indicates the type ofToken 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
- clientReferenceInformation.applicationName
- clientReferenceInformation.applicationUser
- clientReferenceInformation.applicationVersion
- orderInformation.billTo.address2
- orderInformation.billTo.company.name
- processingInformation.bankTransferOptions.secCode
- 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
- 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 onVisa Platform Connectwith 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
Request
123456789101112131415161718192021222324252627282930313233343536373839404142{ "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
1234567891011121314151617181920212223242526272829{ "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" } } }