Endpoint
Overview
Use this endpoint to process payments using TokenEx tokens generated from the Digitzs embedded checkout. This secure method keeps sensitive payment data out of your application while maintaining PCI compliance.A TokenEx token must be generated through the Digitzs embedded checkout before using this endpoint. Contact Digitzs support to integrate the embedded checkout into your application.
Authentication
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key from onboarding | Yes |
Authorization | Bearer {appToken} | Yes |
appId | Your application ID | Yes |
Content-Type | application/json | Yes |
Request Body
Container for API data
UUID for idempotency. If provided, must be in valid UUID format. Recommended for preventing duplicate transactions.
Must be
"payments"Container for payment attributes
Must be
"tokenv3" for tokenized paymentsThe merchant account identifier
Optional JSON string containing additional metadata like email, IP addresses, or custom data
Tokenized payment method information
Transaction details
Billing address information
Example Request
Response
Success Response (201 Created)
Contains URLs related to the resource
Container for response data
Example Response
Code Examples
AVS Result Codes
TheavsResult field contains Address Verification System codes:
| Code | Description |
|---|---|
| Y | Street address and ZIP code match |
| A | Street address matches, ZIP code does not |
| Z | ZIP code matches, street address does not |
| N | Neither street address nor ZIP code match |
| U | Address information unavailable |
| R | Retry - System unavailable |
| S | Service not supported |
| T | AVS not supported for this card type |
Error Responses
Common Error Scenarios
Invalid or expired token
Invalid or expired token
Error: 400 Bad RequestSolution: Ensure the tokenId is valid and was recently generated from the embedded checkout. Tokens may have a limited lifespan.
AVS verification failure
AVS verification failure
Error: 422 Unprocessable EntitySolution: When
useAVS is true, ensure the billing address ZIP code matches the card’s billing ZIP. You can disable AVS by setting useAVS to false, but this may increase fraud risk.Card declined
Card declined
Error: 402 Payment RequiredSolution: The card issuer declined the transaction. Common reasons include insufficient funds, expired card, or fraud prevention. Ask the customer to contact their bank or use a different payment method.
Invalid expiry format
Invalid expiry format
Error: 400 Bad RequestSolution: Ensure expiry is in MMYY format (4 digits, no separators). Example: “0229” for February 2029.
Important Notes
Token Security: Tokens should only be used once. Do not reuse tokens across multiple payment attempts.
AVS Recommendations: Enabling AVS (
useAVS: true) provides additional fraud protection but may decline legitimate transactions if address information doesn’t match. Consider your risk tolerance when configuring this setting.Embedded Checkout Required: Contact Digitzs support to integrate the embedded checkout into your application before using this endpoint. The checkout handles secure card data collection and tokenization.
Best Practices
- Use Idempotency Keys: Include
requestIdto prevent duplicate charges if requests are retried - Collect Complete Addresses: Provide full billing address information for better AVS verification
- Handle Declines Gracefully: Display user-friendly error messages and offer alternative payment methods
- Store Payment IDs: Save the returned payment ID for reconciliation and potential refunds
- Implement Retry Logic: Handle transient errors with exponential backoff
- Monitor AVS Results: Track AVS result codes to identify potential fraud patterns
Understanding Transaction Fees
The response includes detailed fee breakdown:- gross: Total amount charged to the customer
- fee: Fixed transaction fee (typically $0.30)
- rate: Percentage fee (typically 2.9%)
- grossMinusNet: Total fees charged (fee + percentage of gross)
- net: Amount deposited to merchant account (gross - grossMinusNet)
Next Steps
Get Payment Details
Retrieve full details of a completed payment
Create Split Payment
Learn how to split payment proceeds across multiple accounts

