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
curl -X GET "https://example.com/api/v1/surge-pricing/metrics"{ "metrics": [ "string" ]}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
Full-text search query applied to policy description
1-indexed page number
int640 <= valuePage size
int640 <= valueSort field (created_at, updated_at, version)
Sort order (asc or desc)
Value in
- "asc"
- "desc"
Filter expressions in the form field:operator:value Available filters: deleted, version
Include deleted policies (default: false)
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/policies"{ "pagination": { "has_more": true, "page": 0, "page_size": 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
Response Body
application/json
curl -X GET "https://example.com/api/v1/surge-pricing/policies/string/history"{ "active_version": 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"}