For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
RegisterLoginSandbox Login
GuidesRecipesAPI Reference
GuidesRecipesAPI Reference
  • API Reference
    • POSTGets USDC/SBC/EuroE on testnets
      • PATCHCustomer Cancel Subscription
      • GETGet Available Plans
      • GETGet Customer Subscriptions
      • GETGet Plan
      • POSTPurchase Subscription by ACH
      • POSTPurchase Subscription with Existing Card
      • POSTPurchase Subscription with New Card
LogoLogo
RegisterLoginSandbox Login
API ReferenceSubscription

Purchase Subscription with Existing Card

POST
https://api-sandbox.coinflow.cash/api/subscription/:merchantId/subscribers/token
POST
/api/subscription/:merchantId/subscribers/token
$curl -X POST https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token \
> -H "x-coinflow-auth-session-key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "planCode": "premium_monthly_2024",
> "token": "tok_1Hh1X2Lz0aBcDeFgHiJkLmNo"
>}'
1"sub_9f8e7d6c5b4a3210"
Purchase a subscription with an existing credit card
Was this page helpful?
Previous

Purchase Subscription with New Card

Next
Built with

Authentication

x-coinflow-auth-session-keystring
The session key generated for the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key
OR
x-coinflow-auth-walletstring
The web3 wallet of the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key
x-coinflow-auth-blockchainstring
The blockchain associated with the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

Path parameters

merchantIdstringRequired

Headers

x-device-idstringOptional
- (Optional) If you are using Coinflow Chargeback Protection, you must pass the device id of the customer's device.

Request

This endpoint expects an object.
planCodestringRequired
The code of the plan to use for the subscription
tokenstringRequired
Token for the card to be used for the subscription
customerInfoobjectOptional
webhookInfoobjectOptional
chargebackProtectionDatalist of objectsOptional
Cart item details required for Coinflow Chargeback Protection. Required if the merchant uses chargeback protection.
feePercentagedoubleOptional0-100

If this purchase is for a seller/submerchant where the marketplace takes a fee, this is the % fee which is taken from the subtotal amount.

fixedFeeobjectOptional
authentication3DSobjectOptional

3DS Card Authorization Data

On initial payment submission - Device3DSInfo needed: 3DS device information - required if 3DS is enabled

After card challenge complete: 3DS challenge transaction id - required after prompted for challenge

threeDsChallengePreferenceenumOptional
Allowed values:
accountFundingTransactionobjectOptional
Used for Account Funding Transactions
addressobjectOptional
The address field is not needed here unless explicitly given instructions to do so.

Response

Ok

Errors

422
Unprocessable Entity Error

The session key generated for the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

The web3 wallet of the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

The blockchain associated with the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

  • (Optional) If you are using Coinflow Chargeback Protection, you must pass the device id of the customer’s device.