Skip to main content
POST
/
v0
/
billingSchedules
Create a billing schedule
curl --request POST \
  --url https://api.paygentic.io/v0/billingSchedules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "billingAnchor": "2023-11-07T05:31:56Z",
  "orderId": "<string>",
  "subscriptionId": "<string>",
  "paymentTermDays": 123,
  "customPeriodWindows": [
    "<unknown>"
  ],
  "metadata": {}
}
'
import requests

url = "https://api.paygentic.io/v0/billingSchedules"

payload = {
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"orderId": "<string>",
"subscriptionId": "<string>",
"paymentTermDays": 123,
"customPeriodWindows": ["<unknown>"],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z',
billingAnchor: '2023-11-07T05:31:56Z',
orderId: '<string>',
subscriptionId: '<string>',
paymentTermDays: 123,
customPeriodWindows: ['<unknown>'],
metadata: {}
})
};

fetch('https://api.paygentic.io/v0/billingSchedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/billingSchedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z',
'billingAnchor' => '2023-11-07T05:31:56Z',
'orderId' => '<string>',
'subscriptionId' => '<string>',
'paymentTermDays' => 123,
'customPeriodWindows' => [
'<unknown>'
],
'metadata' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.paygentic.io/v0/billingSchedules"

payload := strings.NewReader("{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"billingAnchor\": \"2023-11-07T05:31:56Z\",\n \"orderId\": \"<string>\",\n \"subscriptionId\": \"<string>\",\n \"paymentTermDays\": 123,\n \"customPeriodWindows\": [\n \"<unknown>\"\n ],\n \"metadata\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.paygentic.io/v0/billingSchedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"billingAnchor\": \"2023-11-07T05:31:56Z\",\n \"orderId\": \"<string>\",\n \"subscriptionId\": \"<string>\",\n \"paymentTermDays\": 123,\n \"customPeriodWindows\": [\n \"<unknown>\"\n ],\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v0/billingSchedules")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"billingAnchor\": \"2023-11-07T05:31:56Z\",\n \"orderId\": \"<string>\",\n \"subscriptionId\": \"<string>\",\n \"paymentTermDays\": 123,\n \"customPeriodWindows\": [\n \"<unknown>\"\n ],\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "object": "billing_schedule",
  "merchantId": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "billingAnchor": "2023-11-07T05:31:56Z",
  "customPeriodWindows": [
    "<unknown>"
  ],
  "metadata": {},
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "orderId": "<string>",
  "subscriptionId": "<string>",
  "paymentTermDays": 123,
  "deletedAt": "2023-11-07T05:31:56Z"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json
startDate
string<date-time>
required
endDate
string<date-time>
required
billingAnchor
string<date-time>
required
orderId
string
subscriptionId
string
alignmentPolicy
enum<string>
Available options:
anchor,
calendar,
coterm
prorationPolicy
enum<string>
Available options:
none,
daily
paymentTermDays
integer | null
periodPreset
enum<string>
Available options:
single,
P1M,
P3M,
P6M,
P1Y,
custom
customPeriodWindows
any[]
metadata
object

Response

BillingSchedule created

id
string
required
object
enum<string>
required
Available options:
billing_schedule
merchantId
string
required
status
enum<string>
required
Available options:
draft,
active,
completed,
cancelled
startDate
string<date-time>
required
endDate
string<date-time>
required
billingAnchor
string<date-time>
required
alignmentPolicy
enum<string>
required
Available options:
anchor,
calendar,
coterm
prorationPolicy
enum<string>
required
Available options:
none,
daily
periodPreset
enum<string>
required
Available options:
single,
P1M,
P3M,
P6M,
P1Y,
custom
customPeriodWindows
any[]
required
metadata
object
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
orderId
string | null
subscriptionId
string | null
paymentTermDays
integer | null
deletedAt
string<date-time> | null