Store payment methods via API

Integrate with Rainforest's PCI endpoints to send card and bank account data via API to store payment methods

❗️

This feature requires Rainforest approval

Platforms that meet all requirements and are approved by Rainforest can send the full card and bank account numbers to Rainforest via a server-to-serve direct API integration.

Follow these steps to save a payment method with Rainforest through an API direct integration.

Create a payment method config


Create a payment method config to set up a payment method with information such as billing details and metadata before collecting the sensitive payment details (i.e the card number). See this guide for additional information.

Create a payment method


Create a payment method via the create payment method endpoint with a valid request payload.

EnvironmentEndpoint
SandboxPOST https://api.sandbox.rainforestpay.com/v1/payment_methods
ProductionPOST https://api.rainforestpay.com/v1/payment_methods

Request payload

Field

Description

Type

Required

payment_method_config_id

The unique payment method config identifier. A payment method must be configured prior to this request. See "Create a Payment Method Config" if a payment method configuration has not been created yet.

Prefix is "pmc" in production and "sbx_pmc" in sandbox.

String

method_type

The type of payment method.

Enum values: CARD, ACH

String

card

Card payment method. Required for method_type CARD.

Card object

ach

ACH payment method details. Required for method_type ACH.

ACH object

billing_contact

Billing contact details.

Available fields match the billing_contact object in the create payment method config request.

Billing contact object

Card

Field

Description

Type

Required

card_number

The card number, formatted with no spaces (e.g 0000000000000000).

String

exp_month

The card expiration month.

Integer between 1 and 12.

Integer

exp_year

The card expiration year, in 4-digits.

Integer between current year and 2099.

Integer

cvc

The card cvc.

The CVC will only be available for 5 minutes for payment processing.

String

ACH

Field

Description

Type

Required

account_number

The bank account number.

String

routing_number

The 9 digit routing number.

String

account_type

The account type. Defaulted to CHECKING if omitted.

Enum values: CHECKING, SAVINGS

String

account_holder_type

The account holder type. Defaulted to PERSONAL if omitted.

Enum values: PERSONAL, BUSINESS

String

Save the data

The response to POST /v1/payment_methods endpoint will return the same response payload as get payment method for all the payment method details.

Payment method webhooks can be configured for additional information.