v1

latestOpenAPI 3.1.02026-07-24790394.6 KB
Forward Requests

Forward payment method

Forward payment method details to an approved 3rd party. This endpoint requires Rainforest approval.

post/v1/payment_methods/{payment_method_id}/forward

Path parameters

payment_method_idstring required

The unique payment method identifier.

Prefix is "mtd" in production and "sbx_mtd" in sandbox.

Headers

Rainforest-Api-Version'2024-10-16' | '2023-12-01'

Request body

urlstring

The 3rd party URL to forward the payment method details to. The platform must be approved to forward the request to the URL.

http_methodstring

The HTTP Method to use to forward the request to the 3rd party.

headersobject

HTTP Headers to include while forwarding the request to the 3rd party.

bodystring

The body template to use while forwarding the request to the 3rd party.

Example request

{
  "url": "https://api.rainforestpay.com/v1/payment_methods",
  "http_method": "POST",
  "headers": {
    "Authorization": "Bearer MY_API_KEY"
  },
  "body": "{\"card_number\": \"{{ .card_number }}\"}"
}

Response

OK

status'SUCCESS' | 'ERROR'

Status of the request.

If the request status code is 2XX, then the status will be SUCCESS. If the request status code is 4XX or 5XX, then the status will be ERROR.

Example response

{
  "status": "SUCCESS",
  "data": {
    "forward_request_id": "fwd_2uaPg40kFgzQOiAd9un9p3yUkpq",
    "payment_method_id": "mtd_2DrDRpyAdp5MPUJnrJmoZcMmtfF",
    "merchant_id": "mid_2DrDFJPutxE5AIbJSopAnqniEbr",
    "response_details": {
      "status_code": 200
    }
  }
}