POST
/
billing-schedules
curl --request POST \
  --url https://eu.sequencehq.com/api/billing-schedules \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customerId": "cca32597-b6b0-4499-9669-128aef8702e4",
  "startDate": "2022-01-01",
  "endDate": "2022-12-01",
  "recurrenceDayOfMonth": 1,
  "taxRates": [
    {
      "priceId": "bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730",
      "taxRateId": "50c0d53b-8460-41e6-b4e9-a4e157fc1a64"
    }
  ],
  "autoIssueInvoices": false,
  "purchaseOrderNumber": "PO123",
  "paymentProvider": "STRIPE",
  "isDraft": false,
  "rollUpBilling": false,
  "phases": [
    {
      "priceIds": [
        "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
      ],
      "startDate": "2022-01-01",
      "endDate": "2022-06-30",
      "discounts": [
        {
          "restrictToPrices": [
            "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
          ],
          "type": "PERCENTAGE",
          "amount": 0.08,
          "message": "8% Discount",
          "separateLineItem": true
        }
      ],
      "minimums": [
        {
          "restrictToPrices": [
            "9fe9986b-e205-42b7-a58f-42845c91f03f"
          ],
          "amount": 100
        }
      ]
    },
    {
      "priceIds": [
        "9fe9986b-e205-42b7-a58f-42845c91f03f"
      ],
      "startDate": "2022-07-01",
      "endDate": "2022-12-31",
      "discounts": [],
      "minimums": [
        {
          "restrictToPrices": [
            "9fe9986b-e205-42b7-a58f-42845c91f03f"
          ],
          "amount": 100
        }
      ]
    }
  ]
}'
{
  "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",
      "sequenceAccountId": "c4602d51-0fb4-4b48-b689-6ba28f540d1e",
      "productId": "f409d651-c475-4142-aafd-a5d2bd74d4f9",
      "name": "Demo Product",
      "currency": "GBP",
      "structure": {
        "pricingType": "LINEAR",
        "pricePerUnit": "0.25",
        "usageMetricId": "04c62961-04ba-48e6-b985-758bb7d3e712",
        "isPricePercentage": false
      },
      "billingFrequency": "MONTHLY",
      "billingType": "IN_ARREARS",
      "createdAt": "2022-06-28T16:47:00Z",
      "updatedAt": "2022-06-28T16:47:00Z",
      "deletedAt": "2022-06-28T16:47:00Z",
      "externalIds": [],
      "parameters": [
        {
          "parameterId": "94703530-1293-479b-bd37-ccad42fd9c8b",
          "value": "10"
        }
      ]
    }
  ],
  "createdAt": "2022-06-28T16:47:00Z",
  "updatedAt": "2022-06-28T16:47:00Z",
  "lastInvoiceId": "bdbf78a5-b007-4d46-aa7d-d0417a649d64",
  "timeTravellerId": "43f3dad8-23b0-4141-8813-4260b86a7ebb",
  "phases": [
    {
      "id": "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8",
      "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": [
        {
          "restrictToPrices": [
            "6dc54805-0ac8-4f17-9341-4d3f2db9dcd8"
          ],
          "type": "PERCENTAGE",
          "amount": 0.15,
          "message": "15% Discount",
          "separateLineItem": true
        }
      ],
      "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"
        }
      ]
    }
  ],
  "archivedAt": "2022-06-28T16:47:00Z",
  "rollUpBilling": false
}

Headers

Authorization
string
required

Your API credentials. Eg. Basic {credentials}.

Body

application/json
customerId
string
required

Customer ID

startDate
string
required

Start date

endDate
string

End date. A null end date denotes an open-ended schedule.

recurrenceDayOfMonth
integer

Recurrence day of month

taxRates
object[]
required

Tax Rate for each Product

autoIssueInvoices
boolean
required

Auto-issue invoices for this billing schedule

purchaseOrderNumber
string

Optional purchase order number to be added to invoices

paymentProvider
enum<string>

Payment provider to set up collection for

Available options:
STRIPE,
NONE
isDraft
boolean
required

Create in draft status

rollUpBilling
boolean
required

Toggles Roll-up billing

phases
object[]
required

Phases

Response

201 - application/json
id
string
required

Billing Schedule ID

customerId
string
required

Customer ID

status
enum<string>
required

Status

Available options:
DRAFT,
PENDING,
ACTIVE,
SUSPENDED,
CANCELLED,
COMPLETED
startDate
string
required

Start date

endDate
string

End date

taxRates
object[]

Tax Rate for each Product

firstBillingDate
string

First billing date

autoIssueInvoices
boolean
required

Auto-issue invoices for this billing schedule

purchaseOrderNumber
string

Optional purchase order number to be added to invoices

reference
string

Optional reference to be added to invoices

label
string

Optional label

recurrenceDayOfMonth
integer

Recurrence day of month

prices
object[]
required

Prices

createdAt
string
required

Created at

updatedAt
string
required

Last updated at

lastInvoiceId
string

ID of the last invoice (if there has been one)

timeTravellerId
string

Time traveller ID

phases
object[]
required

Phases

archivedAt
string

Archived at

rollUpBilling
boolean
required

Roll up billing