Subtreo API (1.0.0)

Download OpenAPI specification:

Customer

Retrieves the collection of Customer resources.

Retrieves the collection of Customer resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

email
string

Customer email

firstName
string

Customer firstName

lastName
string

Customer lastName

itemsPerPage
integer
Default: 20

Customer itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Creates a Customer resource.

Creates a Customer resource.

Authorizations:
apiKey
Request Body schema: application/json
required

The new Customer resource

firstName
required
string [ 2 .. 50 ] characters
lastName
required
string [ 2 .. 50 ] characters
email
required
phone
required
string

Responses

Request samples

Content type
application/json
{
  • "firstName": "string",
  • "lastName": "string",
  • "email": "[email protected]",
  • "phone": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "phone": "string",
  • "billingAddress": {
    }
}

Retrieves a Customer resource.

Retrieves a Customer resource.

Authorizations:
apiKey
path Parameters
id
required
string

Customer identifier

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "phone": "string",
  • "billingAddress": {
    }
}

Invoice

Retrieves the collection of Invoice resources.

Retrieves the collection of Invoice resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

status
string
Enum: "paid" "cancelled" "payment_due" "failed"

Invoice status

customerId
integer

Invoice customerId

itemsPerPage
integer
Default: 20

Invoice itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieves a Invoice resource.

Retrieves a Invoice resource.

Authorizations:
apiKey
path Parameters
id
required
string

Invoice identifier

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "customerId": 0,
  • "status": "string",
  • "totalAmount": 0,
  • "totalAmountPaid": 0,
  • "subTotalAmount": 0,
  • "taxAmount": 0,
  • "discountAmount": 0,
  • "refundedAmount": 0,
  • "dueDate": "string",
  • "paidOn": "string",
  • "lineItems": [
    ]
}

Mark invoice as paid

Records a completed payment for the full invoice amount.

Authorizations:
apiKey
path Parameters
id
required
string

Invoice identifier

Request Body schema: application/json
required

The new Invoice resource

reference
string or null <= 255 characters
method
string <= 255 characters
object or null

Responses

Request samples

Content type
application/json
{
  • "reference": "string",
  • "method": "string",
  • "metadata": { }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "customerId": 0,
  • "status": "string",
  • "totalAmount": 0,
  • "totalAmountPaid": 0,
  • "subTotalAmount": 0,
  • "taxAmount": 0,
  • "discountAmount": 0,
  • "refundedAmount": 0,
  • "dueDate": "string",
  • "paidOn": "string",
  • "lineItems": [
    ]
}

Package

Retrieves the collection of Package resources.

Retrieves the collection of Package resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

isActive
boolean

Package isActive

itemsPerPage
integer
Default: 20

Package itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

PhysicalAsset

Retrieves the collection of PhysicalAsset resources.

Retrieves the collection of PhysicalAsset resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

code
string

PhysicalAsset code

status
string
Enum: "available" "cancelled" "archived" "assigned" "shipped"

PhysicalAsset status

itemsPerPage
integer
Default: 20

PhysicalAsset itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieves a PhysicalAsset resource.

Retrieves a PhysicalAsset resource.

Authorizations:
apiKey
path Parameters
id
required
string

PhysicalAsset identifier

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "code": "string",
  • "description": "string",
  • "successUrl": "string",
  • "taxCode": "string",
  • "isTaxExempt": true,
  • "status": "string",
  • "quantity": 0,
  • "billingPeriods": [
    ]
}

RecurringCharge

Retrieves the collection of RecurringCharge resources.

Retrieves the collection of RecurringCharge resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

code
string

RecurringCharge code

status
string
Enum: "active" "archived" "exhausted"

RecurringCharge status

itemsPerPage
integer
Default: 20

RecurringCharge itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieves a RecurringCharge resource.

Retrieves a RecurringCharge resource.

Authorizations:
apiKey
path Parameters
id
required
string

RecurringCharge identifier

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "code": "string",
  • "description": "string",
  • "pricingModelType": "string",
  • "setupCosts": 0,
  • "successUrl": "string",
  • "taxCode": "string",
  • "isTaxExempt": true,
  • "showDescriptionInInvoices": true,
  • "freeQuantity": 0,
  • "status": "string",
  • "billingPeriods": [
    ]
}

Subscription

Retrieves the collection of Subscription resources.

Retrieves the collection of Subscription resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

status
string
Enum: "active" "cancelled" "future"

Subscription status

ownerId
integer

Subscription ownerId

itemsPerPage
integer
Default: 20

Subscription itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Creates a Subscription resource.

Creates a Subscription resource.

Authorizations:
apiKey
Request Body schema: application/json
required

The new Subscription resource

ownerId
required
integer or null > 0
startDate
string or null <date-time>
Array of objects (RecurringChargeDetailInput)
Array of objects (PhysicalAssetDetailInput)
oneTimeChargeIds
Array of integers
autoCollectionEnabled
boolean
remainingBillingCycles
integer or null

Responses

Request samples

Content type
application/json
{
  • "ownerId": 1,
  • "startDate": "2019-08-24T14:15:22Z",
  • "recurringCharges": [
    ],
  • "physicalAssets": [
    ],
  • "oneTimeChargeIds": [
    ],
  • "autoCollectionEnabled": true,
  • "remainingBillingCycles": 0
}

Response samples

Content type
application/json
{}

Retrieves a Subscription resource.

Retrieves a Subscription resource.

Authorizations:
apiKey
path Parameters
id
required
string

Subscription identifier

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "ownerId": 1,
  • "status": "string",
  • "startDate": "string",
  • "currentTermStart": "string",
  • "currentTermEnd": "string",
  • "recurringCharges": [
    ],
  • "physicalAssets": [
    ],
  • "oneTimeChargeIds": [
    ],
  • "autoCollectionEnabled": true,
  • "remainingBillingCycles": 0
}

Cancel subscription

Cancel an active subscription.

Authorizations:
apiKey
path Parameters
id
required
string

Subscription identifier

Request Body schema: application/json
required

The new Subscription resource

cancelledBy
string or null
comment
string or null
scheduled
boolean
cancelledAt
string or null
applyProratedCalculations
boolean

Responses

Request samples

Content type
application/json
{
  • "cancelledBy": "string",
  • "comment": "string",
  • "scheduled": true,
  • "cancelledAt": "string",
  • "applyProratedCalculations": true
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "ownerId": 1,
  • "status": "string",
  • "startDate": "string",
  • "currentTermStart": "string",
  • "currentTermEnd": "string",
  • "recurringCharges": [
    ],
  • "physicalAssets": [
    ],
  • "oneTimeChargeIds": [
    ],
  • "autoCollectionEnabled": true,
  • "remainingBillingCycles": 0
}

Update subscription charges

Adds, removes or updates recurring charges, physical assets and one-time charges.

Authorizations:
apiKey
path Parameters
id
required
string

Subscription identifier

Request Body schema: application/json
optional

Subscription charges update payload

Array of objects (RecurringChargeDetailInput)
Array of objects (PhysicalAssetDetailInput)
oneTimeChargeIds
Array of integers
autoCollectionEnabled
boolean

Responses

Request samples

Content type
application/json
{
  • "recurringCharges": [
    ],
  • "physicalAssets": [
    ],
  • "oneTimeChargeIds": [
    ],
  • "autoCollectionEnabled": true
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "ownerId": 1,
  • "status": "string",
  • "startDate": "string",
  • "currentTermStart": "string",
  • "currentTermEnd": "string",
  • "recurringCharges": [
    ],
  • "physicalAssets": [
    ],
  • "oneTimeChargeIds": [
    ],
  • "autoCollectionEnabled": true,
  • "remainingBillingCycles": 0
}

UpcomingPayment

Retrieves the collection of UpcomingPayment resources.

Retrieves the collection of UpcomingPayment resources.

Authorizations:
apiKey
query Parameters
page
integer
Default: 1

The collection page number

nextBillingDateFrom
string <date-time>

UpcomingPayment nextBillingDateFrom

nextBillingDateTo
string <date-time>

UpcomingPayment nextBillingDateTo

subscriptionId
integer

UpcomingPayment subscriptionId

itemsPerPage
integer
Default: 20

UpcomingPayment itemsPerPage

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieves a UpcomingPayment resource.

Retrieves a UpcomingPayment resource.

Authorizations:
apiKey
path Parameters
id
required
string

UpcomingPayment identifier

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "subscriptionId": 0,
  • "nextBillingDate": "2019-08-24T14:15:22Z",
  • "billingDay": 0,
  • "subtotal": 0,
  • "totalExlTax": 0,
  • "total": 0,
  • "lineItems": [
    ]
}