Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ecrypt.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Once a customer has a payment method saved to their wallet, you can charge them through the standard transaction endpoints using the payment.stored object. You can charge either the customer’s default payment method or a specific wallet entry.

Charge the Default Payment Method

To charge a customer’s default payment method, pass the customer id in payment.stored.customer. ECRYPT will automatically use whichever wallet entry is marked as default.
POST /v1/transactions/sale
{
  "payment": {
    "stored": {
      "customer": "00000000-0000-0000-0000-000000000000",
      "initiated_by": "MERCHANT"
    }
  },
  "amount": {
    "value": 99.00,
    "currency": "USD"
  }
}

Charge a Specific Wallet Payment Method

To charge a specific payment method, pass the wallet entry id in payment.stored.wallet instead. This is useful when a customer has multiple payment methods on file and you need to target a specific one.
POST /v1/transactions/sale
{
  "payment": {
    "stored": {
      "wallet": "00000000-0000-0000-0000-000000000000",
      "initiated_by": "MERCHANT"
    }
  },
  "amount": {
    "value": 99.00,
    "currency": "USD"
  }
}

initiatedBy

The initiatedBy field indicates who initiated the transaction. This is required for stored payment method transactions and affects how the transaction is processed at the network level.
ValueMeaningDescription
0MerchantThe merchant initiated the transaction. Used for recurring payments, installments, and agent-assisted charges.
1CustomerThe customer initiated the transaction. Used when the customer selects a stored card during checkout.

Authorize and Capture

If you need to place a hold before capturing, use the authorize endpoint instead of sale. The same payment.stored object applies.
POST /v1/transactions/authorize
Once ready to capture:
POST /v1/transactions/capture
{
  "transaction_id": "123456789",
  "amount": 99.00
}

Transaction Response

A successful charge returns a transaction ID, approval code, and the amount processed.
{
  "transaction_id": "123456789",
  "auth_code": "TAS123",
  "response_code": "APPROVED",
  "response_text": "APPROVED",
  "amount": 99.00,
  "request_id": "000000000000000000000"
}
Store the transactionId from every charge. It is required for voids, refunds, and captures.

Recurring Payments

Customer wallets are also the foundation for automated recurring billing. ECRYPT supports two models — subscriptions for ongoing recurring charges, and installment plans for splitting a fixed amount into scheduled payments.

Subscriptions

Automatically charge a customer’s wallet on a recurring schedule — daily, weekly, monthly, and more.

Installment Plans

Split a total amount into a defined number of scheduled charges against a customer’s wallet.