Metering and billing keyed to the same product identifier every endpoint definition carries.
Finance meters each invocation against the product API it called, using the identifier already present in that endpoint's definition. There is no separate billing catalogue to keep in step with the API catalogue, because they are the same identifier.
Price revisions are versioned per API, and vendor cost is reported alongside what was charged.
How it works
Metered units can be negative. That is what expresses a charge reversed when a call returned nothing usable — a credit rather than a suppressed record, so the ledger still shows the attempt.
Keeping the attempt visible matters for the waterfall: a vendor tried and returning nothing is exactly the event the ordering is tuned on.
Operations
Metrics
POST/metrics
Create Finance Metrics
createFinanceMetric
Create Finance Metric
This service enables storing finance metrics. The unit value is a required field that can be either positive or negative according to the direction of the transaction.
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found.
{
"message": "Not found."
}
Parameters
1
Parameter
Type
Example
Description
x-api-keyrequired
stringheader
<redacted>
API key
Request bodyapplication/json
11 fields
Field
Type
Description
product_api_identifierrequired
string
Unique identifier for payable unitExample product_api_identifier_1
product_price_identifierrequired
string
Unique identifier for priceExample product_price_identifier_1
transaction_id
string
Transactions in Staircase are containers for all the data related to an instance of a transaction type. They enable you to correlate the output of various products to a single transaction type, where the transaction type depends on your line of business. A transaction_id, when used properly, gives you a holistic view of the data related to the transaction you’ve assembled.Example 01G0KZARZ46W8KZ81277V5C0HA
request_collection_id
string
Unique identifier for Staircase request collectionExample 2I8JNKZARZ46W8KZ81277V5CASD
response_collection_id
string
Unique identifier for Staircase response collectionExample 328JNKZARZ46W8KZ81277V5SKDS
company_name
string
Company nameExample comp_name
price_unit_typerequired
string
The unit of the platform where the price evaluation can be determined as relevantapi_calldatapointdocumentenvironmenthourimagepagepersonperson-hourpmpm-hourproductseatsubscriptiontransactionExample product
price_timing_typerequired
string
Price is included into billing based on this defined schedule.completionmonthlyExample completion
product_identifierrequired
string
Unique identifier for productExample c5b45e21-6946-4110-bf83-8ca90fac5493
price_amountrequired
number
Value of the unit in selected unit price. This value can be negative or positive.Example 95
Create finance metric. Results will be saved in the output collection.
Remember transaction_id and response_collection_id from the response to get the collection data from Persistence API: Retrieve Collection
{
"message": {
"schema_type": [
"Must be one of: create, update."
]
}
}
Parameters
1
Parameter
Type
Example
Description
x-api-keyrequired
stringheader
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Environment API Key.
Request bodyapplication/json
2 fields
Field
Type
Description
callback_url
string (uri)
Callback URL.
request_datarequired
object
Request JSON body.
finance_metrics
object[]
Finance metric filter
has_transaction_id
object
Transaction ID
has_value
string
Transaction IDExample 01GQJPZG07MMFTF6ZZ3BVK1ZFP
has_collection_id
object
Collection ID
has_value
string
Collection IDExample 01GQJPZFXPRR8QMR31CG92J27D
has_organization_id
object
Organization ID
has_value
string
Organization IDExample test-co-1@gmail.com
has_produce_identifier
object
Product Identifier
has_value
string
Product IdentifierExample customer
has_product_api_identifier
object
Product API Identifier
has_value
string
Product API IdentifierExample 62f5691e-7fd0-4728-ac3c-977dea07f338
Response 201application/json
12 fields
Successfully started flow invocation.
Field
Type
Description
invocation_idrequired
string
Invocation ID.
invocation_statusrequired
string
The status of the invocation.STARTED
transaction_idrequired
string
Transaction ID.
request_collection_idrequired
string
Request collection ID.
response_collection_idrequired
string
Response collection ID.
product_flow_name
string
Product flow name.
metadata
object
The metadata of the invoked product flow.
callback_url
string
Callback URL.
request_data
object
The data for the request collection.
tags
string[]
List of tags.
options
object
Additional information that should be passed to the connector but not be added to the request collection.
widget_url
string
Product widget_url listening on the connector widget_url
Response 400application/json
1 fields
Bad request
Field
Type
Description
message
one of
Either message or object with additional properties.
Response 403application/json
2 fields
Forbidden
Field
Type
Description
message
string
Request forbidden -- authorization will not help
url
string (url)
Indicates at which url the error occurs
Response 404application/json
1 fields
Partner, flow or execution not found
Field
Type
Description
message
string
Nothing matches the given URI
POST/metrics/query
Create Asynchronous Metric Query
create_async_query_execution
Create Asynchronous Query Execution
The service creates asynchronous query execution to retrieves a list of metrics given one or multiple filters. To retrieve all results, send the request with the same query parameters and next_token provided on the previous call until next_token does not appear in the response.
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
Parameters
1
Parameter
Type
Example
Description
x-api-keyrequired
stringheader
<redacted>
API key
Request bodyapplication/json
11 fields
Field
Type
Description
product_api_identifier
string
Unique identifier for payable unitExample product_api_identifier_1
product_price_identifier
string
Unique identifier for priceExample product_price_identifier_1
transaction_id
string
Transactions in Staircase are containers for all the data related to an instance of a transaction type. They enable you to correlate the output of various products to a single transaction type, where the transaction type depends on your line of business. A transaction_id, when used properly, gives you a holistic view of the data related to the transaction you’ve assembled.Example 01G0KZARZ46W8KZ81277V5C0HA
request_collection_id
string
Unique identifier for Staircase request collectionExample 2I8JNKZARZ46W8KZ81277V5CASD
response_collection_id
string
Unique identifier for Staircase response collectionExample 328JNKZARZ46W8KZ81277V5SKDS
company_name
string
Company nameExample comp_name
price_unit_type
string
The unit of the platform where the price evaluation can be determined as relevantapi_calldatapointdocumentenvironmenthourimagepagepersonperson-hourpmpm-hourproductseatsubscriptiontransactionExample product
price_timing_type
string
Price is included into billing based on this defined schedule.completionmonthlyExample completion
product_identifier
string
Unique identifier for the productExample 3f312801-e3bb-49c2-a59b-8e2c05958c1b
start_daterequired
string
If provided, filters by start_date it must be used together with the end_date. Date must be in ISO8601 format.Example 2021-04-13
end_daterequired
string
If provided, filters by end_date it must be used together with the start_date. Date must be in ISO8601 format.Example 2021-04-16
Response 201application/json
2 fields
Ok.
Field
Type
Description
query_id
string
Unique identifier for running query execution
status
string
Status of the query execution
Response 400application/json
1 fields
Failed Creation.
Field
Type
Description
message
string
Message reason why the creation has failed
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 422application/json
2 fields
Forbidden
Field
Type
Description
message
string
Error message
error
string
Error
GET/metrics/query/{query_id}
Get Asynchronous Query Result
get_async_query_result
The service retrieves a list of metrics by given query id. To retrieve all results, send the next_token provided on the previous call until next_token does not appear in the response.
{
"response": {
"value": {
"message": "Filters not allowed ",
"allowed filters": [
"product_name",
"status",
"partner_name",
"metric_type",
"operation_status",
"product_name and severity",
"product_name and status",
"operation_stauts and partner_name",
"start_date and end_date can be combined with every filter"
]
}
}
}
text/html
Error Response.
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found.
{
"message": "Not found."
}
Parameters
4
Parameter
Type
Example
Description
query_idrequired
stringpath
1fc23e2-b13e-405a-a3de-a5228950e3b8
Unique query execution id
x-api-keyrequired
stringheader
<redacted>
API key
limit
integerquery
150
The number of results to return in this request.
next_token
stringquery
000000000000
The token for the next set of items to return. (You received this token from a previous call. If you have reached the end of the stream, the returned token is null.)
Response 200application/json
3 fields
Ok.
Field
Type
Description
status
string
Status of the query execution
result_csv_file
string
URL for query result in CSV format
metrics
object[]
Metrics
host_environment
string
Environment host where the product is deployed.
product_api_identifier
string
Unique identifier for payable unit
product_price_identifier
string
Unique identifier for price
transaction_id
string
Transaction ID
request_collection_id
string
Unique identifier for Staircase request collection
response_collection_id
string
Unique identifier for Staircase response collection
company_name
string
Company name
price_unit_type
string
The unit of the platform where the price evaluation can be determined as relevant
price_timing_type
string
Price is included into billing based on this defined schedule.
price_amount
string
Value of the unit in selected unit price. This value can be negative or positive.
This service creates migration configurations to allow migrating aggregated finance data to another environment. Aggregated finance data is needed for generating finance reports from them.
This service allows the creation of financial reports for given dates. Request body allows filtering reports by some fields. This service starts asynchronous report execution and returns a unique report ID for checking report execution status and getting report results if report execution is finished.
{
"message": "Bad request syntax or missed a required field"
}
application/json
Unauthorized, Bad credentials.
{
"message": "Unauthorized, Bad credentials."
}
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found.
{
"message": "Not found."
}
application/json
Method not allowed.
{
"message": "The method is not allowed for the requested URL"
}
Parameters
1
Parameter
Type
Example
Description
x-api-keyrequired
stringheader
<redacted>
API key
Request bodyapplication/json
5 fields
Field
Type
Description
product_api_identifiers
array
List of API ID
product_price_identifiers
array
List of product price identifier
price_amount_unit_type
string
Price unitcentsExample cents
start_daterequired
string
Start date in ISO8601 formatExample 2021-04-13
end_daterequired
string
End date in ISO8601 formatExample 2021-05-13
Response 202application/json
1 fields
Report execution started
Field
Type
Description
report_id
string
Report ID
Response 400application/json
1 fields
Bad request syntax or missed a required field
Field
Type
Description
message
string
Error message
Response 401application/json
1 fields
Unauthorized, Bad credentials.
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
POST/reports/finance/aggregated
Create Aggregated Finance Metric Reports
createAggregatedFinanceMetricReport
Create Aggregated Finance Metric Report
This service allows the creation of financial reports from aggregated metric data for given dates. In order to get a finance report for multiple environments, please have a look at the migrations(/migrations) service for migrating aggregated finance metrics. Request body allows filtering reports by some fields. This service starts asynchronous report execution and returns a unique report ID for checking report execution status and getting report results if report execution is finished. There is no retention period for aggregated finance metrics.
{
"message": "Bad request syntax or missed a required field"
}
application/json
Unauthorized, Bad credentials.
{
"message": "Unauthorized, Bad credentials."
}
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found.
{
"message": "Not found."
}
application/json
Method not allowed.
{
"message": "The method is not allowed for the requested URL"
}
Parameters
1
Parameter
Type
Example
Description
x-api-keyrequired
stringheader
<redacted>
API key
Request bodyapplication/json
6 fields
Field
Type
Description
product_api_identifiers
array
List of API ID
environments
array
List of environment names
product_price_identifiers
array
List of product price identifier
price_amount_unit_type
string
Price unitcentsExample cents
start_daterequired
string
Start date in ISO8601 formatExample 2021-04-13
end_daterequired
string
End date in ISO8601 formatExample 2021-05-13
Response 202application/json
1 fields
Report execution started
Field
Type
Description
report_id
string
Report ID
Response 400application/json
1 fields
Bad request syntax or missed a required field
Field
Type
Description
message
string
Error message
Response 401application/json
1 fields
Unauthorized, Bad credentials.
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
GET/reports/{report_id}
Get Finance Report Result
getFinanceReportResult
This service retrieves the status of a Report Execution for a given report_id. Status = IN_PROGRESS, SUCCEEDED, or FAILED. Continue to ping this service until you receive a status = SUCCEEDED or FAILED. Created report results have one month retention period.