...
Production endpoint: https://maestrano.com/api/v1/account/
Groups (company/organization)
...
Status | ||||||
---|---|---|---|---|---|---|
|
API
> Retrieve your list of customers (= list of companies having selected your application on Maestrano)
...
Code Block | ||
---|---|---|
| ||
curl -u <my-app-id>:<my-app-secret> \ -X "DELETE" \ -H "Accept: application/json" \ https://my-cloud-application.com/webhooks/maestrano/groups/cld-4/users/usr-2 |
2.2 - Billing
...
Management
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Maestrano centralizes all billing functionalities. The goal is to provide to customers a single invoice at the end of the month summarising the expenses related to all the applications and services they have used during the month.
Our billing API allows you to report charges to be incurred to your Maestrano customers. Two types of bills are currently available:
- Bill: one-off charge to be incurred - e.g.: one-off purchase a specific module, template, service within your application
- RecurringBill: recurring charge - e.g.: weekly/monthly/annual user subscription
Bill - Adhoc charge
The command below shows how to create a $20 adhoc bill.
Code Block | ||
---|---|---|
| ||
# Request
curl -u <my-app-id>:<my-app-secret> \
-X "POST" \
-H 'Accept: application/json' \
-H "Content-type: application/json" \
-d '{"group_id":"cld-4", "price_cents":2000, "description":"Product purchase"}' \
https://maestrano.com/api/v1/account/bills
# Response
{
"success":true,
"errors":{},
"data":{
"object":"account_bill",
"id":"bill-520",
"group_id":"cld-4",
"created_at":"2015-06-03T05:00:33Z",
"updated_at":"2015-06-03T05:00:33Z",
"price_cents":2000,
"status":"submitted",
"currency":"AUD",
"units":null,
"description":"Product purchase",
"period_started_at":null,
"period_ended_at":null
}
} |
This command allows you to cancel a submitted bill. Only submitted bills can be cancelled - "invoiced" bills are not cancellable.
Code Block | ||
---|---|---|
| ||
# Request
curl -u <my-app-id>:<my-app-secret> \
-X "DELETE" \
-H 'Accept: application/json' \
https://maestrano.com/api/v1/account/bills/bill-520
# Response
{
"success":true,
"errors":{},
"data":{
"object":"account_bill",
"id":"bill-520",
"group_id":"cld-4",
"created_at":"2015-06-03T05:00:33Z",
"updated_at":"2015-06-03T05:00:33Z",
"price_cents":2000,
"status":"cancelled",
"currency":"AUD",
"units":null,
"description":"Product purchase",
"period_started_at":null,
"period_ended_at":null
}
} |
Below is how to retrieve all your bills as well as a single bill:
Code Block | ||
---|---|---|
| ||
# Retrieve all your bills
curl -u <my-app-id>:<my-app-secret> \
-H 'Accept: application/json' \
https://maestrano.com/api/v1/account/bills
# Retrieve a specific bill
curl -u <my-app-id>:<my-app-secret> \
-H 'Accept: application/json' \
https://maestrano.com/api/v1/account/bills/bill-520 |
RecurringBill - Recurring subscription fees
The command below shows how to create a $29.90 recurring bill for a user license.
Code Block | ||
---|---|---|
| ||
# Request
curl -u <my-app-id>:<my-app-secret> \
-X "POST" \
-H 'Accept: application/json' \
-H "Content-type: application/json" \
-d '{"group_id":"cld-4", "price_cents":2990, "description":"User license", "period": "Month", "start_date": "2015-08-27T23:22:37Z" }' \
https://maestrano.com/api/v1/account/recurring_bills
# Response
{
"success":true,
"errors":{},
"data":{
"object":"account_recurring_bill",
"id":"rbill-523",
"group_id":"cld-4",
"created_at":"2015-06-03T05:02:19Z",
"updated_at":"2015-06-03T05:02:19Z",
"price_cents":2990,
"status":"submitted",
"currency":"AUD",
"description":"User license",
"start_date":"2015-08-27T23:22:37Z",
"period":"month",
"frequency":1,
"cycles":null,
"initial_cents":0,
"last_execution_at":null,
"next_execution_at":"2015-08-27T23:22:37Z",
"remaining_cycles":null
}
} |
This command allows you to cancel a recurring bill:
Code Block | ||
---|---|---|
| ||
# Request
curl -u <my-app-id>:<my-app-secret> \
-X "DELETE" \
-H 'Accept: application/json' \
https://maestrano.com/api/v1/account/recurring_bills/rbill-523
# Response
{
"success":true,
"errors":{},
"data":{
"object":"account_recurring_bill",
"id":"rbill-523",
"group_id":"cld-4",
"created_at":"2015-06-03T05:02:19Z",
"updated_at":"2015-06-03T05:02:19Z",
"price_cents":2990,
"status":"cancelled",
"currency":"AUD",
"description":"User license",
"start_date":"2015-08-27T23:22:37Z",
"period":"month",
"frequency":1,
"cycles":null,
"initial_cents":0,
"last_execution_at":null,
"next_execution_at":"2015-08-27T23:22:37Z",
"remaining_cycles":null
}
} |
Below is how to retrieve all your recurring bills as well as a single recurring bill:
Code Block | ||
---|---|---|
| ||
# Retrieve all your recurring bills
curl -u <my-app-id>:<my-app-secret> \
-H 'Accept: application/json' \
https://maestrano.com/api/v1/account/recurring_bills
# Retrieve a specific recurring bill
curl -u <my-app-id>:<my-app-secret> \
-H 'Accept: application/json' \
https://maestrano.com/api/v1/account/recurring_bills/rbill-523 |