curl --request POST \
--url https://api.paygentic.io/v0/fees \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"merchantId": "<string>",
"productId": "<string>",
"itemId": "<string>"
}
'import requests
url = "https://api.paygentic.io/v0/fees"
payload = {
"name": "<string>",
"description": "<string>",
"merchantId": "<string>",
"productId": "<string>",
"itemId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
merchantId: '<string>',
productId: '<string>',
itemId: '<string>'
})
};
fetch('https://api.paygentic.io/v0/fees', 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.paygentic.io/v0/fees",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'merchantId' => '<string>',
'productId' => '<string>',
'itemId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/fees"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"productId\": \"<string>\",\n \"itemId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.paygentic.io/v0/fees")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"productId\": \"<string>\",\n \"itemId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/fees")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"productId\": \"<string>\",\n \"itemId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "fee_w9x0y1z2a3b4c5d6",
"object": "fee",
"createdAt": "2024-01-15T10:30:00Z",
"description": "One-time setup fee for new customers",
"merchantId": "org_e7f8g9h0i1j2k3l4",
"name": "Setup Fee",
"productId": "prod_m5n6o7p8q9r0s1t2",
"updatedAt": "2024-01-15T10:30:00Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Create
Create a new fee for a merchant organization. A Fee represents a charge that can be applied to subscriptions. Cadence is defined when creating a Price for the fee.
curl --request POST \
--url https://api.paygentic.io/v0/fees \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"merchantId": "<string>",
"productId": "<string>",
"itemId": "<string>"
}
'import requests
url = "https://api.paygentic.io/v0/fees"
payload = {
"name": "<string>",
"description": "<string>",
"merchantId": "<string>",
"productId": "<string>",
"itemId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
merchantId: '<string>',
productId: '<string>',
itemId: '<string>'
})
};
fetch('https://api.paygentic.io/v0/fees', 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.paygentic.io/v0/fees",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'merchantId' => '<string>',
'productId' => '<string>',
'itemId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/fees"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"productId\": \"<string>\",\n \"itemId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.paygentic.io/v0/fees")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"productId\": \"<string>\",\n \"itemId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/fees")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"productId\": \"<string>\",\n \"itemId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "fee_w9x0y1z2a3b4c5d6",
"object": "fee",
"createdAt": "2024-01-15T10:30:00Z",
"description": "One-time setup fee for new customers",
"merchantId": "org_e7f8g9h0i1j2k3l4",
"name": "Setup Fee",
"productId": "prod_m5n6o7p8q9r0s1t2",
"updatedAt": "2024-01-15T10:30:00Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Body
Human-readable label identifying the fee. Sample values: 'Setup Fee', 'Monthly Subscription', 'Compliance Update', 'Annual License'
Explanatory text describing what the fee represents. Sample values: 'One-time setup fee for new customers', 'Monthly base subscription charge', 'Yearly compliance and security update fee'
The unique identifier of the merchant organization associated with the fee.
^org_[a-zA-Z0-9]+$The product this fee belongs to. Required unless itemId is supplied, in which case the product is derived from that item's catalog.
^prod_[a-zA-Z0-9]+$Optional item tag, used to map this fee's invoice lines to an external accounting/tax identity. When supplied, productId is derived from the item's catalog and a supplied productId that disagrees is rejected.
^itm_[a-zA-Z0-9]+$Response
Fee created successfully
^fee_[a-zA-Z0-9]+$fee Unique identifier for an organization
^org_[a-zA-Z0-9]+$The product this fee belongs to. Always populated; derived from the item's catalog when the fee is tagged with an item.
^prod_[a-zA-Z0-9]+$The item this fee is tagged with, or null when untagged. Used to map this fee's invoice lines to an external accounting/tax identity.
^itm_[a-zA-Z0-9]+$Was this page helpful?