Payfunnels External API v1.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
External API documentation for Payfunnels
Base URLs:
Authentication
HTTP Authentication, scheme: bearer Use Bearer token:
Authorization: Bearer <Access Token>
API Key (API KEY)
- Parameter Name: x-pf-api-key, in: header. API Key authentication via custom header:
x-pf-api-key
- Parameter Name: x-pf-api-key, in: header. API Key authentication via custom header:
Payment Links
Create One-Time Payment Link
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/paymentlinks/onetime \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"title": "One time payment",
"description": "Payment link for one time payment.",
"amount": 49.99
}'
POST https://api.payfunnels.com/v1/paymentlinks/onetime HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/onetime',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/paymentlinks/onetime',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/paymentlinks/onetime', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/paymentlinks/onetime', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/onetime");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/paymentlinks/onetime", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/paymentlinks/onetime
Body parameter
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateOneTimePaymentLink | true | none |
» title | body | string | true | Payment link title. |
» description | body | string | true | Detailed description of payment link. |
» currencyCode | body | string | false | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» amount | body | number | true | One time payment link amount. |
» isTaxable | body | boolean | false | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | body | boolean | false | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
» coupon | body | [Coupon] | false | Coupon to apply at checkout. |
»» name | body | string | true | Coupon code. |
»» percentOff | body | number | false | Discount percentage. Required if amountOff is not applied. |
»» amountOff | body | number | false | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
»» redemptions | body | number | false | Limit the total number of times coupon can be redeemed. |
»» redeemBy | body | number | false | Expiry date of the coupon as Unix epoch format. |
» displayBillingAddress | body | boolean | false | Prompt customer for billing address. |
» displayShippingAddress | body | boolean | false | Prompt customer for shipping address. |
» enableTermOfService | body | boolean | false | Require acceptance of terms of service. |
» additionalFields | body | [AdditionalFields] | false | Additional fields to be added to the payment link. |
»» label | body | string | true | Label of the additional field. |
»» type | body | string | true | Type of the additional field. |
»» isRequired | body | boolean | false | Whether the field is required or not. |
»» displayOnReceipt | body | boolean | false | Whether the field is displayed on receipt or not. |
»» option | body | [string] | false | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | body | boolean | false | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | body | string | false | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Parameter | Value |
---|---|
»» type | Textfield |
»» type | TextArea |
»» type | Dropdown |
»» type | Radio |
»» type | Checkbox |
Example responses
201 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"amount": 49.99,
"type": "onetime"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Payment link created | OneTimePaymentLinkResponse |
Create Recurring Payment Link
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/paymentlinks/recurring \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"title": "Digital Service",
"description": "Digital Service for your business.",
"interval": "month",
"amount": 49.99
}'
POST https://api.payfunnels.com/v1/paymentlinks/recurring HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/recurring',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/paymentlinks/recurring',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/paymentlinks/recurring', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/paymentlinks/recurring', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/recurring");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/paymentlinks/recurring", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/paymentlinks/recurring
Body parameter
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateRecurringPaymentLink | true | none |
» title | body | string | true | Payment link title. |
» description | body | string | true | Detailed description of payment link. |
» currencyCode | body | string | false | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» amount | body | number | true | Recurring payment link amount. |
» interval | body | string | true | Interval of product. It can be of day , week , month , year . |
» trialDays | body | number | false | Trial period in days for this product. Must be grater than 2 days |
» isTaxable | body | boolean | false | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | body | boolean | false | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
» coupon | body | [RecurringPaymentLinkCoupon] | false | Coupon to apply at checkout. |
»» name | body | string | true | Coupon code. |
»» percentOff | body | number | false | Discount percentage. Required if amountOff is not applied. |
»» amountOff | body | number | false | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
»» redemptions | body | number | false | Limit the total number of times coupon can be redeemed. |
»» redeemBy | body | number | false | Expiry date of the coupon as Unix epoch format. |
»» duration | body | string | false | Duration of the coupon. It can be of forever , once or number of months for which the coupon can be redeemed. |
» displayBillingAddress | body | boolean | false | Prompt customer for billing address. |
» displayShippingAddress | body | boolean | false | Prompt customer for shipping address. |
» enableTermOfService | body | boolean | false | Require acceptance of terms of service. |
» additionalFields | body | [AdditionalFields] | false | Additional fields to be added to the payment link. |
»» label | body | string | true | Label of the additional field. |
»» type | body | string | true | Type of the additional field. |
»» isRequired | body | boolean | false | Whether the field is required or not. |
»» displayOnReceipt | body | boolean | false | Whether the field is displayed on receipt or not. |
»» option | body | [string] | false | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | body | boolean | false | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | body | string | false | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Parameter | Value |
---|---|
» interval | day |
» interval | week |
» interval | month |
» interval | year |
»» duration | forever |
»» duration | once |
»» duration | 1 |
»» type | Textfield |
»» type | TextArea |
»» type | Dropdown |
»» type | Radio |
»» type | Checkbox |
Example responses
201 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"type": "recurring"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Payment link created | RecurringPaymentLinkResponse |
Create Payment Plan Payment Link
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/paymentlinks/paymentplan \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"title": "Business plus plan",
"description": "Affordable business growth payment plan.",
"interval": "month",
“amount”: 30.30,
"numberOfPayments": 7
}'
POST https://api.payfunnels.com/v1/paymentlinks/paymentplan HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"numberOfPayments": 1,
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/paymentplan',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/paymentlinks/paymentplan',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/paymentlinks/paymentplan', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/paymentlinks/paymentplan', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/paymentplan");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/paymentlinks/paymentplan", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/paymentlinks/paymentplan
Body parameter
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"numberOfPayments": 1,
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreatePaymentPlanPaymentLink | true | none |
» title | body | string | true | Payment link title. |
» description | body | string | true | Detailed description of payment link. |
» currencyCode | body | string | false | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» amount | body | number | true | Payment plan amount. |
» interval | body | string | true | Interval of product. It can be of day , week , month , year . |
» numberOfPayments | body | number | true | Number of payments to be taken before subscription cancels. Applicable only for payment type. |
» trialDays | body | number | false | Trial period for this product. Must be grater than 2 days |
» isTaxable | body | boolean | false | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | body | boolean | false | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. Cannot be used while setup fees is set to true . |
» coupon | body | [RecurringPaymentLinkCoupon] | false | Coupon to apply at checkout. |
»» name | body | string | true | Coupon code. |
»» percentOff | body | number | false | Discount percentage. Required if amountOff is not applied. |
»» amountOff | body | number | false | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
»» redemptions | body | number | false | Limit the total number of times coupon can be redeemed. |
»» redeemBy | body | number | false | Expiry date of the coupon as Unix epoch format. |
»» duration | body | string | false | Duration of the coupon. It can be of forever , once or number of months for which the coupon can be redeemed. |
» displayBillingAddress | body | boolean | false | Prompt customer for billing address. |
» displayShippingAddress | body | boolean | false | Prompt customer for shipping address. |
» enableTermOfService | body | boolean | false | Require acceptance of terms of service. |
» additionalFields | body | [AdditionalFields] | false | Additional fields to be added to the payment link. |
»» label | body | string | true | Label of the additional field. |
»» type | body | string | true | Type of the additional field. |
»» isRequired | body | boolean | false | Whether the field is required or not. |
»» displayOnReceipt | body | boolean | false | Whether the field is displayed on receipt or not. |
»» option | body | [string] | false | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | body | boolean | false | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | body | string | false | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Parameter | Value |
---|---|
» interval | day |
» interval | week |
» interval | month |
» interval | year |
»» duration | forever |
»» duration | once |
»» duration | 1 |
»» type | Textfield |
»» type | TextArea |
»» type | Dropdown |
»» type | Radio |
»» type | Checkbox |
Example responses
201 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"type": "paymentplan",
"numberOfPayments": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Payment plan created | PaymentPlanPaymentLinkResponse |
Create Multiple Products Payment Link
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/paymentlinks/multipleproducts \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"title": "Business plus plan",
"description": "Affordable business growth payment plan.",
"allowMultipleSelection": false,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
}
},
{
"name": "Product",
"description": "Product description.",
"amount": 99.99,
"recurring": {
"interval": "month"
}
},
],
}'
POST https://api.payfunnels.com/v1/paymentlinks/multipleproducts HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"allowMultipleSelection": false,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/multipleproducts',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/paymentlinks/multipleproducts',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/paymentlinks/multipleproducts', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/paymentlinks/multipleproducts', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/multipleproducts");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/paymentlinks/multipleproducts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/paymentlinks/multipleproducts
Body parameter
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"allowMultipleSelection": false,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateMultipleProductsPaymentLink | true | none |
» title | body | string | true | Payment link title. |
» description | body | string | true | Detailed description of payment link. |
» currencyCode | body | string | false | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» allowMultipleSelection | body | boolean | true | Whether the multiple selection is allowed or not. Default is false . If true , the multiple product selection will be allowed. If true then interval of recurring or paymentPlan must be same .It will be treated false if products with recurring and paymentplan both are passed. |
» products | body | [PaymentLinkMultipleProducts] | true | Multiple products to be added to the payment link. If recurring or paymentplan is not passed then it will be treated as onetime . |
»» name | body | string | true | Name of product. |
»» description | body | string | true | Detailed description of product. |
»» amount | body | number | true | Amount of product. |
»» recurring | body | Recurring | false | Recurring configuration. |
»»» interval | body | string | true | Interval of product. It can be of day , week , month , year . |
»» paymentPlan | body | PaymentPlan | false | Payment plan configuration. |
»»» interval | body | string | true | Interval of product. It can be of day , week , month , year . |
»»» numberOfPayments | body | number | true | Number of payments. |
» trialDays | body | number | false | Trial period for this product. Must be grater than 2 days |
» isTaxable | body | boolean | false | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | body | boolean | false | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
» coupon | body | [RecurringPaymentLinkCoupon] | false | Coupon to apply at checkout. Not compatible when both recurring and paymentplan is passed. |
»» name | body | string | true | Coupon code. |
»» percentOff | body | number | false | Discount percentage. Required if amountOff is not applied. |
»» amountOff | body | number | false | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
»» redemptions | body | number | false | Limit the total number of times coupon can be redeemed. |
»» redeemBy | body | number | false | Expiry date of the coupon as Unix epoch format. |
»» duration | body | string | false | Duration of the coupon. It can be of forever , once or number of months for which the coupon can be redeemed. |
» displayBillingAddress | body | boolean | false | Prompt customer for billing address. |
» displayShippingAddress | body | boolean | false | Prompt customer for shipping address. |
» enableTermOfService | body | boolean | false | Require acceptance of terms of service. |
» additionalFields | body | [AdditionalFields] | false | Additional fields to be added to the payment link. |
»» label | body | string | true | Label of the additional field. |
»» type | body | string | true | Type of the additional field. |
»» isRequired | body | boolean | false | Whether the field is required or not. |
»» displayOnReceipt | body | boolean | false | Whether the field is displayed on receipt or not. |
»» option | body | [string] | false | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | body | boolean | false | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | body | string | false | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Parameter | Value |
---|---|
»»» interval | day |
»»» interval | week |
»»» interval | month |
»»» interval | year |
»»» interval | day |
»»» interval | week |
»»» interval | month |
»»» interval | year |
»» duration | forever |
»» duration | once |
»» duration | 1 |
»» type | Textfield |
»» type | TextArea |
»» type | Dropdown |
»» type | Radio |
»» type | Checkbox |
Example responses
201 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"type": "multipleproducts",
"allowMultipleSelection": false,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"trialDays": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Payment link created | MultipleProductsPaymentLinkResponse |
Create Custom Plan Payment Link
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/paymentlinks/customplan \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"title": "Business plus plan",
"description": "Affordable business growth custom plan.",
“amount”: 30.30,
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
}
},
}'
POST https://api.payfunnels.com/v1/paymentlinks/customplan HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"title": "Custom Plan Payment Link",
"description": "Custom plan payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
},
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/customplan',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/paymentlinks/customplan',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/paymentlinks/customplan', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/paymentlinks/customplan', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/customplan");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/paymentlinks/customplan", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/paymentlinks/customplan
Body parameter
{
"title": "Custom Plan Payment Link",
"description": "Custom plan payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
},
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateCustomPlanPaymentLink | true | none |
» title | body | string | true | Custom plan payment link title. |
» description | body | string | true | Detailed description of payment link. |
» currencyCode | body | string | false | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» amount | body | number | true | Amount of payment link. This amount will be charged immediately. |
» paymentSchedule | body | PaymentSchedule | true | Defines payment schedule. |
»» chargePhases | body | [ChargePhases] | false | Charge phases. Maximum 3 phases are allowed. |
»»» amount | body | number | true | Amount to be charged in this phase. |
»»» delayInDays | body | number | true | Time to wait before this phase (in days). |
»» finalChargePhase | body | FinalChargePhase | true | Final recurring charge phase. Any one from onetime , recurring or paymentplan is required. |
»»» delayInDays | body | number | true | Delay before final phase (in days). |
»»» amount | body | number | true | Amount for final recurring charge phase. |
»»» recurring | body | Recurring | false | Recurring configuration. |
»»»» interval | body | string | true | Interval of product. It can be of day , week , month , year . |
»»» paymentPlan | body | PaymentPlan | false | Payment plan structure. |
»»»» interval | body | string | true | Interval of product. It can be of day , week , month , year . |
»»»» numberOfPayments | body | number | true | Number of payments. |
» isTaxable | body | boolean | false | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | body | boolean | false | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
» displayBillingAddress | body | boolean | false | Prompt customer for billing address. |
» displayShippingAddress | body | boolean | false | Prompt customer for shipping address. |
» enableTermOfService | body | boolean | false | Require acceptance of terms of service. |
» additionalFields | body | [AdditionalFields] | false | Additional fields to be added to the payment link. |
»» label | body | string | true | Label of the additional field. |
»» type | body | string | true | Type of the additional field. |
»» isRequired | body | boolean | false | Whether the field is required or not. |
»» displayOnReceipt | body | boolean | false | Whether the field is displayed on receipt or not. |
»» option | body | [string] | false | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | body | boolean | false | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | body | string | false | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Parameter | Value |
---|---|
»»»» interval | day |
»»»» interval | week |
»»»» interval | month |
»»»» interval | year |
»»»» interval | day |
»»»» interval | week |
»»»» interval | month |
»»»» interval | year |
»» type | Textfield |
»» type | TextArea |
»» type | Dropdown |
»» type | Radio |
»» type | Checkbox |
Example responses
201 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"type": "customplan",
"amount": 49.99,
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Payment link created | CustomPlanPaymentLinkResponse |
Create Pay What You Want Payment Link
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"title": "Pay what you want plan",
"description": "Pay what you want plan.",
"allowOneTime": true,
"allowRecurring": true,
}'
POST https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"title": "Pay What You Want Payment Link",
"description": "Pay what you want payment link description.",
"currencyCode": "USD",
"allowOneTime": false,
"allowRecurring": false,
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/paymentlinks/paywhatyouwant", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/paymentlinks/paywhatyouwant
Body parameter
{
"title": "Pay What You Want Payment Link",
"description": "Pay what you want payment link description.",
"currencyCode": "USD",
"allowOneTime": false,
"allowRecurring": false,
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreatePayWhatYouWantPaymentLink | true | none |
» title | body | string | true | Pay what you want payment link title. |
» description | body | string | true | Detailed description of payment link. |
» currencyCode | body | string | false | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» allowOneTime | body | boolean | false | Whether the one-time payments are allowed or not. Default is true . If true , the one-time payments are allowed. |
» allowRecurring | body | boolean | false | Whether the recurring payments are allowed or not. Default is false . If true , the recurring payments are allowed. |
» isTaxable | body | boolean | false | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | body | boolean | false | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
» displayBillingAddress | body | boolean | false | Prompt customer for billing address. |
» displayShippingAddress | body | boolean | false | Prompt customer for shipping address. |
» enableTermOfService | body | boolean | false | Require acceptance of terms of service. |
» additionalFields | body | [AdditionalFields] | false | Additional fields to be added to the payment link. |
»» label | body | string | true | Label of the additional field. |
»» type | body | string | true | Type of the additional field. |
»» isRequired | body | boolean | false | Whether the field is required or not. |
»» displayOnReceipt | body | boolean | false | Whether the field is displayed on receipt or not. |
»» option | body | [string] | false | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | body | boolean | false | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | body | string | false | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Parameter | Value |
---|---|
»» type | Textfield |
»» type | TextArea |
»» type | Dropdown |
»» type | Radio |
»» type | Checkbox |
Example responses
201 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"type": "paywhatyouwant",
"allowOneTime": false,
"allowRecurring": false
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Payment link created | PayWhatYouWantPaymentLinkResponse |
Returns list of payment links
Code samples
# You can also use wget
curl -X GET "https://api.payfunnels.com/v1/paymentlinks?type=onetime&page=1&limit=10" \
-H 'Accept: application/json' \
--H 'x-pf-api-key: API_KEY'
GET https://api.payfunnels.com/v1/paymentlinks HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
const headers = {
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.get 'https://api.payfunnels.com/v1/paymentlinks',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.get('https://api.payfunnels.com/v1/paymentlinks', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.payfunnels.com/v1/paymentlinks', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.payfunnels.com/v1/paymentlinks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/paymentlinks
Fetches all payment links. Default returns 25 records, pass limit for more records. The type
can be used to filter payment links by type (onetime
, recurring
, paymentplan
, custom
, paywhatyouwant
, multipleproducts
).
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
type | query | string | false | none |
page | query | number | false | none |
limit | query | number | false | none |
Example responses
200 Response
[
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"type": "onetime",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"numberOfPayments": 1,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
},
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetches all payment links. | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [PaymentLinkByIdResponse] | false | none | none |
» id | string | false | none | Unique identifier of the payment link. |
» url | string | false | none | Payment link URL. |
» title | string | false | none | Payment link title. |
» type | string | false | none | Payment link type. |
» description | string | false | none | Detailed description of payment link. |
» currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
» amount | number | false | none | One time payment link amount. |
» interval | string | false | none | Interval of product. It can be of day , week , month , year . |
» numberOfPayments | number | false | none | Number of payments. |
» products | [PaymentLinkMultipleProducts] | false | none | Multiple products in the payment link. |
»» name | string | true | none | Name of product. |
»» description | string | true | none | Detailed description of product. |
»» amount | number | true | none | Amount of product. |
»» recurring | Recurring | false | none | Recurring configuration. |
»»» interval | string | true | none | Interval of product. It can be of day , week , month , year . |
»» paymentPlan | PaymentPlan | false | none | Payment plan configuration. |
»»» interval | string | true | none | Interval of product. It can be of day , week , month , year . |
»»» numberOfPayments | number | true | none | Number of payments. |
» paymentSchedule | PaymentSchedule | false | none | Payment schedule in the payment link. |
»» chargePhases | [ChargePhases] | false | none | Charge phases. Maximum 3 phases are allowed. |
»»» amount | number | true | none | Amount to be charged in this phase. |
»»» delayInDays | number | true | none | Time to wait before this phase (in days). |
»» finalChargePhase | FinalChargePhase | true | none | Final recurring charge phase. Any one from onetime , recurring or paymentplan is required. |
»»» delayInDays | number | true | none | Delay before final phase (in days). |
»»» amount | number | true | none | Amount for final recurring charge phase. |
»»» recurring | Recurring | false | none | Recurring configuration. |
»»»» interval | string | true | none | Interval of product. It can be of day , week , month , year . |
»»» paymentPlan | PaymentPlan | false | none | Payment plan structure. |
»»»» interval | string | true | none | Interval of product. It can be of day , week , month , year . |
»»»» numberOfPayments | number | true | none | Number of payments. |
» isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
» forwardProcessingFees | boolean | false | none | Whether the processing fees are added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
» coupon | [Coupon] | false | none | Coupon to apply at checkout. |
»» name | string | true | none | Coupon code. |
»» percentOff | number | false | none | Discount percentage. Required if amountOff is not applied. |
»» amountOff | number | false | none | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
»» redemptions | number | false | none | Limit the total number of times coupon can be redeemed. |
»» redeemBy | number | false | none | Expiry date of the coupon as Unix epoch format. |
» displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
» displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
» enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
» additionalFields | [AdditionalFields] | false | none | Additional fields in the payment link. |
»» label | string | true | none | Label of the additional field. |
»» type | string | true | none | Type of the additional field. |
»» isRequired | boolean | false | none | Whether the field is required or not. |
»» displayOnReceipt | boolean | false | none | Whether the field is displayed on receipt or not. |
»» option | [string] | false | none | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
»» isHidden | boolean | false | none | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
»» hiddenFieldValue | string | false | none | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Property | Value |
---|---|
type | onetime |
type | recurring |
type | paymentplan |
type | multipleproducts |
type | customplan |
type | paywhatyouwant |
interval | day |
interval | week |
interval | month |
interval | year |
interval | day |
interval | week |
interval | month |
interval | year |
interval | day |
interval | week |
interval | month |
interval | year |
interval | day |
interval | week |
interval | month |
interval | year |
type | Textfield |
type | TextArea |
type | Dropdown |
type | Radio |
type | Checkbox |
Returns payment link by id
Code samples
# You can also use wget
curl -X GET https://api.payfunnels.com/v1/paymentlinks/{id} \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY'
GET https://api.payfunnels.com/v1/paymentlinks/{id} HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
const headers = {
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/paymentlinks/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.get 'https://api.payfunnels.com/v1/paymentlinks/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.get('https://api.payfunnels.com/v1/paymentlinks/{id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.payfunnels.com/v1/paymentlinks/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/paymentlinks/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.payfunnels.com/v1/paymentlinks/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/paymentlinks/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
Example responses
200 Response
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"type": "onetime",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"numberOfPayments": 1,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
},
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetches payment link by id. | PaymentLinkByIdResponse |
OAuth
Get OAuth Access Token
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/oauth/token \
-H 'Accept: application/json' \
-H 'clientid: string' \
-H 'clientsecret: string'
POST https://api.payfunnels.com/v1/oauth/token HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
clientid: string
clientsecret: string
const headers = {
'Accept':'application/json',
'clientid':'string',
'clientsecret':'string'
};
fetch('https://api.payfunnels.com/v1/oauth/token',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'clientid' => 'string',
'clientsecret' => 'string'
}
result = RestClient.post 'https://api.payfunnels.com/v1/oauth/token',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'clientid': 'string',
'clientsecret': 'string'
}
r = requests.post('https://api.payfunnels.com/v1/oauth/token', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'clientid' => 'string',
'clientsecret' => 'string',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/oauth/token', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/oauth/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"clientid": []string{"string"},
"clientsecret": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/oauth/token", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/oauth/token
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
clientid | header | string | true | Client ID |
clientsecret | header | string | true | Client Secret |
Example responses
200 Response
{
"accessToken": "access_token",
"refreshToken": "refresh_token"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns OAuth access token. | OAuthTokenResponse |
Refresh OAuth Access Token
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/oauth/refreshtoken \
-H 'Accept: application/json' \
-H 'Authorization: string'
POST https://api.payfunnels.com/v1/oauth/refreshtoken HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
Authorization: string
const headers = {
'Accept':'application/json',
'Authorization':'string'
};
fetch('https://api.payfunnels.com/v1/oauth/refreshtoken',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'string'
}
result = RestClient.post 'https://api.payfunnels.com/v1/oauth/refreshtoken',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'string'
}
r = requests.post('https://api.payfunnels.com/v1/oauth/refreshtoken', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'string',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/oauth/refreshtoken', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/oauth/refreshtoken");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/oauth/refreshtoken", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/oauth/refreshtoken
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
Authorization | header | string | true | Pass the refresh token in the authorization header as Bearer refreshToken |
Example responses
200 Response
{
"accessToken": "access_token",
"refreshToken": "refresh_token"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns new OAuth access token and refresh token. | OAuthTokenResponse |
Payments
Returns list of payments
Code samples
# You can also use wget
curl -X GET "https://api.payfunnels.com/v1/payments?page=1&limit=10" \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY'
GET https://api.payfunnels.com/v1/payments HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
const headers = {
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/payments',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.get 'https://api.payfunnels.com/v1/payments',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.get('https://api.payfunnels.com/v1/payments', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.payfunnels.com/v1/payments', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/payments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.payfunnels.com/v1/payments", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/payments
Fetches all payments. Default returns 25 records, pass limit and page in query parameters for more records.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | number | false | none |
limit | query | number | false | none |
Example responses
200 Response
[
{
"id": "ch_4ag6yhiu8oi",
"title": "Payment Title",
"description": "Payment Description",
"totalAmountPaid": 10,
"currencyCode": "USD",
"status": "succeeded",
"taxAmount": 10,
"setupFeeAmount": 10,
"processingFeeAmount": 10,
"refundAmount": 10,
"coupon": {
"name": "COUPON_CODE",
"amountOff": 10,
"percentOff": 10,
"amountApplied": 10
},
"quantity": 1,
"cardLast4": "4321",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"shippingAddress": {},
"billingAddress": {},
"createdAt": "07-01-2025",
"metadata": {}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetches all payments. | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [PaymentsResponse] | false | none | none |
» id | string | true | none | Payment ID. |
» title | string | true | none | Payment title. |
» description | string | true | none | Payment description. |
» totalAmountPaid | number | true | none | Payment amount. |
» currencyCode | string | true | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment. |
» status | string | true | none | Status of the payment. |
» taxAmount | number | true | none | Tax amount of the payment. |
» setupFeeAmount | number | true | none | Setup fee amount of the payment. |
» processingFeeAmount | number | true | none | Processing fee amount of the payment. |
» refundAmount | number | true | none | Refund amount of the payment. |
» coupon | PaymentCoupon | true | none | Amount off given on the payment. |
»» name | string | true | none | Coupon code. |
»» amountOff | number | false | none | Amount off given on the payment. |
»» percentOff | number | false | none | Percentage off given on the payment. |
»» amountApplied | number | true | none | Amount applied on the payment. |
» quantity | number | true | none | Quantity of payment. |
» cardLast4 | string | true | none | Last 4 digits of card used for payment. |
» customer | Customer | true | none | Customer of payment. |
»» name | string | true | none | Name of the customer. |
string | true | none | Email of the customer. | |
» shippingAddress | object | true | none | Shipping address of payment. |
» billingAddress | object | true | none | Billing address of payment. |
» createdAt | string | true | none | Payment created date. Format: MM-DD-YYYY . |
» metadata | object | true | none | Metadata of payment. |
Returns payment by Id
Code samples
# You can also use wget
curl -X GET https://api.payfunnels.com/v1/payments/{id} \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY'
GET https://api.payfunnels.com/v1/payments/{id} HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
const headers = {
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/payments/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.get 'https://api.payfunnels.com/v1/payments/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.get('https://api.payfunnels.com/v1/payments/{id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.payfunnels.com/v1/payments/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/payments/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.payfunnels.com/v1/payments/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/payments/{id}
Fetch particular payment by Id.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
Example responses
200 Response
{
"id": "ch_4ag6yhiu8oi",
"title": "Payment Title",
"description": "Payment Description",
"totalAmountPaid": 10,
"currencyCode": "USD",
"status": "succeeded",
"taxAmount": 10,
"setupFeeAmount": 10,
"processingFeeAmount": 10,
"refundAmount": 10,
"coupon": {
"name": "COUPON_CODE",
"amountOff": 10,
"percentOff": 10,
"amountApplied": 10
},
"quantity": 1,
"cardLast4": "4321",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"shippingAddress": {},
"billingAddress": {},
"createdAt": "07-01-2025",
"metadata": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetch payment by Id. | PaymentsResponse |
Refund payment
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/payments/refund \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"id": "ch_3RkgPv.........",
"amount”: 10,
"reason": "requested_by_customer"
}'
POST https://api.payfunnels.com/v1/payments/refund HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"id": "ch_3RkgPv.........",
"amount": 99.99,
"reason": "requested_by_customer"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/payments/refund',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/payments/refund',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/payments/refund', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/payments/refund', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/payments/refund");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/payments/refund", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/payments/refund
Body parameter
{
"id": "ch_3RkgPv.........",
"amount": 99.99,
"reason": "requested_by_customer"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | RefundPayment | true | none |
» id | body | string | true | The ID of the payment to refund. |
» amount | body | number | true | The amount to refund in the smallest currency unit (e.g., cents for USD). |
» reason | body | string | true | Reason for the refund. Allowed values: duplicate, fraudulent, requested_by_customer. |
Enumerated Values
Parameter | Value |
---|---|
» reason | duplicate |
» reason | fraudulent |
» reason | requested_by_customer |
Example responses
200 Response
{
"id": "ch_4ag6yhiu8oi",
"title": "Payment Title",
"description": "Payment Description",
"totalAmountPaid": 10,
"currencyCode": "USD",
"status": "succeeded",
"taxAmount": 10,
"setupFeeAmount": 10,
"processingFeeAmount": 10,
"refundAmount": 10,
"coupon": {
"name": "COUPON_CODE",
"amountOff": 10,
"percentOff": 10,
"amountApplied": 10
},
"quantity": 1,
"cardLast4": "4321",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"shippingAddress": {},
"billingAddress": {},
"createdAt": "07-01-2025",
"metadata": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Refund payment. | PaymentsResponse |
Subscriptions
Returns list of subscriptions
Code samples
# You can also use wget
curl -X GET "https://api.payfunnels.com/v1/subscriptions?page=1&limit=10" \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY'
GET https://api.payfunnels.com/v1/subscriptions HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
const headers = {
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/subscriptions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.get 'https://api.payfunnels.com/v1/subscriptions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.get('https://api.payfunnels.com/v1/subscriptions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.payfunnels.com/v1/subscriptions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/subscriptions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.payfunnels.com/v1/subscriptions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/subscriptions
Fetches all subscriptions. Default returns 25 records, pass limit and page in query parameters for more records.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | number | false | none |
limit | query | number | false | none |
Example responses
200 Response
[
{
"id": "sub_1RjHOY...",
"amount": 10,
"startDate": "07-01-2025",
"endDate": "07-01-2025",
"title": "Subscription Title",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"status": "active",
"paymentMethod": {
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
},
"createdAt": "07-01-2025",
"metadata": {}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetches all subscriptions. | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [SubscriptionsResponse] | false | none | none |
» id | string | true | none | Subscription ID. |
» amount | number | true | none | Subscription amount. |
» startDate | string | true | none | Subscription start date. Format: MM-DD-YYYY . |
» endDate | string | false | none | Subscription end date. Only avaialble for paymentplan type subscriptions. Format: MM-DD-YYYY . |
» title | string | true | none | Subscription title. |
» customer | Customer | true | none | Customer of subscription. |
»» name | string | true | none | Name of the customer. |
string | true | none | Email of the customer. | |
» status | string | true | none | Status of the subscription. |
» paymentMethod | PaymentMethod | true | none | Payment method of subscription. |
»» type | string | true | none | Payment method type. |
»» card | CardPaymentMethod | true | none | Card payment method. |
»»» brand | string | true | none | Brand of the card. |
»»» last4 | string | true | none | Last 4 digits of the card. |
»»» exp_month | number | true | none | Expiration month of the card. |
»»» exp_year | number | true | none | Expiration year of the card. |
»»» country | string | true | none | Country of the card. |
» createdAt | string | true | none | Subscription created date. Format: MM-DD-YYYY . |
» metadata | object | true | none | Metadata of subscription. |
Returns subscription by Id
Code samples
# You can also use wget
curl -X GET https://api.payfunnels.com/v1/subscriptions/{id} \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY'
GET https://api.payfunnels.com/v1/subscriptions/{id} HTTP/1.1
Host: api.payfunnels.com
Accept: application/json
const headers = {
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/subscriptions/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.get 'https://api.payfunnels.com/v1/subscriptions/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.get('https://api.payfunnels.com/v1/subscriptions/{id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.payfunnels.com/v1/subscriptions/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/subscriptions/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.payfunnels.com/v1/subscriptions/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/subscriptions/{id}
Fetch particular subscription by Id.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
Example responses
200 Response
{
"id": "sub_1RjHOY...",
"amount": 10,
"startDate": "07-01-2025",
"endDate": "07-01-2025",
"title": "Subscription Title",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"status": "active",
"paymentMethod": {
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
},
"createdAt": "07-01-2025",
"metadata": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetch subscription by Id. | SubscriptionsResponse |
Cancel Subscription
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/subscriptions/cancel \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"id": "sub_1RjHOY...",
"cancellationOption": "immediate",
}'
POST https://api.payfunnels.com/v1/subscriptions/cancel HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"id": "sub_1RjHOY...",
"cancellationOption": "immediate",
"cancelDate": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/subscriptions/cancel',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/subscriptions/cancel',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/subscriptions/cancel', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/subscriptions/cancel', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/subscriptions/cancel");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/subscriptions/cancel", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/subscriptions/cancel
Body parameter
{
"id": "sub_1RjHOY...",
"cancellationOption": "immediate",
"cancelDate": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CancelSubscription | true | none |
» id | body | string | true | ID of the subscription to cancel. |
» cancellationOption | body | string | true | Specifies when the subscription should be canceled: immediately, at the end of the billing period, or on a custom date. |
» cancelDate | body | number | false | Unix timestamp which required only if cancellation option is custom_date. |
Enumerated Values
Parameter | Value |
---|---|
» cancellationOption | immediate |
» cancellationOption | end_of_the_period |
» cancellationOption | custom_date |
Example responses
200 Response
{
"id": "sub_1RjHOY...",
"amount": 10,
"startDate": "07-01-2025",
"endDate": "07-01-2025",
"title": "Subscription Title",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"status": "active",
"paymentMethod": {
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
},
"createdAt": "07-01-2025",
"metadata": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Cancel subscription. | SubscriptionsResponse |
Pause Subscription
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/subscriptions/pause \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"id": "sub_1RjHOY...",
"behavior": "offering_service_for_free",
}'
POST https://api.payfunnels.com/v1/subscriptions/pause HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"id": "sub_1RjHOY...",
"behavior": "offering_service_for_free",
"resumeAt": 0,
"chargeUnpaidInvoice": false
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/subscriptions/pause',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/subscriptions/pause',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/subscriptions/pause', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/subscriptions/pause', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/subscriptions/pause");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/subscriptions/pause", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/subscriptions/pause
Body parameter
{
"id": "sub_1RjHOY...",
"behavior": "offering_service_for_free",
"resumeAt": 0,
"chargeUnpaidInvoice": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | PauseSubscription | true | none |
» id | body | string | true | Subscription ID. |
» behavior | body | string | true | Indicates how a paused subscription behaves: without service, with free service, or temporarily pause. |
» resumeAt | body | number | false | UNIX timestamp to resume automatically. Omit for manual resume. |
» chargeUnpaidInvoice | body | boolean | false | Charge unpaid invoices when resuming from a temporary pause. Defaults to false. |
Enumerated Values
Parameter | Value |
---|---|
» behavior | not_offering_service |
» behavior | offering_service_for_free |
» behavior | temporary_pause_subscription |
Example responses
200 Response
{
"id": "sub_1RjHOY...",
"amount": 10,
"startDate": "07-01-2025",
"endDate": "07-01-2025",
"title": "Subscription Title",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"status": "active",
"paymentMethod": {
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
},
"createdAt": "07-01-2025",
"metadata": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Pause subscription. | SubscriptionsResponse |
Resume Subscription
Code samples
# You can also use wget
curl -X POST https://api.payfunnels.com/v1/subscriptions/resume \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-pf-api-key: API_KEY' \
-d '{
"id": "sub_1RjHOY...",
}'
POST https://api.payfunnels.com/v1/subscriptions/resume HTTP/1.1
Host: api.payfunnels.com
Content-Type: application/json
Accept: application/json
const inputBody = '{
"id": "sub_1RjHOY..."
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-pf-api-key':'API_KEY'
};
fetch('https://api.payfunnels.com/v1/subscriptions/resume',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY'
}
result = RestClient.post 'https://api.payfunnels.com/v1/subscriptions/resume',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-pf-api-key': 'API_KEY'
}
r = requests.post('https://api.payfunnels.com/v1/subscriptions/resume', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'x-pf-api-key' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.payfunnels.com/v1/subscriptions/resume', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.payfunnels.com/v1/subscriptions/resume");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"x-pf-api-key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.payfunnels.com/v1/subscriptions/resume", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/subscriptions/resume
Body parameter
{
"id": "sub_1RjHOY..."
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ResumeSubscription | true | none |
» id | body | string | true | ID of the subscription to resume. |
Example responses
200 Response
{
"id": "sub_1RjHOY...",
"amount": 10,
"startDate": "07-01-2025",
"endDate": "07-01-2025",
"title": "Subscription Title",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"status": "active",
"paymentMethod": {
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
},
"createdAt": "07-01-2025",
"metadata": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resume subscription. | SubscriptionsResponse |
Schemas
Coupon
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Coupon code. |
percentOff | number | false | none | Discount percentage. Required if amountOff is not applied. |
amountOff | number | false | none | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
redemptions | number | false | none | Limit the total number of times coupon can be redeemed. |
redeemBy | number | false | none | Expiry date of the coupon as Unix epoch format. |
AdditionalFields
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
label | string | true | none | Label of the additional field. |
type | string | true | none | Type of the additional field. |
isRequired | boolean | false | none | Whether the field is required or not. |
displayOnReceipt | boolean | false | none | Whether the field is displayed on receipt or not. |
option | [string] | false | none | Applicable for Dropdown and Radio field types only. For Dropdown , pass an array of (e.g., ["Option1", "Option2"] ) to define selectable options. For Radio , pass an array of strings (e.g., ["Radio1", "Radio2"] ) to define radio button choices. Leave empty for other types like Textfield , TextArea , and Checkbox . |
isHidden | boolean | false | none | Only applicable for Textfield . If set to true , the field is hidden and pre-filled. |
hiddenFieldValue | string | false | none | Only applicable for Textfield when isHidden is true . This is the pre-filled hidden value. |
Enumerated Values
Property | Value |
---|---|
type | Textfield |
type | TextArea |
type | Dropdown |
type | Radio |
type | Checkbox |
CreateOneTimePaymentLink
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
amount | number | true | none | One time payment link amount. |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
coupon | [Coupon] | false | none | Coupon to apply at checkout. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields to be added to the payment link. |
CouponResponse
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Coupon code. |
percentOff | number | false | none | Discount percentage. |
amountOff | number | false | none | Fixed discount amount. |
redemptions | number | false | none | Total redemption limit. |
redeemBy | number | false | none | Expiry date as Unix epoch. |
OneTimePaymentLinkResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"amount": 49.99,
"type": "onetime"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Unique identifier of the payment link. |
url | string | true | none | URL of the payment link. |
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
isTaxable | boolean | false | none | Whether taxable. |
forwardProcessingFees | boolean | false | none | Whether processing fees are forwarded. |
displayBillingAddress | boolean | false | none | Prompt for billing address. |
displayShippingAddress | boolean | false | none | Prompt for shipping address. |
enableTermOfService | boolean | false | none | Require terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields. |
coupon | [CouponResponse] | false | none | Coupons. |
amount | number | true | none | Payment amount. |
type | string | true | none | Type of payment link. |
RecurringPaymentLinkCoupon
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Coupon code. |
percentOff | number | false | none | Discount percentage. Required if amountOff is not applied. |
amountOff | number | false | none | Fixed discount amount. Required if percentOff is not applied. Can not be greater than the amount of the payment link. |
redemptions | number | false | none | Limit the total number of times coupon can be redeemed. |
redeemBy | number | false | none | Expiry date of the coupon as Unix epoch format. |
duration | string | false | none | Duration of the coupon. It can be of forever , once or number of months for which the coupon can be redeemed. |
Enumerated Values
Property | Value |
---|---|
duration | forever |
duration | once |
duration | 1 |
CreateRecurringPaymentLink
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
amount | number | true | none | Recurring payment link amount. |
interval | string | true | none | Interval of product. It can be of day , week , month , year . |
trialDays | number | false | none | Trial period in days for this product. Must be grater than 2 days |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
coupon | [RecurringPaymentLinkCoupon] | false | none | Coupon to apply at checkout. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields to be added to the payment link. |
Enumerated Values
Property | Value |
---|---|
interval | day |
interval | week |
interval | month |
interval | year |
RecurringCouponResponse
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Coupon code. |
percentOff | number | false | none | Discount percentage. |
amountOff | number | false | none | Fixed discount amount. |
redemptions | number | false | none | Total redemption limit. |
redeemBy | number | false | none | Expiry date as Unix epoch. |
duration | string | false | none | Duration of the coupon. It can be of forever, once or number of months for which the coupon can be redeemed. |
Enumerated Values
Property | Value |
---|---|
duration | forever |
duration | once |
duration | 1 |
RecurringPaymentLinkResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"type": "recurring"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Unique identifier of the payment link. |
url | string | true | none | URL of the payment link. |
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
isTaxable | boolean | false | none | Whether taxable. |
forwardProcessingFees | boolean | false | none | Whether processing fees are forwarded. |
displayBillingAddress | boolean | false | none | Prompt for billing address. |
displayShippingAddress | boolean | false | none | Prompt for shipping address. |
enableTermOfService | boolean | false | none | Require terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields. |
coupon | [RecurringCouponResponse] | false | none | Coupons for recurring. |
amount | number | true | none | Payment amount. |
interval | string | true | none | Interval: day , week , month , year . |
trialDays | number | false | none | Trial period in days. Must be greater than 2. |
type | string | true | none | Type of payment link. |
CreatePaymentPlanPaymentLink
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"numberOfPayments": 1,
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
amount | number | true | none | Payment plan amount. |
interval | string | true | none | Interval of product. It can be of day , week , month , year . |
numberOfPayments | number | true | none | Number of payments to be taken before subscription cancels. Applicable only for payment type. |
trialDays | number | false | none | Trial period for this product. Must be grater than 2 days |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. Cannot be used while setup fees is set to true . |
coupon | [RecurringPaymentLinkCoupon] | false | none | Coupon to apply at checkout. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields to be added to the payment link. |
Enumerated Values
Property | Value |
---|---|
interval | day |
interval | week |
interval | month |
interval | year |
PaymentPlanPaymentLinkResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"amount": 49.99,
"interval": "month",
"trialDays": 1,
"type": "paymentplan",
"numberOfPayments": 2
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Unique identifier of the payment link. |
url | string | true | none | URL of the payment link. |
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
isTaxable | boolean | false | none | Whether taxable. |
forwardProcessingFees | boolean | false | none | Whether processing fees are forwarded. |
displayBillingAddress | boolean | false | none | Prompt for billing address. |
displayShippingAddress | boolean | false | none | Prompt for shipping address. |
enableTermOfService | boolean | false | none | Require terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields. |
coupon | [CouponResponse] | false | none | Coupons. |
amount | number | true | none | Payment amount. |
interval | string | true | none | Interval: day , week , month , year . |
trialDays | number | false | none | Trial period in days. Must be greater than 2. |
type | string | true | none | Type of payment link. |
numberOfPayments | number | true | none | Number of payments. |
Recurring
{
"interval": "month"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
interval | string | true | none | Interval of product. It can be of day , week , month , year . |
Enumerated Values
Property | Value |
---|---|
interval | day |
interval | week |
interval | month |
interval | year |
PaymentPlan
{
"interval": "month",
"numberOfPayments": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
interval | string | true | none | Interval of product. It can be of day , week , month , year . |
numberOfPayments | number | true | none | Number of payments. |
Enumerated Values
Property | Value |
---|---|
interval | day |
interval | week |
interval | month |
interval | year |
PaymentLinkMultipleProducts
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Name of product. |
description | string | true | none | Detailed description of product. |
amount | number | true | none | Amount of product. |
recurring | Recurring | false | none | Recurring configuration. |
paymentPlan | PaymentPlan | false | none | Payment plan configuration. |
CreateMultipleProductsPaymentLink
{
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"allowMultipleSelection": false,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"trialDays": 1,
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1,
"duration": "forever"
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
allowMultipleSelection | boolean | true | none | Whether the multiple selection is allowed or not. Default is false . If true , the multiple product selection will be allowed. If true then interval of recurring or paymentPlan must be same .It will be treated false if products with recurring and paymentplan both are passed. |
products | [PaymentLinkMultipleProducts] | true | none | Multiple products to be added to the payment link. If recurring or paymentplan is not passed then it will be treated as onetime . |
trialDays | number | false | none | Trial period for this product. Must be grater than 2 days |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
coupon | [RecurringPaymentLinkCoupon] | false | none | Coupon to apply at checkout. Not compatible when both recurring and paymentplan is passed. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields to be added to the payment link. |
MultipleProductsPaymentLinkResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"type": "multipleproducts",
"allowMultipleSelection": false,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"trialDays": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Unique identifier of the payment link. |
url | string | true | none | URL of the payment link. |
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
isTaxable | boolean | false | none | Whether taxable. |
forwardProcessingFees | boolean | false | none | Whether processing fees are forwarded. |
displayBillingAddress | boolean | false | none | Prompt for billing address. |
displayShippingAddress | boolean | false | none | Prompt for shipping address. |
enableTermOfService | boolean | false | none | Require terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields. |
coupon | [CouponResponse] | false | none | Coupons. |
type | string | true | none | Type of payment link. |
allowMultipleSelection | boolean | true | none | Whether the multiple selection is allowed or not. Default is false . If true , the multiple product selection will be allowed. If true then interval of recurring or paymentPlan must be same .It will be treated false if products with recurring and paymentplan both are passed. |
products | [PaymentLinkMultipleProducts] | true | none | Multiple products to be added to the payment link. If recurring or paymentplan is not passed then it will be treated as onetime . |
trialDays | number | false | none | Trial period. |
ChargePhases
{
"amount": 49.99,
"delayInDays": 10
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
amount | number | true | none | Amount to be charged in this phase. |
delayInDays | number | true | none | Time to wait before this phase (in days). |
FinalChargePhase
{
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
delayInDays | number | true | none | Delay before final phase (in days). |
amount | number | true | none | Amount for final recurring charge phase. |
recurring | Recurring | false | none | Recurring configuration. |
paymentPlan | PaymentPlan | false | none | Payment plan structure. |
PaymentSchedule
{
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
chargePhases | [ChargePhases] | false | none | Charge phases. Maximum 3 phases are allowed. |
finalChargePhase | FinalChargePhase | true | none | Final recurring charge phase. Any one from onetime , recurring or paymentplan is required. |
CreateCustomPlanPaymentLink
{
"title": "Custom Plan Payment Link",
"description": "Custom plan payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
},
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | true | none | Custom plan payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
amount | number | true | none | Amount of payment link. This amount will be charged immediately. |
paymentSchedule | PaymentSchedule | true | none | Defines payment schedule. |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields to be added to the payment link. |
CustomPlanPaymentLinkResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"type": "customplan",
"amount": 49.99,
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Unique identifier of the payment link. |
url | string | true | none | URL of the payment link. |
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
isTaxable | boolean | false | none | Whether taxable. |
forwardProcessingFees | boolean | false | none | Whether processing fees are forwarded. |
displayBillingAddress | boolean | false | none | Prompt for billing address. |
displayShippingAddress | boolean | false | none | Prompt for shipping address. |
enableTermOfService | boolean | false | none | Require terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields. |
type | string | true | none | Type of payment link. |
amount | number | true | none | Payment amount. |
paymentSchedule | PaymentSchedule | false | none | Payment schedule. |
CreatePayWhatYouWantPaymentLink
{
"title": "Pay What You Want Payment Link",
"description": "Pay what you want payment link description.",
"currencyCode": "USD",
"allowOneTime": false,
"allowRecurring": false,
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | true | none | Pay what you want payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
allowOneTime | boolean | false | none | Whether the one-time payments are allowed or not. Default is true . If true , the one-time payments are allowed. |
allowRecurring | boolean | false | none | Whether the recurring payments are allowed or not. Default is false . If true , the recurring payments are allowed. |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees to be added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields to be added to the payment link. |
PayWhatYouWantPaymentLinkResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"description": "Payment link description.",
"currencyCode": "USD",
"isTaxable": false,
"forwardProcessingFees": false,
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
],
"type": "paywhatyouwant",
"allowOneTime": false,
"allowRecurring": false
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Unique identifier of the payment link. |
url | string | true | none | URL of the payment link. |
title | string | true | none | Payment link title. |
description | string | true | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
isTaxable | boolean | false | none | Whether taxable. |
forwardProcessingFees | boolean | false | none | Whether processing fees are forwarded. |
displayBillingAddress | boolean | false | none | Prompt for billing address. |
displayShippingAddress | boolean | false | none | Prompt for shipping address. |
enableTermOfService | boolean | false | none | Require terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields. |
type | string | true | none | Type of payment link. |
allowOneTime | boolean | false | none | Allow one time payments. |
allowRecurring | boolean | false | none | Allow recurring payments. |
PaymentLinkByIdResponse
{
"id": "sb6bsuf72mf9lzc9",
"url": "https://pfnl.co/52g3f0ht",
"title": "Payment Link",
"type": "onetime",
"description": "Payment link description.",
"currencyCode": "USD",
"amount": 49.99,
"interval": "month",
"numberOfPayments": 1,
"products": [
{
"name": "Product",
"description": "Product description.",
"amount": 49.99,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
],
"paymentSchedule": {
"chargePhases": [
{
"amount": 49.99,
"delayInDays": 10
}
],
"finalChargePhase": {
"delayInDays": 10,
"amount": 50,
"recurring": {
"interval": "month"
},
"paymentPlan": {
"interval": "month",
"numberOfPayments": 1
}
}
},
"isTaxable": false,
"forwardProcessingFees": false,
"coupon": [
{
"name": "COUPON_CODE",
"percentOff": 1,
"amountOff": 1,
"redemptions": 1,
"redeemBy": 1
}
],
"displayBillingAddress": false,
"displayShippingAddress": false,
"enableTermOfService": false,
"additionalFields": [
{
"label": "string",
"type": "Textfield",
"isRequired": false,
"displayOnReceipt": false,
"option": [
"string"
],
"isHidden": true,
"hiddenFieldValue": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | Unique identifier of the payment link. |
url | string | false | none | Payment link URL. |
title | string | false | none | Payment link title. |
type | string | false | none | Payment link type. |
description | string | false | none | Detailed description of payment link. |
currencyCode | string | false | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment link. |
amount | number | false | none | One time payment link amount. |
interval | string | false | none | Interval of product. It can be of day , week , month , year . |
numberOfPayments | number | false | none | Number of payments. |
products | [PaymentLinkMultipleProducts] | false | none | Multiple products in the payment link. |
paymentSchedule | PaymentSchedule | false | none | Payment schedule in the payment link. |
isTaxable | boolean | false | none | Whether the payment link is taxable or not. Default is false . If true , the default tax rate will be applied. |
forwardProcessingFees | boolean | false | none | Whether the processing fees are added to the payment link or not. Default is false . If true , the default processing fees will be added to the payment link. |
coupon | [Coupon] | false | none | Coupon to apply at checkout. |
displayBillingAddress | boolean | false | none | Prompt customer for billing address. |
displayShippingAddress | boolean | false | none | Prompt customer for shipping address. |
enableTermOfService | boolean | false | none | Require acceptance of terms of service. |
additionalFields | [AdditionalFields] | false | none | Additional fields in the payment link. |
Enumerated Values
Property | Value |
---|---|
type | onetime |
type | recurring |
type | paymentplan |
type | multipleproducts |
type | customplan |
type | paywhatyouwant |
OAuthTokenResponse
{
"accessToken": "access_token",
"refreshToken": "refresh_token"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
accessToken | string | true | none | Access Token. |
refreshToken | string | true | none | Refresh Token. |
PaymentCoupon
{
"name": "COUPON_CODE",
"amountOff": 10,
"percentOff": 10,
"amountApplied": 10
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Coupon code. |
amountOff | number | false | none | Amount off given on the payment. |
percentOff | number | false | none | Percentage off given on the payment. |
amountApplied | number | true | none | Amount applied on the payment. |
Customer
{
"name": "John Doe",
"email": "[email protected]"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Name of the customer. |
string | true | none | Email of the customer. |
PaymentsResponse
{
"id": "ch_4ag6yhiu8oi",
"title": "Payment Title",
"description": "Payment Description",
"totalAmountPaid": 10,
"currencyCode": "USD",
"status": "succeeded",
"taxAmount": 10,
"setupFeeAmount": 10,
"processingFeeAmount": 10,
"refundAmount": 10,
"coupon": {
"name": "COUPON_CODE",
"amountOff": 10,
"percentOff": 10,
"amountApplied": 10
},
"quantity": 1,
"cardLast4": "4321",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"shippingAddress": {},
"billingAddress": {},
"createdAt": "07-01-2025",
"metadata": {}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Payment ID. |
title | string | true | none | Payment title. |
description | string | true | none | Payment description. |
totalAmountPaid | number | true | none | Payment amount. |
currencyCode | string | true | none | Currency code in ISO 4217 format (e.g., USD, GBP) for the payment. |
status | string | true | none | Status of the payment. |
taxAmount | number | true | none | Tax amount of the payment. |
setupFeeAmount | number | true | none | Setup fee amount of the payment. |
processingFeeAmount | number | true | none | Processing fee amount of the payment. |
refundAmount | number | true | none | Refund amount of the payment. |
coupon | PaymentCoupon | true | none | Amount off given on the payment. |
quantity | number | true | none | Quantity of payment. |
cardLast4 | string | true | none | Last 4 digits of card used for payment. |
customer | Customer | true | none | Customer of payment. |
shippingAddress | object | true | none | Shipping address of payment. |
billingAddress | object | true | none | Billing address of payment. |
createdAt | string | true | none | Payment created date. Format: MM-DD-YYYY . |
metadata | object | true | none | Metadata of payment. |
RefundPayment
{
"id": "ch_3RkgPv.........",
"amount": 99.99,
"reason": "requested_by_customer"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | The ID of the payment to refund. |
amount | number | true | none | The amount to refund in the smallest currency unit (e.g., cents for USD). |
reason | string | true | none | Reason for the refund. Allowed values: duplicate, fraudulent, requested_by_customer. |
Enumerated Values
Property | Value |
---|---|
reason | duplicate |
reason | fraudulent |
reason | requested_by_customer |
CardPaymentMethod
{
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
brand | string | true | none | Brand of the card. |
last4 | string | true | none | Last 4 digits of the card. |
exp_month | number | true | none | Expiration month of the card. |
exp_year | number | true | none | Expiration year of the card. |
country | string | true | none | Country of the card. |
PaymentMethod
{
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
type | string | true | none | Payment method type. |
card | CardPaymentMethod | true | none | Card payment method. |
SubscriptionsResponse
{
"id": "sub_1RjHOY...",
"amount": 10,
"startDate": "07-01-2025",
"endDate": "07-01-2025",
"title": "Subscription Title",
"customer": {
"name": "John Doe",
"email": "[email protected]"
},
"status": "active",
"paymentMethod": {
"type": "string",
"card": {
"brand": "string",
"last4": "string",
"exp_month": 0,
"exp_year": 0,
"country": "string"
}
},
"createdAt": "07-01-2025",
"metadata": {}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Subscription ID. |
amount | number | true | none | Subscription amount. |
startDate | string | true | none | Subscription start date. Format: MM-DD-YYYY . |
endDate | string | false | none | Subscription end date. Only avaialble for paymentplan type subscriptions. Format: MM-DD-YYYY . |
title | string | true | none | Subscription title. |
customer | Customer | true | none | Customer of subscription. |
status | string | true | none | Status of the subscription. |
paymentMethod | PaymentMethod | true | none | Payment method of subscription. |
createdAt | string | true | none | Subscription created date. Format: MM-DD-YYYY . |
metadata | object | true | none | Metadata of subscription. |
CancelSubscription
{
"id": "sub_1RjHOY...",
"cancellationOption": "immediate",
"cancelDate": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | ID of the subscription to cancel. |
cancellationOption | string | true | none | Specifies when the subscription should be canceled: immediately, at the end of the billing period, or on a custom date. |
cancelDate | number | false | none | Unix timestamp which required only if cancellation option is custom_date. |
Enumerated Values
Property | Value |
---|---|
cancellationOption | immediate |
cancellationOption | end_of_the_period |
cancellationOption | custom_date |
PauseSubscription
{
"id": "sub_1RjHOY...",
"behavior": "offering_service_for_free",
"resumeAt": 0,
"chargeUnpaidInvoice": false
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Subscription ID. |
behavior | string | true | none | Indicates how a paused subscription behaves: without service, with free service, or temporarily pause. |
resumeAt | number | false | none | UNIX timestamp to resume automatically. Omit for manual resume. |
chargeUnpaidInvoice | boolean | false | none | Charge unpaid invoices when resuming from a temporary pause. Defaults to false. |
Enumerated Values
Property | Value |
---|---|
behavior | not_offering_service |
behavior | offering_service_for_free |
behavior | temporary_pause_subscription |
ResumeSubscription
{
"id": "sub_1RjHOY..."
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | ID of the subscription to resume. |