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

FieldDescriptionTypeRequired
payment_method_config_idThe 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_typeThe type of payment method.

Enum values: CARD, ACH
String
cardCard payment method. Required for method_type CARD.Card object
achACH payment method details. Required for method_type ACH.ACH object
billing_contactBilling contact details.

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

Card

FieldDescriptionTypeRequired
card_numberThe card number, formatted with no spaces (e.g 0000000000000000).String
exp_monthThe card expiration month.

Integer between 1 and 12.
Integer
exp_yearThe card expiration year, in 4-digits.

Integer between current year and 2099.
Integer
cvcThe card cvc.

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

ACH

FieldDescriptionTypeRequired
account_numberThe bank account number.String
routing_numberThe 9 digit routing number.String
account_typeThe account type. Defaulted to CHECKING if omitted.

Enum values: CHECKING, SAVINGS
String
account_holder_typeThe 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.