Skip to content

Surge Pricing

POST/api/v1/surge-pricing/calculate
POST
/api/v1/surge-pricing/calculate

Authorization

bearer_token
AuthorizationBearer <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
POST
/api/v1/surge-pricing/lookup-tables

Authorization

bearer_token
AuthorizationBearer <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}
GET
/api/v1/surge-pricing/lookup-tables/{table_name}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

table_name*string

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
GET
/api/v1/surge-pricing/metrics

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

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.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: name. Default: name.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set 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
POST
/api/v1/surge-pricing/metrics

Authorization

bearer_token
AuthorizationBearer <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}
GET
/api/v1/surge-pricing/metrics/{metric_name}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

metric_name*string

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
GET
/api/v1/surge-pricing/policies

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

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.

q?string

Full-text search over this list's searchable fields.

Length1 <= length <= 200
sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: created_at, updated_at. Default: -updated_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

include_deleted?boolean

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
POST
/api/v1/surge-pricing/policies

Authorization

bearer_token
AuthorizationBearer <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}
GET
/api/v1/surge-pricing/policies/{policy_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

policy_id*string

Policy ID

Query Parameters

version?integer

Policy version (defaults to active)

Formatint32
Range0 <= value

Response 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}
DELETE
/api/v1/surge-pricing/policies/{policy_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

policy_id*string

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}
PUT
/api/v1/surge-pricing/policies/{policy_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

policy_id*string

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
GET
/api/v1/surge-pricing/policies/{policy_id}/history

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

policy_id*string

Policy ID

Query Parameters

filter?

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.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: version. Default: version.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set 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
POST
/api/v1/surge-pricing/policies/{policy_id}/rollback

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

policy_id*string

Policy ID

Query Parameters

version*integer

Target version to rollback to

Formatint32
Range0 <= value

Response 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
POST
/api/v1/surge-pricing/policies/{policy_id}/simulate

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

policy_id*string

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}
GET
/api/v1/surge-pricing/trace/{trace_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

trace_id*string

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"}