The Basics
The ProcessTransaction API is the recommended way to process payments through Payment Services. It provides access to a wide range of payment gateways with a normalized response format, making it easier to handle transactions consistently across different processors.
Overview
The ProcessTransaction API offers several advantages for payment processing:
- Gateway flexibility — Switch or add payment processors without changing your integration
- Normalized responses — Receive consistent response structures with pre-parsed AVS and CVV results
- Token portability — Use the same tokens across any supported gateway
- Flexible tokenization — Use existing tokens or tokenize new cards during the transaction
- CVV injection — Include previously collected CVV values without storing them yourself
For most integrations, the ProcessTransaction API provides the best balance of gateway coverage, ease of integration, and response consistency. Choose the Card/Check/Wallet API only if you need access to complete, raw gateway responses.
How It Works
When you send a transaction request, Payment Services:
- Receives your request with the TokenEx token and gateway-specific parameters
- Detokenizes the token to retrieve the original PAN
- Formats the request according to your gateway’s requirements
- Sends the transaction to the payment processor
- Parses the response and returns a normalized result with AVS/CVV details
Endpoints
If you’re using TokenEx iFrame or mobile SDK, cards are typically tokenized during collection—use ProcessTransaction. If you’re receiving PANs directly (from a migration or encrypted source), use ProcessTransactionAndTokenize to tokenize and transact in one call.
Authentication
Both endpoints use request body authentication. Include your credentials in every request:
Never expose your APIKey in client-side code. All Payment Services requests should originate from your server.
Transaction Types
Specify the type of transaction using the TransactionType parameter:
Use Authorize (1) followed by Capture (2) when there’s a delay between order placement and fulfillment—this is common for physical goods. Use Purchase (3) for immediate transactions like digital downloads or in-person sales.
Request Structure
Both endpoints use the same request format. The TransactionRequest object contains nested objects for gateway credentials, card data, and transaction details.
Request Parameters:
Additional parameters for ProcessTransactionAndTokenize:
Use ProcessTransaction when credit_card.number contains a TokenEx token. Use ProcessTransactionAndTokenize when it contains a PAN (or encrypted PAN) that needs tokenization.
The exact fields within each nested object vary by gateway. See Gateway Parameters for the specific structure required by your payment processor.
Response Structure
Both endpoints return the same response structure:
Response Parameters:
Understanding Success vs TransactionResult
The response contains two boolean fields that indicate different things:
Common scenarios:
When TransactionResult is true, save the Authorization value. You’ll need it for any follow-up transactions like captures, voids, or refunds.
CVV Injection
If you collected the CVV separately using TokenEx (for example, through the iFrame with CVV-only collection), you can inject it into the transaction without handling the value directly.
To use CVV injection, set the verification_value field to the literal string "cvv":
Payment Services will replace "cvv" with the actual CVV value associated with the token before sending to the gateway.
CVV values are stored temporarily and associated with the token during collection. Check with TokenEx support for CVV retention policies in your configuration.
Common Transaction Flows
Authorize Then Capture
For orders where fulfillment is delayed (e.g., physical goods):
Step 1: Authorize
Step 2: Capture (when ready to ship)
Purchase with New Card
For immediate transactions with a new card (tokenize and purchase together):
The response includes both the transaction result and a Token for future use.
Refund a Transaction
To return funds after settlement:
Testing
Use your gateway’s test/sandbox environment during development:
- Configure your Payment Services request for the test environment
- Use test card numbers and any specific values provided by your gateway
When processing test transactions, the response will include "Test": true. Always verify this field is false before going live.
Next Steps
- Gateway Parameters — Find the specific parameters required for your payment processor
- Token Schemes — Learn about available token formats for ProcessTransactionAndTokenize
- API Authentication — Detailed authentication documentation
- Card/Check/Wallet API — Alternative API for raw gateway responses