Powered by Coinflow
Payments · Documentation
Operational

Get Customer Subscriptions

GET https://api-sandbox.coinflow.cash/api/subscription/{merchantId}/subscribers

Get the subscriptions a customer has with a merchant

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

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
  • Authorization header (required) — The API key of the merchant - 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)

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_8f3a2b1c9d4e7f6a",
    "customerId": "cust_1234567890abcdef",
    "merchantId": "merch_9876543210fedcba",
    "email": "jane.doe@example.com",
    "plan": "Premium Monthly",
    "planCode": "PREM-M-001",
    "status": "Active",
    "blockchain": "eth",
    "nextPaymentAt": "2024-01-15T09:30:00Z"
  }
]

SDK Code

import requests

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

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

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

print(response.json())
const url = 'https://api-sandbox.coinflow.cash/api/subscription/merchantId/subscribers';
const options = {
  method: 'GET',
  headers: {'x-coinflow-auth-session-key': '<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/subscription/merchantId/subscribers"

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

	req, _ := http.NewRequest("GET", 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")

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

request = Net::HTTP::Get.new(url)
request["x-coinflow-auth-session-key"] = '<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/subscription/merchantId/subscribers")
  .header("x-coinflow-auth-session-key", "<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/subscription/merchantId/subscribers', [
  'body' => '{}',
  '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");
var request = new RestRequest(Method.GET);
request.AddHeader("x-coinflow-auth-session-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation

let headers = [
  "x-coinflow-auth-session-key": "<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/subscription/merchantId/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()