Powered by Coinflow
Payments · Documentation
Operational

Purchase Subscription with Existing Card

POST https://api-sandbox.coinflow.cash/api/subscription/{merchantId}/subscribers/token Content-Type: application/json

Purchase a subscription with an existing credit card

Reference: /api-reference/api-reference/subscription/create-subscription-token

Authentication

  • x-coinflow-auth-session-key header (required) — The session key generated for the end user - see /api-reference/api-reference/authentication/get-session-key
  • x-coinflow-auth-wallet header (required) — The web3 wallet of the end user - see /api-reference/api-reference/authentication/get-session-key
  • x-coinflow-auth-blockchain header (required) — The blockchain associated with the end user - see /api-reference/api-reference/authentication/get-session-key

Request

Path parameters

  • merchantId (string, required)

Headers

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

Body (application/json)

  • planCode (string, required) — The code of the plan to use for the subscription
  • token (string, required) — Token for the card to be used for the subscription
  • customerInfo (object or object, optional)
    • SplitNameCustomerInfo
      • firstName (string, required)
      • lastName (string, required)
      • verificationId (string, optional)
      • displayName (string, optional)
      • address (string, optional)
      • city (string, optional)
      • state (string, optional)
      • zip (string, optional)
      • country (string, optional)
      • ip (string, optional)
      • lat (string, optional)
      • lng (string, optional)
      • dob (string, optional) — Date of birth in YYYY-MM-DD format
      • email (string, optional)
    • NameCustomerInfo
      • verificationId (string, optional)
      • displayName (string, optional)
      • address (string, optional)
      • city (string, optional)
      • state (string, optional)
      • zip (string, optional)
      • country (string, optional)
      • ip (string, optional)
      • lat (string, optional)
      • lng (string, optional)
      • dob (string, optional) — Date of birth in YYYY-MM-DD format
      • email (string, optional)
      • name (string, optional)
  • webhookInfo (object, optional)
    • example (string, optional)
  • chargebackProtectionData (list of object or object or object or object or object or object or object or object, optional) — Cart item details required for Coinflow Chargeback Protection. Required if the merchant uses chargeback protection.
    • Pick_nftCartItem.Exclude_keyofnftCartItem.sellingPrice-or-itemClass__
      • productName (string, required) — The name of the related product
      • productType (enum, required)
        • Allowed values: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp, ownershipContract, inGameCurrency, digitalCollectibles, digitalCollectiblesMarketplace, digitalGiftingMarketplace, sweepstakes, virtualSportsEvents, contractInvoicing, onlineCasino, cryptoOnramp, gaming, travelDocuments, musicStreaming, digitalContent, eBooks, digitalSubscriptionContent
      • quantity (double, required) — The number of units sold
      • listPrice (object, optional) — The item’s list price
        • currency (string, optional)
        • valueInCurrency (double, optional)
      • rawProductData (object, optional)
        • example (string, optional)
      • seller (object, optional)
        • id (string, optional) — Id of the seller
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • lastName (string, optional) — Last name Example: Lois
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • rawSellerData (object, optional) — Construct a type with a set of properties K of type T
      • transactionHistory (list of object, optional)
        • txType (string, required)
        • chain (string, required)
        • paymentAmount (string, required)
        • paymentToken (string, required)
        • to (string, required)
        • from (string, required)
        • registryContract (string, required)
        • assetID (string, required)
        • txTime (string, required)
        • blockNumber (double, required)
        • txHash (string, required)
    • Pick_GiftCardCartItem.Exclude_keyofGiftCardCartItem.listPrice__
      • sellingPrice (object, required)
        • currency (string, required)
        • valueInCurrency (double, required)
      • itemClass (enum, required)
        • Allowed values: giftCard
      • productType (enum, required)
        • Allowed values: giftCard
      • quantity (double, required) — The number of units sold
      • id (string, required) — The cart items’s unique ID
      • itemFulfillment (enum, required) — How the product was fulfilled.
        • Allowed values: digital, physical
      • brand (string, optional) — The name of the brand
      • rawProductData (object, optional) — Construct a type with a set of properties K of type T
      • seller (object, optional)
        • id (string, optional) — Id of the seller
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • lastName (string, optional) — Last name Example: Lois
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • rawSellerData (object, optional) — Construct a type with a set of properties K of type T
      • sku (string, optional) — The stock-keeping unit (SKU) number
      • categories (list of string, optional) — The category in the site/app in which the item was classified (e.g., fashion)
      • isGift (boolean, optional)
      • recipientInfo (object, optional)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
      • expectedDeliveryDelay (double, optional) — The expected delay in delivery, in hours
      • isPresetAmount (boolean, optional) — Represents whether the item amount is taken from a preset list, e.g. 25, 50, 100, etc. or whether it was a different amount, e.g. 27
    • CryptoCartItem
      • itemClass (enum, required) — Denotes the cart item class. The item schema is chosen based on this value. Allowed value: crypto Example: crypto
        • Allowed values: crypto
      • units (string, required) — The amount in the crypto currency which is specified in the cryptoCurrency property Example: 1.04112 Pattern: ^[0-9]+(.[0-9]+)?$
      • cryptoCurrency (string, required) — The crypto-currency symbol (uppercase) Example: BTC Pattern: ^[A-Z0-9-]+$
      • unitPrice (object, required) — The price per 1 unit
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
      • recipientInfo (object, required)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
      • id (string, optional) — The cart items’s unique ID Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
      • rawProductData (object, optional)
        • example (string, optional)
      • expectedDeliveryDelay (double, optional) — The expected delay in delivery, in hours Min value: 0
      • seller (object, optional)
        • id (string, optional) — Id of the seller
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • lastName (string, optional) — Last name Example: Lois
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • rawSellerData (object, optional) — Construct a type with a set of properties K of type T
    • MoneyTopUpCartItem
      • itemClass (enum, required) — Denotes the cart item class. The item schema is chosen based on this value. Allowed value: moneyTopUp Example: moneyTopUp
        • Allowed values: moneyTopUp
      • sellingPrice (object, required) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • topUpAmount (object, required) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • quantity (double, required) — Quantity Example: 2
      • isPresetAmount (boolean, required) — Represents whether the item amount is taken from a preset list, e.g. 25, 50, 100, etc. or whether it was a different amount, e.g. 27
      • id (string, optional) — The cart items’s unique ID Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
      • rawProductData (object, optional) — Construct a type with a set of properties K of type T
      • recipientInfo (object, optional)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
    • TravelCartItem
      • itemClass (enum, required) — Denotes the cart item class. The item schema is chosen based on this value. Allowed value: travel Example: travel
        • Allowed values: travel
      • sellingPrice (object, required) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • lodging (object, required) — The lodging details of the travel booking
        • reservationId (string, required) — Hotel reservation id Example: X36Q9C
        • nights (double, required) — The number of nights booked in the reservation Min value: 1 Example: 2
        • checkInDate (string, required) — The check-in date Example: 2022-05-02
        • checkInHour (string, required) — The hour of day in which the check-in is done Example: 18 Pattern: ^([01][0-9]|2[0-3])$
        • hotel (object, required) — The booked hotel details
          • name (string, required) — The name of the hotel Example: The Plaza Hotel
          • country (string, required) — The two-letter code of the country in which the hotel is located Example: US Pattern: ^[A-Z]$
          • city (string, required) — The city in which the hotel is located Example: New York
        • wereExtrasPurchased (boolean, required) — Indicates whether extras were purchased in the reservation
        • isRefundable (boolean, required) — Indicates whether the reservation is refundable
        • highestRoomType (string, required) — The most luxurious room booked in the reservation Example: Presidential Suite
        • numberOfRooms (double, required) — The number of rooms booked in the reservation Min value: 1 Example: 2
        • numberOfGuests (double, required) — The number of guests in the reservation Min value: 1 Example: 4
        • numberOfKids (double, required) — The number of kids, out of the number of guests in the reservation Min value: 0 Example: 2
      • pnr (string, required) — The flight ticket’s PNR code Example: X36Q9C
      • trip (object, required) — The trip details of the travel booking
        • numberOfFlights (double, required) — The number of flights in the trip Min value: 1 Example: 2
        • numberOfCheckedBags (double, required) — The number of checked bags Min value: 0 Example: 1
        • firstWayDestination (string, required) — The first-way destination’s three-letter IATA airport code Example: JFK Pattern: ^[A-Z]$
        • isRoundTrip (boolean, required) — true if the trip is a round-trip Example: true
        • highestClass (enum, required) — luxurious if the highest bought travel class in the trip is a luxury class (business/first), economy otherwise Example: luxurious
          • Allowed values: economy, luxurious
        • isFlexibleTicket (boolean, required) — True if the trip ticket is a flexible ticket Example: true
        • wereExtrasPurchased (boolean, required) — True if extras were included in the trip purchase Example: true
      • firstFlight (object, required) — The first flight details of the trip
        • numberOfTravelers (double, required) — The number of travelers in the first flight Min value: 1 Example: 2
        • departureTime (double, required) — The timestamp of the departure, in milliseconds since the unix epoch Example: 1551398400000
        • departureAirport (string, required) — The first-flight departure airport’s three-letter IATA code Example: JFK Pattern: ^[A-Z]$
        • duration (double, required) — The first-flight duration, in hours Min value: 0 Example: 3.5
        • flightNumber (string, required) — The alphanumeric flight code Example: BA2491A Pattern: ^[A-Z0-9]+$
      • id (string, optional) — The cart items’s unique ID Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
      • rawProductData (object, optional)
        • example (string, optional)
      • listPrice (object, optional) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • recipientInfo (object, optional)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
    • FlightTicketCartItem
      • itemClass (enum, required) — Denotes the cart item class. The item schema is chosen based on this value. Allowed value: flightTicket Example: flightTicket
        • Allowed values: flightTicket
      • sellingPrice (object, required) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • pnr (string, required) — The flight ticket’s PNR code Example: X36Q9C
      • trip (object, required) — The trip details of the travel booking
        • numberOfFlights (double, required) — The number of flights in the trip Min value: 1 Example: 2
        • numberOfCheckedBags (double, required) — The number of checked bags Min value: 0 Example: 1
        • firstWayDestination (string, required) — The first-way destination’s three-letter IATA airport code Example: JFK Pattern: ^[A-Z]$
        • isRoundTrip (boolean, required) — true if the trip is a round-trip Example: true
        • highestClass (enum, required) — luxurious if the highest bought travel class in the trip is a luxury class (business/first), economy otherwise Example: luxurious
          • Allowed values: economy, luxurious
        • isFlexibleTicket (boolean, required) — True if the trip ticket is a flexible ticket Example: true
        • wereExtrasPurchased (boolean, required) — True if extras were included in the trip purchase Example: true
      • firstFlight (object, required) — The first flight details of the trip
        • numberOfTravelers (double, required) — The number of travelers in the first flight Min value: 1 Example: 2
        • departureTime (double, required) — The timestamp of the departure, in milliseconds since the unix epoch Example: 1551398400000
        • departureAirport (string, required) — The first-flight departure airport’s three-letter IATA code Example: JFK Pattern: ^[A-Z]$
        • duration (double, required) — The first-flight duration, in hours Min value: 0 Example: 3.5
        • flightNumber (string, required) — The alphanumeric flight code Example: BA2491A Pattern: ^[A-Z0-9]+$
      • id (string, optional) — The cart items’s unique ID Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
      • rawProductData (object, optional)
        • example (string, optional)
      • listPrice (object, optional) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • recipientInfo (object, optional)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
    • FlightUpgradeCartItem
      • itemClass (enum, required) — Denotes the cart item class. The item schema is chosen based on this value. Allowed value: flightUpgrade Example: flightUpgrade
        • Allowed values: flightUpgrade
      • sellingPrice (object, required) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • upgradeType (enum, required) — The type of upgrade Example: changes
        • Allowed values: changes, fareIncrease, baggage, seats, insurance, other
      • id (string, optional) — The cart items’s unique ID Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
      • rawProductData (object, optional)
        • example (string, optional)
      • listPrice (object, optional) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • recipientInfo (object, optional)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
      • pnr (string, optional) — The flight ticket’s PNR code Example: X36Q9C
      • description (string, optional) — The upgrade description, required when the upgrade type is other
    • LodgingCartItem
      • reservationId (string, required) — Hotel reservation id Example: X36Q9C
      • nights (double, required) — The number of nights booked in the reservation Min value: 1 Example: 2
      • checkInDate (string, required) — The check-in date Example: 2022-05-02
      • checkInHour (string, required) — The hour of day in which the check-in is done Example: 18 Pattern: ^([01][0-9]|2[0-3])$
      • hotel (object, required) — The booked hotel details
        • name (string, required) — The name of the hotel Example: The Plaza Hotel
        • country (string, required) — The two-letter code of the country in which the hotel is located Example: US Pattern: ^[A-Z]$
        • city (string, required) — The city in which the hotel is located Example: New York
      • wereExtrasPurchased (boolean, required) — Indicates whether extras were purchased in the reservation
      • isRefundable (boolean, required) — Indicates whether the reservation is refundable
      • highestRoomType (string, required) — The most luxurious room booked in the reservation Example: Presidential Suite
      • numberOfRooms (double, required) — The number of rooms booked in the reservation Min value: 1 Example: 2
      • numberOfGuests (double, required) — The number of guests in the reservation Min value: 1 Example: 4
      • numberOfKids (double, required) — The number of kids, out of the number of guests in the reservation Min value: 0 Example: 2
      • itemClass (enum, required) — Denotes the cart item class. The item schema is chosen based on this value. Allowed value: lodging Example: lodging
        • Allowed values: lodging
      • sellingPrice (object, required) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • id (string, optional) — The cart items’s unique ID Example: 5de33332-546a-4171-8988-2a43d2bfe9c6
      • rawProductData (object, optional)
        • example (string, optional)
      • listPrice (object, optional) — Common currency amount structure
        • valueInCurrency (double, required) — The amount in the currency, which is specified in the currency property Example: 90
        • currency (string, required) — Currency specified as a three letter code according to ISO 4217 Example: USD
      • recipientInfo (object, optional)
        • accountId (string, optional) — The ID of the account that will receive the purchased goods
        • dob (string, optional) — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
        • email (string, optional, nullable) — Email Example: lois.lane@dailyplanet.com
        • firstName (string, optional) — First name Example: Lois
        • gender (string, optional) — Gender Example: female
        • lastName (string, optional) — Last name Example: Lois
        • message (string, optional) — The message that the recipient will receive
        • phoneInfo (object, optional) — Phone information structure
          • countryCode (string, required) — The country code (leading + is optional) Example: 42 Pattern: ^+?[0-9]+$
          • phone (string, required) — The phone number without the country code or hyphens Example: 2025550169 Pattern: ^[0-9]+$
          • carrier (string, optional) — The mobile carrier Example: T-Mobile
        • shippingAddress (object, optional) — Address structure
          • country (string, optional) — Country code specified as a two letter code according to ISO 3166 Alpha-2 Between 2 and 2 characters Example: US Pattern: ^[A-Z]$
          • state (string, optional) — The state or province Example: PA
          • city (string, optional) — The city or locality Example: Pittsburgh
          • street (string, optional) — The street name Example: Baker St
          • postalCode (string, optional) — The address postal code
        • wallet (object, optional) — The crypto wallet that will receive the funds
          • custodialType (enum, required) — The type of the wallet Allowed values: custodial, nonCustodial, unknown Example: custodial
            • Allowed values: custodial, nonCustodial, unknown
          • blockchain (string, required) — The blockchain on which the transaction was made Example: BTC Pattern: ^[A-Z0-9-]+$
          • address (string, required) — The crypto wallet address that will receive the funds
  • feePercentage (double, optional) — 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.
  • fixedFee (object, optional)
    • cents (integer, required)
  • authentication3DS (object or object or object, optional) — 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
    • Device3DSInfo
      • colorDepth (double, required)
      • screenHeight (double, required)
      • screenWidth (double, required)
      • timeZone (double, required)
      • versionInfo (list of object, optional)
        • transactionId (string, required)
        • directoryServer (string, required)
        • version (string, required)
        • url (string, optional)
    • External3DSInfo
      • transactionId (string, required)
      • cavv (string, required)
      • eci (string, required)
      • dsTransactionId (string, required)
      • acsTransactionId (string, required)
      • version (string, required)
    • ConcludeChallenge
      • transactionId (string, required)
  • threeDsChallengePreference (enum, optional)
    • Allowed values: NoPreference, Frictionless, Challenge
  • accountFundingTransaction (object, optional) — Used for Account Funding Transactions
    • recipientAftInfo (object, optional)
      • firstName (string, required)
      • lastName (string, required)
      • address1 (string, required)
      • city (string, required)
      • postalCode (string, required)
      • countryCode (string, required)
      • state (string, optional)
      • dateOfBirth (string, optional) — Recipients Date Of Birth in YYYMMDD format.
      • phoneNumber (string, optional)
      • documentReference (string, optional)
  • address (object, optional) — The address field is not needed here unless explicitly given instructions to do so.
    • country (string, required)
    • city (string, required)
    • address1 (string, required)
    • state (string, optional)
    • zip (string, optional)

Response

200

Ok

  • string

Examples

Request

{
  "planCode": "string",
  "token": "string"
}

Response

"string"

SDK Code

import requests

url = "https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token"

payload = {
    "planCode": "string",
    "token": "string"
}
headers = {
    "x-coinflow-auth-session-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
const url = 'https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token';
const options = {
  method: 'POST',
  headers: {'x-coinflow-auth-session-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"planCode":"string","token":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token"

	payload := strings.NewReader("{\n  \"planCode\": \"string\",\n  \"token\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-coinflow-auth-session-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-coinflow-auth-session-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"planCode\": \"string\",\n  \"token\": \"string\"\n}"

response = http.request(request)
puts response.read_body
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token")
  .header("x-coinflow-auth-session-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"planCode\": \"string\",\n  \"token\": \"string\"\n}")
  .asString();
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token', [
  'body' => '{
  "planCode": "string",
  "token": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-coinflow-auth-session-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
using RestSharp;

var client = new RestClient("https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token");
var request = new RestRequest(Method.POST);
request.AddHeader("x-coinflow-auth-session-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"planCode\": \"string\",\n  \"token\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation

let headers = [
  "x-coinflow-auth-session-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "planCode": "string",
  "token": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers/token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()