Skip to main content

Overview

The Payment endpoints enable you to accept online and mobile payments, process refunds, and retrieve transaction information. Digitzs supports card payments, ACH transfers, and split payments for marketplace applications.
All payment amounts must be specified in cents (smallest currency unit). For example, $10.00 = 1000 cents.

Payment Types

Card Payments

Accept credit and debit card payments with instant authorization

ACH Payments

Process bank transfers via the Automated Clearing House network

Split Payments

Automatically distribute funds between merchants and your platform

Available Endpoints

Create and Process

Split Payments

Refunds and Voids

Retrieve Information

Quick Start

Process a Card Payment

curl -X POST https://api.digitzs.com/payments \
  -H "Authorization: Bearer your-app-token" \
  -H "x-api-key: your-api-key" \
  -H "appId: your-app-id" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "type": "payments",
      "attributes": {
        "paymentType": "card",
        "merchantId": "merchant-123",
        "paymentMethod": {
          "token": "payment-method-token"
        },
        "transaction": {
          "amount": "1000",
          "currency": "USD",
          "invoice": "INV-001"
        }
      }
    }
  }'

Process an ACH Payment

curl -X POST https://api.digitzs.com/payments \
  -H "Authorization: Bearer your-app-token" \
  -H "x-api-key: your-api-key" \
  -H "appId: your-app-id" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "type": "payments",
      "attributes": {
        "paymentType": "ACH",
        "merchantId": "merchant-123",
        "StandardEntryClassCode": "WEB",
        "bank": {
          "bankName": "Wells Fargo",
          "accountType": "checking",
          "accountName": "John Doe",
          "accountNumber": "1234567",
          "routingNumber": "026009593"
        },
        "transaction": {
          "amount": "1000",
          "currency": "USD",
          "invoice": "INV-001"
        }
      }
    }
  }'

Payment Flow

Common Use Cases

Process a one-time payment from a customer to a merchant using a card or ACH.Best for: E-commerce checkouts, subscription billing, invoices
Distribute payment between merchant and platform fee automatically.Best for: Marketplaces, platforms, booking servicesExample: 100sale=100 sale = 90 to merchant + $10 platform fee
Split payment among multiple recipients (merchant, platform, referral partner).Best for: Multi-vendor platforms, affiliate programsExample: 100sale=100 sale = 85 merchant + 10platform+10 platform + 5 affiliate
Return funds to customer for canceled orders or disputes.Void: Cancel payment before settlement Refund: Return funds after settlement

Payment Method Tokens

For security, card details should be tokenized before sending to the API. Digitzs provides a secure tokenization service:
Use the Digitzs payment form or tokenization SDK to securely collect and tokenize payment methods on the client side.

Transaction States

StateDescription
pendingPayment initiated but not yet processed
authorizedPayment authorized but not captured
completedPayment successfully processed
failedPayment failed to process
refundedPayment refunded to customer
voidedPayment canceled before settlement

Testing

Test Card Numbers

Card NumberResult
4111111111111111Successful charge
4000000000000002Card declined
4000000000009995Insufficient funds
4000000000000069Expired card

Test ACH Accounts

Use any valid routing number with these account numbers:
Account NumberResult
1234567Successful payment
9876543Insufficient funds

Best Practices

Idempotency

Use requestId (UUID v4) to prevent duplicate charges

Error Handling

Always check response codes and handle errors gracefully

Amount Validation

Validate amounts on client side before submitting

Status Checks

Verify payment status before fulfilling orders

Security Considerations

Never store raw card data. Always use tokenized payment methods and comply with PCI DSS requirements.
  • Use HTTPS for all API requests
  • Tokenize payment methods on the client side
  • Implement fraud detection and velocity checks
  • Log all payment transactions for audit trails
  • Monitor for suspicious activity patterns

Next Steps

1

Set Up Merchant Account

Create a merchant account to receive payments
2

Integrate Payment Form

Add payment collection to your application
3

Test Payments

Use test cards to verify your integration
4

Go Live

Switch to production credentials and start processing real payments

Additional Resources