Payment Methods
The Payment Methods API lets you discover which payment gateways and methods are available for a given transaction. Instead of hardcoding payment options, you call this API to get the current list of active gateways — filtered by currency, plugin, tokenization support, or customer. The response includes each gateway's supported operations (refunds, voids, captures), wallet integrations (Apple Pay, Google Pay), currencies, and tokenization capabilities. This ensures your checkout always shows up-to-date payment options, even when gateway configurations change.
Ottu offers SDKs and tools to speed up your integration. See Getting Started for all available options. For environment setup (plugins, gateway codes, sandbox vs production), see Configure Your Environment.
When to Use
- Before creating a payment session — discover available
pg_codesto pass to the Checkout API. - Currency-specific payments — filter by
currencies=["USD"] to show only gateways that support a specific currency. - Recurring payments — filter with
tokenizable=trueto find gateways that support tokenization for saved cards and auto-debit. - Customized checkout — tailor payment options per customer based on their history or preferences.
- Dynamic updates — when gateway settings or MID configurations change in the dashboard, the API automatically reflects the updates. No code changes needed.
Guide
The Payment Methods API is a foundation for other Ottu APIs. It returns detailed information about each available payment method — supported operations, wallet integrations, currencies, and tokenization capabilities — giving you the data needed to create payment sessions with the right gateways.
Workflow
- Merchant calls the Payment Methods API with filters (
customer_id,currency,plugin,tokenizable, etc.). - Ottu returns available
pg_codes— the active gateways matching the filters. - Merchant passes
pg_codesto the Checkout API to create a payment session with the right gateways. - Customer sees current payment options — only active, relevant methods. No manual updates needed.
Step-by-Step
-
Call the Payment Methods API — retrieve available payment methods based on your filters.
POST: https://beta.ottu.net/b/pbl/v2/payment-methods/
{
"plugin": "e_commerce",
"operation": "purchase",
"tokenizable": "true",
"currencies": ["USD"]
}This returns
"pg_codes": ["kpay"], which can then be used in subsequent API calls. -
Pass the results to the Checkout API — use the returned
pg_codeswhen creating a payment session. For example, if the API returns"pg_codes": ["PG001"], include that code in your Checkout API call. -
Customer sees current payment options — the checkout page displays only the active, relevant payment methods. When gateway configurations change, the API automatically reflects the updates — no code changes needed.
Use Cases
Expanding Payment Options
Scenario: A merchant wants to offer a broad range of payment options for e-commerce customers.
- Call the Payment Methods API to retrieve all available payment methods.
- Use the
pluginfilter to get onlye_commercepayment methods. - Customers see a broader range of options at checkout, increasing successful transactions.
Dynamic Payment Updates
Scenario: The merchant's gateway settings or MID configuration has changed, and they want updates reflected automatically.
Once integrated with the Payment Methods API, any change in gateway settings or MID configuration is auto-reflected. Merchants don't have to initiate manual updates — the API handles seamless integration.
Subscription Payments with Tokenization Filter
Scenario: An online subscription service wants to offer automatic recurring payments.
- Call the Payment Methods API with
tokenizable=trueto get only gateways that support tokenization. - Integrate these gateways into the checkout process.
- Customers choosing a subscription see only payment methods that support tokenization. The selected method is set to automatically debit at specified intervals.
Managing Subsequent Charges with Tokenized Cards
Scenario: An e-commerce platform wants to charge only cards that are tokenization-enabled by the customer.
- Call the Payment Methods API to retrieve tokenization-supported
pg_codes. - Pass these
pg_codesto the User Cards API. It returns only saved cards that have tokenization enabled. - For subsequent transactions, the system only charges approved, tokenization-enabled cards.
API Reference
Retrieve a list of payment methods based on filter values.
Best Practices
Caching API Call Responses
Given the infrequent changes in values — primarily when new MIDs are issued — it's prudent to cache the API call response. This minimizes unnecessary and redundant calls to the API.
- Cache the API call response for an extended period, ranging from 24 hours to 1 week.
Individual Caching for Filters
Always cache responses based on the specific filters you apply during API calls. If you're employing the API with diverse filters based on various scenarios, cache each response separately.
If you cache all responses under a single key regardless of filters, you risk retrieving incorrect or irrelevant data, leading to inaccurate payment processing or transaction failures.
On-Demand Cache Clear Mechanism
Implement a mechanism to clear the cache on demand. When a MID change is made in the Ottu admin panel, trigger a cache clear to force-update with the latest data.
FAQ
What's Next?
- Checkout API — Create payment sessions using the discovered payment methods
- Native Payments — Direct Apple Pay and Google Pay payments
- Checkout SDK — Drop-in UI that automatically uses available payment methods