Refer-a-friend
Referral transactions
Track transactions from referred customers in refer-a-friend programs
POST
/
v1
/
transactions
Referral transactions
curl --request POST \
--url https://api.example.com/v1/transactionsimport requests
url = "https://api.example.com/v1/transactions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/transactions', 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.example.com/v1/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v1/transactions"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/transactions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"key": "transaction_123",
"action": "sale",
"amount": 99.99,
"customer": "customer_123",
"referred_customer": "customer_456",
"credit": false,
"is_currency": true,
"amount_units": "USD",
"created_at": "2025-05-12T15:43:55.000000Z",
"rewards": []
},
"status": 1
}
Track purchases made by referred customers to calculate rewards for referring customers.
*Provide at least one customer identifier.
In refer-a-friend programs, response fields use
customer (referring customer) and referred_customer instead of partner and customer used in affiliate programs.Create transaction
POST https://api.partnero.com/v1/transactions
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | No | Unique transaction ID (recommended for refund handling) |
amount | number | Yes | Transaction amount |
amount_units | string | No | Currency code (e.g., USD, EUR) |
action | string | No | Transaction type (e.g., sale) |
customer.id | string | Yes* | Referred customer’s ID |
customer.email | string | Yes* | Referred customer’s email (alternative to ID) |
customer.key | string | Yes* | Referred customer’s key (alternative to ID) |
Request
cURL
curl --location 'https://api.partnero.com/v1/transactions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"customer": {
"id": "customer_456"
},
"key": "transaction_123",
"amount": 99.99,
"action": "sale"
}'
Response
{
"data": {
"key": "transaction_123",
"action": "sale",
"amount": 99.99,
"customer": "customer_123",
"referred_customer": "customer_456",
"credit": false,
"is_currency": true,
"amount_units": "USD",
"created_at": "2025-05-12T15:43:55.000000Z",
"rewards": []
},
"status": 1
}
Response fields
| Field | Type | Description |
|---|---|---|
key | string | Transaction identifier |
action | string | Transaction type |
amount | number | Transaction amount |
amount_units | string | Currency code |
customer | string | Referring customer’s identifier |
referred_customer | string | Referred customer’s identifier |
credit | boolean | Whether this is a credit transaction |
is_currency | boolean | Whether the amount is monetary |
rewards | array | Associated rewards |
created_at | string | ISO 8601 timestamp |
List transactions
GET https://api.partnero.com/v1/transactions
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 10 | Results per page (10-100) |
page | integer | 1 | Page number |
cURL
curl --location 'https://api.partnero.com/v1/transactions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'
Get transaction
GET https://api.partnero.com/v1/transactions/{key}
cURL
curl --location 'https://api.partnero.com/v1/transactions/transaction_123' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'
Delete transaction
DELETE https://api.partnero.com/v1/transactions/{key}
Deleting a transaction is permanent and will also remove any rewards earned by the referring customer.
cURL
curl --location --request DELETE 'https://api.partnero.com/v1/transactions/transaction_123' \
--header 'Authorization: Bearer YOUR_API_KEY'
⌘I
Referral transactions
curl --request POST \
--url https://api.example.com/v1/transactionsimport requests
url = "https://api.example.com/v1/transactions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/transactions', 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.example.com/v1/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v1/transactions"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/transactions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"key": "transaction_123",
"action": "sale",
"amount": 99.99,
"customer": "customer_123",
"referred_customer": "customer_456",
"credit": false,
"is_currency": true,
"amount_units": "USD",
"created_at": "2025-05-12T15:43:55.000000Z",
"rewards": []
},
"status": 1
}
