Payment Methods

Learn how to securely manage payment methods in the Stax Core Data API, including creating, retrieving, updating, and deleting payment methods for seamless customer transactions.

Use the Stax Core Data API to create, retrieve, update, and delete your customers' saved payment methods (credit cards, debit cards, and bank accounts).

This API reference overview is for developers integrating saved payment methods into an application. Stax stores payment methods using tokenization (replacing sensitive payment data with a unique identifier you can use for subsequent API requests).

Choose Your Integration Approach

Security First

Tokenization replaces sensitive payment data with unique identifiers to help protect customer information and support your Payment Card Industry Data Security Standard (PCI DSS) compliance efforts. It does not establish compliance on its own; consult your security and compliance teams about the requirements for your integration.

Flexible Integration

Prefer Stax.js for client-side card tokenization to avoid sending raw card information through your server. Server-side API calls are also available; review the PCI DSS requirements for handling raw card information with your security and compliance teams before choosing that approach.

Core Operations

Creating Payment Methods

Payment methods can be created by tokenizing sensitive payment information using client-side libraries like Stax.js or server-side API calls.

Important: Meeting the PCI DSS requirements applicable to your integration is required. We recommend client-side tokenization with Stax.js to support your compliance efforts; this recommendation does not replace those requirements.

Update Payment Method

Modify details of an existing payment method, such as updating the expiration date or metadata without re-tokenizing.

Delete Payment Method

Soft-delete a payment method, making it inaccessible for future transactions. The payment method is marked as deleted but not permanently removed.

Import Credit Cards

Need to import tokenized credit cards from your current processor? Contact your Account Manager or Partner Success Manager for assistance.

Optional: Extend Your Integration

Card Information Details

When retrieving payment method information for cards, you get access to additional metadata:

Card Type Detection

  • Debit or Credit Indicator: The bin_type parameter indicates if the card is "DEBIT" or "CREDIT"
  • Prepaid Card Check: The meta.prepaid boolean indicates if the card is a prepaid debit or gift card

Available Information

  • Card brand (Visa, Mastercard, etc.)
  • Last four digits
  • Expiration date
  • Additional metadata and security indicators
Third-Party Integration

Share a Payment Method with a Third Party

Enable merchants to copy an existing Stax payment method to an external gateway without re-entering card details. This is useful when integrating with third-party services that require access to the payment method.

Important Note: Requires a gateway_token. Contact your Partner Success representative for details.

Surcharge Calculation

Review a Transaction's Surcharge Information

Calculate a surcharge (an additional fee for using a payment method) from a payment_method_id and transaction amount. Use the payment method's id returned when you create or retrieve it, rather than a customer ID or card number. Use the result to inform customers of additional fees before processing their payment.

Key Details:

  • Surcharge Calculation: Only applicable to credit cards and when the merchant has surcharging enabled
  • Surcharge Details: Provides the surcharge rate and amount for transparency
  • Customer Communication: Use this information to inform customers of additional fees before processing

Best Practices

Security

Prefer client-side tokenization with Stax.js for credit card information to support your PCI DSS compliance efforts. Confirm the requirements for your integration with your security and compliance teams; tokenization alone does not establish compliance.

Testing

Use the mock card and bank account data in Testing Workflows in your Sandbox. Verify successful tokenization creates a payment method, and test payment success and failure separately before using live data.

Management

Regularly review and manage stored payment methods to maintain data hygiene and customer experience.