Surge Pricing
POST/api/v1/surge-pricing/calculate
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/surge-pricing/calculate" \ -H "Content-Type: application/json" \ -d '{ "context": null, "items": [ { "base_price": 0.1, "item_id": "string" } ], "policy_id": "string" }'{ "results": [ { "currency": "string", "explanation": [ { "effect": "string", "result": 0.1, "rule": "string" } ], "final_price": 0.1, "item_id": "string", "trace_id": "string" } ], "trace_id": "string"}POST/api/v1/surge-pricing/lookup-tables
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/surge-pricing/lookup-tables" \ -H "Content-Type: application/json" \ -d '{ "data": null, "table_name": "string" }'{ "entries": 0, "table_name": "string"}GET/api/v1/surge-pricing/lookup-tables/{table_name}
Authorization
bearer_token In: header
Path Parameters
Lookup table name
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/lookup-tables/string"{ "data": null, "table_name": "string"}GET/api/v1/surge-pricing/metrics
Authorization
bearer_token In: header
Query Parameters
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Comma-separated sort keys, - for descending, at most 1. Keys: name. Default: name.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/metrics"{ "metrics": [ "string" ], "page": { "has_more": true, "next_cursor": "string", "page": 0, "total": 0 }}POST/api/v1/surge-pricing/metrics
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/surge-pricing/metrics" \ -H "Content-Type: application/json" \ -d '{ "metric_name": "string", "value": null }'{ "metric_name": "string", "timestamp": 0}GET/api/v1/surge-pricing/metrics/{metric_name}
Authorization
bearer_token In: header
Path Parameters
Metric name
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/metrics/string"{ "metric_name": "string", "timestamp": 0, "value": null}GET/api/v1/surge-pricing/policies
Authorization
bearer_token In: header
Query Parameters
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Full-text search over this list's searchable fields.
1 <= length <= 200Comma-separated sort keys, - for descending, at most 1. Keys: created_at, updated_at. Default: -updated_at.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
Include deleted policies (default: false)
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/policies"{ "page": { "has_more": true, "next_cursor": "string", "page": 0, "total": 0 }, "policies": [ { "deleted": true, "description": "string", "policy_id": "string", "rule_count": 0, "updated_at": 0, "version": 0 } ]}POST/api/v1/surge-pricing/policies
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/surge-pricing/policies" \ -H "Content-Type: application/json" \ -d '{ "description": "string", "policy_id": "string", "rules": [ { "conditions": [ { "field": "string", "operator": "equals", "value": null } ], "name": "string", "params": {}, "rule_type": "set_from_lookup" } ] }'{ "policy": { "created_at": 0, "deleted": true, "description": "string", "policy_id": "string", "rules": [ { "conditions": [ { "field": "string", "operator": "equals", "value": null } ], "enabled": true, "name": "string", "params": { "amount": 0, "charm_ending": 0, "fixed_price": 0, "key_field": "string", "lookup_table": "string", "multiplier": 0, "multiplier_field": "string", "percentage": 0 }, "rule_type": "set_from_lookup" } ], "updated_at": 0, "version": 0 }}GET/api/v1/surge-pricing/policies/{policy_id}
Authorization
bearer_token In: header
Path Parameters
Policy ID
Query Parameters
Policy version (defaults to active)
int320 <= valueResponse Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/policies/string"{ "policy": { "created_at": 0, "deleted": true, "description": "string", "policy_id": "string", "rules": [ { "conditions": [ { "field": "string", "operator": "equals", "value": null } ], "enabled": true, "name": "string", "params": { "amount": 0, "charm_ending": 0, "fixed_price": 0, "key_field": "string", "lookup_table": "string", "multiplier": 0, "multiplier_field": "string", "percentage": 0 }, "rule_type": "set_from_lookup" } ], "updated_at": 0, "version": 0 }}DELETE/api/v1/surge-pricing/policies/{policy_id}
Authorization
bearer_token In: header
Path Parameters
Policy ID
Response Body
application/json
curl -X DELETE "https://example.com/api/v1/surge-pricing/policies/string"{ "deleted": true, "policy_id": "string"}PUT/api/v1/surge-pricing/policies/{policy_id}
Authorization
bearer_token In: header
Path Parameters
Policy ID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PUT "https://example.com/api/v1/surge-pricing/policies/string" \ -H "Content-Type: application/json" \ -d '{ "rules": [ { "conditions": [ { "field": "string", "operator": "equals", "value": null } ], "name": "string", "params": {}, "rule_type": "set_from_lookup" } ] }'{ "policy": { "created_at": 0, "deleted": true, "description": "string", "policy_id": "string", "rules": [ { "conditions": [ { "field": "string", "operator": "equals", "value": null } ], "enabled": true, "name": "string", "params": { "amount": 0, "charm_ending": 0, "fixed_price": 0, "key_field": "string", "lookup_table": "string", "multiplier": 0, "multiplier_field": "string", "percentage": 0 }, "rule_type": "set_from_lookup" } ], "updated_at": 0, "version": 0 }, "previous_version": 0}GET/api/v1/surge-pricing/policies/{policy_id}/history
Authorization
bearer_token In: header
Path Parameters
Policy ID
Query Parameters
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Comma-separated sort keys, - for descending, at most 1. Keys: version. Default: version.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/policies/string/history"{ "active_version": 0, "page": { "has_more": true, "next_cursor": "string", "page": 0, "total": 0 }, "policy_id": "string", "versions": [ { "description": "string", "updated_at": 0, "version": 0 } ]}POST/api/v1/surge-pricing/policies/{policy_id}/rollback
Authorization
bearer_token In: header
Path Parameters
Policy ID
Query Parameters
Target version to rollback to
int320 <= valueResponse Body
application/json
curl -X POST "https://example.com/api/v1/surge-pricing/policies/string/rollback?version=0"{ "policy": { "created_at": 0, "deleted": true, "description": "string", "policy_id": "string", "rules": [ { "conditions": [ { "field": "string", "operator": "equals", "value": null } ], "enabled": true, "name": "string", "params": { "amount": 0, "charm_ending": 0, "fixed_price": 0, "key_field": "string", "lookup_table": "string", "multiplier": 0, "multiplier_field": "string", "percentage": 0 }, "rule_type": "set_from_lookup" } ], "updated_at": 0, "version": 0 }}POST/api/v1/surge-pricing/policies/{policy_id}/simulate
Authorization
bearer_token In: header
Path Parameters
Policy ID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/surge-pricing/policies/string/simulate" \ -H "Content-Type: application/json" \ -d '{ "base_price": 0.1, "contexts": [ null ] }'{ "base_price": 0.1, "policy_id": "string", "results": [ { "context_index": 0, "currency": "string", "explanation": [ { "effect": "string", "result": 0.1, "rule": "string" } ], "final_price": 0.1 } ], "version": 0}GET/api/v1/surge-pricing/trace/{trace_id}
Authorization
bearer_token In: header
Path Parameters
Trace ID
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/trace/string"{ "currency": "string", "explanation": [ { "effect": "string", "result": 0.1, "rule": "string" } ], "final_price": 0.1, "item_id": "string", "trace_id": "string"}