Get Partnership
curl --request GET \
--url https://api-staging.withbenji.com/partnerships/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api-staging.withbenji.com/partnerships/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-staging.withbenji.com/partnerships/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.withbenji.com/partnerships/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-staging.withbenji.com/partnerships/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-staging.withbenji.com/partnerships/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.withbenji.com/partnerships/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "ok",
"data": {
"partnership": {
"uuid_id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Test Partnership",
"description": "A partnership between merchant and loyalty partner",
"img": "https://example.com/partnership-logo.png",
"merchant_id": 1,
"related_partner_id": null,
"partner_id": 3,
"is_active": 1,
"is_deleted": 0,
"owner_id": 5,
"total_rewards_earned": 15000,
"total_rewards_redeemed": 3200,
"num_of_transactions": 142,
"is_demo": 0,
"created_date": "2024-11-20T00:30:57.256493+00:00",
"campaigns": null
}
}
}
{
"error": "invalid_token",
"message": "Invalid token"
}
{
"error": "unauthorized_request",
"message": "Token is not authorized to make this request"
}
{
"error": "partnership_does_not_exist",
"message": "The partnership does not exist"
}
Partnerships
Get Partnership
Get a single partnership by ID
GET
/
partnerships
/
{id}
Get Partnership
curl --request GET \
--url https://api-staging.withbenji.com/partnerships/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api-staging.withbenji.com/partnerships/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-staging.withbenji.com/partnerships/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.withbenji.com/partnerships/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-staging.withbenji.com/partnerships/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-staging.withbenji.com/partnerships/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.withbenji.com/partnerships/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "ok",
"data": {
"partnership": {
"uuid_id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Test Partnership",
"description": "A partnership between merchant and loyalty partner",
"img": "https://example.com/partnership-logo.png",
"merchant_id": 1,
"related_partner_id": null,
"partner_id": 3,
"is_active": 1,
"is_deleted": 0,
"owner_id": 5,
"total_rewards_earned": 15000,
"total_rewards_redeemed": 3200,
"num_of_transactions": 142,
"is_demo": 0,
"created_date": "2024-11-20T00:30:57.256493+00:00",
"campaigns": null
}
}
}
{
"error": "invalid_token",
"message": "Invalid token"
}
{
"error": "unauthorized_request",
"message": "Token is not authorized to make this request"
}
{
"error": "partnership_does_not_exist",
"message": "The partnership does not exist"
}
The
x-api-key header value to be used on this API is your partner API key, which can be generated through the dashboard.string
required
Unique identifier of the partnership to retrieve (UUID)
Response
object
required
The partnership object containing all partnership details including its configuration, associated campaigns, and performance metrics.
Hide properties
Hide properties
string
required
The UUID identifier of the partnership. This is an alternative identifier that can be used in API operations.
string
required
The name of the partnership that is displayed to users and administrators. Identifies the business relationship between a merchant and partner.
string
A detailed description of the partnership explaining its purpose, benefits, and terms. May be null if no description is provided.
string
The URL to the partnership logo or image that is displayed in marketing materials and the user interface. May be null if no image is provided.
integer
required
The unique identifier of the merchant in this partnership. Merchants are businesses where users can earn or redeem rewards.
integer
The unique identifier of the related partner in this partnership. May be null if no related partner is specified.
integer
required
The unique identifier of the partner in this partnership. Partners are loyalty program providers who offer rewards to users.
integer
required
Indicates whether this partnership is currently active and available to users. Values: 1=active, 0=inactive. Inactive partnerships do not generate rewards.
integer
required
Indicates whether this partnership has been marked as deleted. Values: 1=deleted, 0=not deleted. Deleted partnerships are not shown in standard API responses.
integer
required
The unique identifier of the user who created or owns this partnership. Used for attribution and permission management.
number
The total amount of rewards that users have earned through this partnership so far, in the smallest currency unit (e.g., cents). May be null if no rewards have been earned yet.
number
The total amount of rewards that users have redeemed through this partnership so far, in the smallest currency unit (e.g., cents). May be null if no rewards have been redeemed yet.
integer
The total number of transactions that have occurred within this partnership. Used for analytics and reporting. May be null if no transactions have occurred yet.
integer
required
Indicates whether this partnership is for demonstration purposes only. Values: 1=demo, 0=real. Demo partnerships are not included in production reports.
string
The date and time when this partnership was created, in ISO 8601 format. Used for auditing and sorting.
array
The list of campaigns associated with this partnership. Each campaign defines specific reward structures and eligibility criteria. May be null if no campaigns exist for this partnership yet.
{
"code": "ok",
"data": {
"partnership": {
"uuid_id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Test Partnership",
"description": "A partnership between merchant and loyalty partner",
"img": "https://example.com/partnership-logo.png",
"merchant_id": 1,
"related_partner_id": null,
"partner_id": 3,
"is_active": 1,
"is_deleted": 0,
"owner_id": 5,
"total_rewards_earned": 15000,
"total_rewards_redeemed": 3200,
"num_of_transactions": 142,
"is_demo": 0,
"created_date": "2024-11-20T00:30:57.256493+00:00",
"campaigns": null
}
}
}
{
"error": "invalid_token",
"message": "Invalid token"
}
{
"error": "unauthorized_request",
"message": "Token is not authorized to make this request"
}
{
"error": "partnership_does_not_exist",
"message": "The partnership does not exist"
}
This endpoint retrieves detailed information about a specific partnership, including all associated campaigns and performance metrics.
Was this page helpful?
⌘I