Skip to main content
PUT
/
v0
/
billingSchedules
/
{id}
/
intervals
Replace schedule intervals
curl --request PUT \
  --url https://api.paygentic.io/v0/billingSchedules/{id}/intervals \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "intervals": [
    {
      "baseQuantity": "<string>",
      "billingCadence": "<string>",
      "startDate": "2023-11-07T05:31:56Z",
      "endDate": "2023-11-07T05:31:56Z",
      "orderLineItemId": "<string>",
      "itemId": "<string>",
      "priceId": "<string>",
      "description": "<string>",
      "unitPrice": "<string>",
      "quantityTransitions": [
        {
          "effectiveDate": "2023-11-07T05:31:56Z",
          "quantity": "<string>"
        }
      ],
      "billDate": "2023-11-07T05:31:56Z",
      "usageFilter": {},
      "metadata": {}
    }
  ],
  "orderLineItemId": "<string>"
}
'
import requests

url = "https://api.paygentic.io/v0/billingSchedules/{id}/intervals"

payload = {
    "intervals": [
        {
            "baseQuantity": "<string>",
            "billingCadence": "<string>",
            "startDate": "2023-11-07T05:31:56Z",
            "endDate": "2023-11-07T05:31:56Z",
            "orderLineItemId": "<string>",
            "itemId": "<string>",
            "priceId": "<string>",
            "description": "<string>",
            "unitPrice": "<string>",
            "quantityTransitions": [
                {
                    "effectiveDate": "2023-11-07T05:31:56Z",
                    "quantity": "<string>"
                }
            ],
            "billDate": "2023-11-07T05:31:56Z",
            "usageFilter": {},
            "metadata": {}
        }
    ],
    "orderLineItemId": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    intervals: [
      {
        baseQuantity: '<string>',
        billingCadence: '<string>',
        startDate: '2023-11-07T05:31:56Z',
        endDate: '2023-11-07T05:31:56Z',
        orderLineItemId: '<string>',
        itemId: '<string>',
        priceId: '<string>',
        description: '<string>',
        unitPrice: '<string>',
        quantityTransitions: [{effectiveDate: '2023-11-07T05:31:56Z', quantity: '<string>'}],
        billDate: '2023-11-07T05:31:56Z',
        usageFilter: {},
        metadata: {}
      }
    ],
    orderLineItemId: '<string>'
  })
};

fetch('https://api.paygentic.io/v0/billingSchedules/{id}/intervals', 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/{id}/intervals",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'intervals' => [
        [
                'baseQuantity' => '<string>',
                'billingCadence' => '<string>',
                'startDate' => '2023-11-07T05:31:56Z',
                'endDate' => '2023-11-07T05:31:56Z',
                'orderLineItemId' => '<string>',
                'itemId' => '<string>',
                'priceId' => '<string>',
                'description' => '<string>',
                'unitPrice' => '<string>',
                'quantityTransitions' => [
                                [
                                                                'effectiveDate' => '2023-11-07T05:31:56Z',
                                                                'quantity' => '<string>'
                                ]
                ],
                'billDate' => '2023-11-07T05:31:56Z',
                'usageFilter' => [
                                
                ],
                'metadata' => [
                                
                ]
        ]
    ],
    'orderLineItemId' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

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

curl_close($curl);

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

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

func main() {

	url := "https://api.paygentic.io/v0/billingSchedules/{id}/intervals"

	payload := strings.NewReader("{\n  \"intervals\": [\n    {\n      \"baseQuantity\": \"<string>\",\n      \"billingCadence\": \"<string>\",\n      \"startDate\": \"2023-11-07T05:31:56Z\",\n      \"endDate\": \"2023-11-07T05:31:56Z\",\n      \"orderLineItemId\": \"<string>\",\n      \"itemId\": \"<string>\",\n      \"priceId\": \"<string>\",\n      \"description\": \"<string>\",\n      \"unitPrice\": \"<string>\",\n      \"quantityTransitions\": [\n        {\n          \"effectiveDate\": \"2023-11-07T05:31:56Z\",\n          \"quantity\": \"<string>\"\n        }\n      ],\n      \"billDate\": \"2023-11-07T05:31:56Z\",\n      \"usageFilter\": {},\n      \"metadata\": {}\n    }\n  ],\n  \"orderLineItemId\": \"<string>\"\n}")

	req, _ := http.NewRequest("PUT", 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.put("https://api.paygentic.io/v0/billingSchedules/{id}/intervals")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"intervals\": [\n    {\n      \"baseQuantity\": \"<string>\",\n      \"billingCadence\": \"<string>\",\n      \"startDate\": \"2023-11-07T05:31:56Z\",\n      \"endDate\": \"2023-11-07T05:31:56Z\",\n      \"orderLineItemId\": \"<string>\",\n      \"itemId\": \"<string>\",\n      \"priceId\": \"<string>\",\n      \"description\": \"<string>\",\n      \"unitPrice\": \"<string>\",\n      \"quantityTransitions\": [\n        {\n          \"effectiveDate\": \"2023-11-07T05:31:56Z\",\n          \"quantity\": \"<string>\"\n        }\n      ],\n      \"billDate\": \"2023-11-07T05:31:56Z\",\n      \"usageFilter\": {},\n      \"metadata\": {}\n    }\n  ],\n  \"orderLineItemId\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v0/billingSchedules/{id}/intervals")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"intervals\": [\n    {\n      \"baseQuantity\": \"<string>\",\n      \"billingCadence\": \"<string>\",\n      \"startDate\": \"2023-11-07T05:31:56Z\",\n      \"endDate\": \"2023-11-07T05:31:56Z\",\n      \"orderLineItemId\": \"<string>\",\n      \"itemId\": \"<string>\",\n      \"priceId\": \"<string>\",\n      \"description\": \"<string>\",\n      \"unitPrice\": \"<string>\",\n      \"quantityTransitions\": [\n        {\n          \"effectiveDate\": \"2023-11-07T05:31:56Z\",\n          \"quantity\": \"<string>\"\n        }\n      ],\n      \"billDate\": \"2023-11-07T05:31:56Z\",\n      \"usageFilter\": {},\n      \"metadata\": {}\n    }\n  ],\n  \"orderLineItemId\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "object": "list",
  "data": [
    {
      "id": "<string>",
      "object": "schedule_interval",
      "scheduleId": "<string>",
      "baseQuantity": "<string>",
      "quantityTransitions": [
        {
          "effectiveDate": "2023-11-07T05:31:56Z",
          "quantity": "<string>"
        }
      ],
      "billingCadence": "<string>",
      "startDate": "2023-11-07T05:31:56Z",
      "endDate": "2023-11-07T05:31:56Z",
      "metadata": {},
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "orderLineItemId": "<string>",
      "itemId": "<string>",
      "priceId": "<string>",
      "description": "<string>",
      "unitPrice": "<string>",
      "billDate": "2023-11-07T05:31:56Z",
      "usageFilter": {}
    }
  ],
  "pagination": {
    "limit": 123,
    "offset": 123,
    "total": 123
  }
}
{
  "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

Path Parameters

id
string
required

Body

application/json
intervals
object[]
required
orderLineItemId
string

When set, scope the wipe to this line's intervals only (per-line cell-edit path)

Response

Intervals replaced

object
enum<string>
required
Available options:
list
data
object[]
required
pagination
object
required

Offset-based pagination response.