Get subscription
Endpoint for getting Subscription by id.
info
Please be aware that this endpoint requires a Manage Transactions API Key.
GET
/api/v1/groups/{group_id}/revere_pay/{linked_account_id}/recurring/subscription/{subscription_id}
Response
Code | Description |
---|---|
200 | Success |
400 | Bad Request |
404 | Not Found |
500 | Internal Error |
Example Usage
- JavaScript
- Python
- Go
plans.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');
var requestOptions = {
method: 'GET',
headers: headers,
redirect: 'follow'
};
const group_id = '';
const linked_account_id = '';
const subscription_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/revere_pay/${linked_account_id}/recurring/subscription/${subscription_id}`;
fetch(url, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
plans.py
import requests
group_id = ""
linked_account_id = ""
subscription_id = '';
url = "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/recurring/subscription/" + subscription_id
headers = {
'Authorization': 'API_KEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
plans.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
const group_id = ""
const linked_account_id = ""
const subscription_id = "";
url := "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/recurring/subscription/" + subscription_id
client := &http.Client{}
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
bytes, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(bytes))
}
Example Success Response
{
"data": {
"id": "eef1b240-6e4d-42f7-93ea-873d165aa696",
"plan_id": "6f8df983-62a1-4d36-85fd-2e37114fa694",
"duration": 0,
"amounts": {
"amount": 30000,
"tax_amount": 1000,
"initial_amount": 20000
},
"billing_cycle": "daily",
"billing_factor": 7,
"next_bill_date": "2024-04-18T00:00:00Z",
"description": "Endless subscription",
"currency": "USD",
"processor_id": "<processor_id>",
"retry_count": 3,
"metadata": {
"max_retry_count": 3,
"form_layout_id": null,
"form_layout_external_id": null,
"form_entry_id": null,
"charge_count": 1
},
"trial_period_days": 0,
"payment_method": "card",
"payment_details": {
"card": {
"brand": "Visa",
"first_six": "411111",
"last_four": "1111"
}
},
"billing_address": {
"address": {
"first_name": "John",
"last_name": "Doe",
"city": "New York",
"line_1": "1st Ave.",
"line_2": "1217",
"subdivision": "NY",
"postal_code": "10065",
"country": "US",
"email": "johndoe@example.com"
}
},
"status": "active",
"gateway_customer_id": "<customer_id>"
}
}