Get Plan
Endpoint for getting a Plan.
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/plans/{plan_id}
Response
Code | Description |
---|---|
200 | Success |
400 | Bad Request / Validation error |
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 plan_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/revere_pay/${linked_account_id}/recurring/plans/${plan_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 = ""
plan_id = ""
url = "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/recurring/plans/" + plan_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 plan_id = ""
url := "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/recurring/plans/" + plan_id
client := &http.Client{}
req, _ := http.NewRequest("GET", url)
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
{
"id": "4e178777-2113-4815-adbd-c86fa8a5246e",
"name": "Starter plan",
"duration": 0,
"amount": 1500,
"initial_amount": 1000,
"billing_cycle": "monthly",
"billing_factor": 1,
"linked_account_id": "771f7f31-1e91-4359-ae12-d163f7064f5b",
"description": "",
"tax": 0,
"shipping_amount": 0,
"custom_fields": null,
"trial_period_days": 14,
"max_retry_count": 3,
"created_at": "2024-02-06T21:58:58.611953Z",
"updated_at": "2024-02-06T21:58:58.611953Z"
}