curl --request POST \
--url https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "cca32597-b6b0-4499-9669-128aef8702e4"
}
'import requests
url = "https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate"
payload = { "customerId": "cca32597-b6b0-4499-9669-128aef8702e4" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({customerId: 'cca32597-b6b0-4499-9669-128aef8702e4'})
};
fetch('https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate', 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://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate",
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([
'customerId' => 'cca32597-b6b0-4499-9669-128aef8702e4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate"
payload := strings.NewReader("{\n \"customerId\": \"cca32597-b6b0-4499-9669-128aef8702e4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"cca32597-b6b0-4499-9669-128aef8702e4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"cca32597-b6b0-4499-9669-128aef8702e4\"\n}"
response = http.request(request)
puts response.read_body{
"id": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b",
"customerId": "cca32597-b6b0-4499-9669-128aef8702e4",
"status": "ACTIVE",
"startDate": "2022-01-01",
"endDate": "2022-12-01",
"taxRates": [
{
"priceId": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730",
"taxRateId": "50c0d53b-8460-41e6-b4e9-a4e157fc1a64"
}
],
"firstBillingDate": "2022-02-02",
"autoIssueInvoices": false,
"purchaseOrderNumber": "PO123",
"reference": "ref",
"label": "label",
"recurrenceDayOfMonth": 1,
"prices": [
{
"id": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730",
"productId": "f409d651-c475-4142-aafd-a5d2bd74d4f9",
"name": "Demo Product",
"currency": "GBP",
"structure": {
"pricePerUnit": "0.25",
"usageMetricId": "04c62961-04ba-48e6-b985-758bb7d3e712",
"isPricePercentage": false,
"pricingType": "LINEAR"
},
"billingFrequency": "MONTHLY",
"billingType": "IN_ARREARS",
"createdAt": "2022-06-28T16:47:00Z",
"updatedAt": "2022-06-28T16:47:00Z",
"integrationIds": [
{
"service": "Xero",
"id": "123",
"isPending": false
}
],
"customMetricParameters": [
{
"parameterId": "94703530-1293-479b-bd37-ccad42fd9c8b",
"value": "10"
}
],
"listPriceId": "b4d7e884-e007-4183-8355-4771865c5100",
"usageCalculationPeriod": {
"frequency": "MONTHLY",
"interval": 1
},
"status": "ACTIVE"
}
],
"createdAt": "2022-06-28T16:47:00Z",
"updatedAt": "2022-06-28T16:47:00Z",
"lastInvoiceId": "bdbf78a5-b007-4d46-aa7d-d0417a649d64",
"phases": [
{
"id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"name": "Onboarding",
"createdAt": "2022-06-28T16:47:00Z",
"billingScheduleId": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b",
"priceIds": [
"6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
],
"startDate": "2022-01-01",
"endDate": "2022-06-30",
"discounts": [
{
"id": "4451f62c-0c1f-491c-aeb2-9eb41b28149c",
"restrictToPrices": [
"6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
],
"type": "PERCENTAGE",
"amount": 15,
"message": "15% Discount",
"separateLineItem": true,
"seatDiscountType": "ALL_SEATS"
}
],
"minimums": [
{
"id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"sequenceAccountId": "c4602d51-0fb4-4b48-b689-6ba28f540d1e",
"billingScheduleId": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b",
"phaseId": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"amount": 100,
"restrictToPrices": [
"6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
],
"createdAt": "2022-06-28T16:47:00Z",
"updatedAt": "2022-06-28T16:47:00Z"
}
],
"recurrencePreference": "CONTINUE_FROM_PREVIOUS_PHASE",
"phasePriceMetadata": [
{
"priceId": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"arrCalculation": "INCLUDE"
}
]
}
],
"archivedAt": "2022-06-28T16:47:00Z",
"rollUpBilling": false,
"integrationIds": [
{
"service": "Salesforce",
"id": "a0CQy00000Ipz5VMAR",
"lastSynced": "2024-08-14T17:14:17Z",
"url": "https://sequence-b-dev-ed.develop.my.salesforce.com/lightning/r/sequence__Billing_Schedule__c/a0CQy00000Ipz5VMAR/view",
"isPending": false
}
],
"attachmentAssets": [
{
"id": "e007e884-5100-4183-8355-4771865cb4dd",
"createdBy": "94703530-1293-479b-bd37-ccad42fd9c8b",
"type": "IMAGE",
"format": "PNG",
"fileName": "my-image.png",
"fileSizeBytes": 12345,
"url": "https://assets.sequencehq.com/018f9ad5-4192-76d7-aea5-d80a9018eded/images/e007e884-5100-4183-8355-4771865cb4dd.png",
"createdAt": "2022-06-28T16:47:00Z"
}
],
"contractId": "0194d091-f65b-7b98-b75f-a923aa0f5b1a",
"defaultDueDateDays": 30,
"memo": "Example Billing Schedule",
"customFields": {
"key": "value"
},
"paymentProvider": "STRIPE",
"autoCharge": true
}This response has no body data.This response has no body data.This response has no body data.Duplicate a billing schedule
Duplicate a billing schedule.
curl --request POST \
--url https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "cca32597-b6b0-4499-9669-128aef8702e4"
}
'import requests
url = "https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate"
payload = { "customerId": "cca32597-b6b0-4499-9669-128aef8702e4" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({customerId: 'cca32597-b6b0-4499-9669-128aef8702e4'})
};
fetch('https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate', 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://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate",
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([
'customerId' => 'cca32597-b6b0-4499-9669-128aef8702e4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate"
payload := strings.NewReader("{\n \"customerId\": \"cca32597-b6b0-4499-9669-128aef8702e4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"cca32597-b6b0-4499-9669-128aef8702e4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.sequencehq.com/api/billing-schedules/{billingScheduleId}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"cca32597-b6b0-4499-9669-128aef8702e4\"\n}"
response = http.request(request)
puts response.read_body{
"id": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b",
"customerId": "cca32597-b6b0-4499-9669-128aef8702e4",
"status": "ACTIVE",
"startDate": "2022-01-01",
"endDate": "2022-12-01",
"taxRates": [
{
"priceId": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730",
"taxRateId": "50c0d53b-8460-41e6-b4e9-a4e157fc1a64"
}
],
"firstBillingDate": "2022-02-02",
"autoIssueInvoices": false,
"purchaseOrderNumber": "PO123",
"reference": "ref",
"label": "label",
"recurrenceDayOfMonth": 1,
"prices": [
{
"id": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730",
"productId": "f409d651-c475-4142-aafd-a5d2bd74d4f9",
"name": "Demo Product",
"currency": "GBP",
"structure": {
"pricePerUnit": "0.25",
"usageMetricId": "04c62961-04ba-48e6-b985-758bb7d3e712",
"isPricePercentage": false,
"pricingType": "LINEAR"
},
"billingFrequency": "MONTHLY",
"billingType": "IN_ARREARS",
"createdAt": "2022-06-28T16:47:00Z",
"updatedAt": "2022-06-28T16:47:00Z",
"integrationIds": [
{
"service": "Xero",
"id": "123",
"isPending": false
}
],
"customMetricParameters": [
{
"parameterId": "94703530-1293-479b-bd37-ccad42fd9c8b",
"value": "10"
}
],
"listPriceId": "b4d7e884-e007-4183-8355-4771865c5100",
"usageCalculationPeriod": {
"frequency": "MONTHLY",
"interval": 1
},
"status": "ACTIVE"
}
],
"createdAt": "2022-06-28T16:47:00Z",
"updatedAt": "2022-06-28T16:47:00Z",
"lastInvoiceId": "bdbf78a5-b007-4d46-aa7d-d0417a649d64",
"phases": [
{
"id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"name": "Onboarding",
"createdAt": "2022-06-28T16:47:00Z",
"billingScheduleId": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b",
"priceIds": [
"6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
],
"startDate": "2022-01-01",
"endDate": "2022-06-30",
"discounts": [
{
"id": "4451f62c-0c1f-491c-aeb2-9eb41b28149c",
"restrictToPrices": [
"6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
],
"type": "PERCENTAGE",
"amount": 15,
"message": "15% Discount",
"separateLineItem": true,
"seatDiscountType": "ALL_SEATS"
}
],
"minimums": [
{
"id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"sequenceAccountId": "c4602d51-0fb4-4b48-b689-6ba28f540d1e",
"billingScheduleId": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b",
"phaseId": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"amount": 100,
"restrictToPrices": [
"6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
],
"createdAt": "2022-06-28T16:47:00Z",
"updatedAt": "2022-06-28T16:47:00Z"
}
],
"recurrencePreference": "CONTINUE_FROM_PREVIOUS_PHASE",
"phasePriceMetadata": [
{
"priceId": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
"arrCalculation": "INCLUDE"
}
]
}
],
"archivedAt": "2022-06-28T16:47:00Z",
"rollUpBilling": false,
"integrationIds": [
{
"service": "Salesforce",
"id": "a0CQy00000Ipz5VMAR",
"lastSynced": "2024-08-14T17:14:17Z",
"url": "https://sequence-b-dev-ed.develop.my.salesforce.com/lightning/r/sequence__Billing_Schedule__c/a0CQy00000Ipz5VMAR/view",
"isPending": false
}
],
"attachmentAssets": [
{
"id": "e007e884-5100-4183-8355-4771865cb4dd",
"createdBy": "94703530-1293-479b-bd37-ccad42fd9c8b",
"type": "IMAGE",
"format": "PNG",
"fileName": "my-image.png",
"fileSizeBytes": 12345,
"url": "https://assets.sequencehq.com/018f9ad5-4192-76d7-aea5-d80a9018eded/images/e007e884-5100-4183-8355-4771865cb4dd.png",
"createdAt": "2022-06-28T16:47:00Z"
}
],
"contractId": "0194d091-f65b-7b98-b75f-a923aa0f5b1a",
"defaultDueDateDays": 30,
"memo": "Example Billing Schedule",
"customFields": {
"key": "value"
},
"paymentProvider": "STRIPE",
"autoCharge": true
}This response has no body data.This response has no body data.This response has no body data.Headers
Your API credentials. Eg. Basic {credentials}.
Use this header to select an API version
2024-07-30 Path Parameters
Billing Schedule ID
Body
Customer ID
"cca32597-b6b0-4499-9669-128aef8702e4"
Response
Created
Billing Schedule ID
"b102e007-f5d7-4b1a-8a1d-9a51135ae73b"
Customer ID
"cca32597-b6b0-4499-9669-128aef8702e4"
Billing schedule status
DRAFT, PENDING, ACTIVE, SUSPENDED, CANCELLED, COMPLETED "ACTIVE"
Start date
"2022-01-01"
If true, invoices will be automatically sent for this billing schedule
false
Prices
Show child attributes
Show child attributes
[ { "id": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730", "productId": "f409d651-c475-4142-aafd-a5d2bd74d4f9", "name": "Demo Product", "currency": "GBP", "structure": { "pricePerUnit": "0.25", "usageMetricId": "04c62961-04ba-48e6-b985-758bb7d3e712", "isPricePercentage": false, "pricingType": "LINEAR" }, "billingFrequency": "MONTHLY", "billingType": "IN_ARREARS", "createdAt": "2022-06-28T16:47:00Z", "updatedAt": "2022-06-28T16:47:00Z", "integrationIds": [ { "service": "Xero", "id": "123", "isPending": false } ], "customMetricParameters": [ { "parameterId": "94703530-1293-479b-bd37-ccad42fd9c8b", "value": "10" } ], "listPriceId": "b4d7e884-e007-4183-8355-4771865c5100", "usageCalculationPeriod": { "frequency": "MONTHLY", "interval": 1 }, "status": "ACTIVE" } ]
Time at which the schedule was initially created, in ISO 8601 format.
"2022-06-28T16:47:00Z"
Time at which the schedule was last updated, in ISO 8601 format.
"2022-06-28T16:47:00Z"
Phases
Show child attributes
Show child attributes
[ { "id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8", "name": "Onboarding", "createdAt": "2022-06-28T16:47:00Z", "billingScheduleId": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b", "priceIds": ["6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"], "startDate": "2022-01-01", "endDate": "2022-06-30", "discounts": [ { "id": "4451f62c-0c1f-491c-aeb2-9eb41b28149c", "restrictToPrices": ["6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"], "type": "PERCENTAGE", "amount": 15, "message": "15% Discount", "separateLineItem": true, "seatDiscountType": "ALL_SEATS" } ], "minimums": [ { "id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8", "sequenceAccountId": "c4602d51-0fb4-4b48-b689-6ba28f540d1e", "billingScheduleId": "b102e007-f5d7-4b1a-8a1d-9a51135ae73b", "phaseId": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8", "amount": 100, "restrictToPrices": ["6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"], "createdAt": "2022-06-28T16:47:00Z", "updatedAt": "2022-06-28T16:47:00Z" } ], "recurrencePreference": "CONTINUE_FROM_PREVIOUS_PHASE", "phasePriceMetadata": [ { "priceId": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8", "arrCalculation": "INCLUDE" } ] } ]
Roll up billing
false
External services which are linked to this customer
Show child attributes
Show child attributes
[ { "service": "Salesforce", "id": "a0CQy00000Ipz5VMAR", "lastSynced": "2024-08-14T17:14:17Z", "url": "https://sequence-b-dev-ed.develop.my.salesforce.com/lightning/r/sequence__Billing_Schedule__c/a0CQy00000Ipz5VMAR/view", "isPending": false } ]
Assets attached to this billing schedule
Show child attributes
Show child attributes
[ { "id": "e007e884-5100-4183-8355-4771865cb4dd", "createdBy": "94703530-1293-479b-bd37-ccad42fd9c8b", "type": "IMAGE", "format": "PNG", "fileName": "my-image.png", "fileSizeBytes": 12345, "url": "https://assets.sequencehq.com/018f9ad5-4192-76d7-aea5-d80a9018eded/images/e007e884-5100-4183-8355-4771865cb4dd.png", "createdAt": "2022-06-28T16:47:00Z" } ]
Custom key-value fields for this billing schedule
Show child attributes
Show child attributes
{ "key": "value" }
End date
"2022-12-01"
Tax Rate for each Product
Show child attributes
Show child attributes
[ { "priceId": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730", "taxRateId": "50c0d53b-8460-41e6-b4e9-a4e157fc1a64" } ]
First billing date
"2022-02-02"
Optional purchase order number to be added to invoices
"PO123"
Optional reference to be added to invoices
"ref"
Optional label
"label"
The day of the month on which billing recurs
1
ID of the last invoice (if there has been one)
"bdbf78a5-b007-4d46-aa7d-d0417a649d64"
Time at which the schedule was archived, in ISO 8601 format.
"2022-06-28T16:47:00Z"
Optional ID of the contract used to create this billing schedule
"0194d091-f65b-7b98-b75f-a923aa0f5b1a"
Default number of days between invoice issue date and due date
30
Billing schedule memo
"Example Billing Schedule"
Payment provider configured for collecting invoices on this billing schedule
STRIPE, GOCARDLESS, NONE "STRIPE"
Whether invoices for this billing schedule are automatically charged. Only returned when paymentProvider is STRIPE
true