Powered by Coinflow
Payments · Documentation
Operational

Get Subscribers

GET https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/{planId}/subscribers

Get the subscriptions for a subscription plan

Reference: /api-reference/api-reference/merchant-subscription/get-subscriptions

Authentication

  • Authorization header (required) — The API key of the merchant - see /api-reference/api-reference/authentication/get-session-key

Request

Path parameters

  • planId (string, required) — - can be the id or the plan code

Response

200

Ok

  • list of object
    • id (string, required)
    • customerId (string, required)
    • merchantId (string, required)
    • email (string, required)
    • plan (string, required)
    • planCode (string, required)
    • status (enum, required)
      • Allowed values: Active, Canceled, Expired, Concluded, Failed, Blocked
    • blockchain (enum, optional)
      • Allowed values: solana, eth, polygon, base, user, arbitrum, stellar, monad, tempo
    • nextPaymentAt (datetime, optional)

Examples

Request

{}

Response

[
  {
    "id": "sub_8f3a2b1c9d4e",
    "customerId": "cust_72b9f4d8a1e3",
    "merchantId": "merch_5d7c9a2b4f1e",
    "email": "jane.doe@example.com",
    "plan": "Premium Monthly Plan",
    "planCode": "PREM-M-001",
    "status": "Active",
    "blockchain": "solana",
    "nextPaymentAt": "2024-01-15T09:30:00Z"
  }
]

SDK Code

import requests

url = "https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/planId/subscribers"

payload = {}
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
const url = 'https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/planId/subscribers';
const options = {
  method: 'GET',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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/merchant/subscription/plans/planId/subscribers"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "<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/merchant/subscription/plans/planId/subscribers")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

HttpResponse<String> response = Unirest.get("https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/planId/subscribers")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/planId/subscribers', [
  'body' => '{}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

var client = new RestClient("https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/planId/subscribers");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/merchant/subscription/plans/planId/subscribers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()