Organization distance rules
This section describes the API of the organization distance rule resource.
Parameters
id: | integer |
organization_id: | integer |
amount: | float |
distance_kind: |
string options: km or mi
|
currency: | string based on currencies code |
Example of Distance Rule
List distance rules
Retrieve organization distance rules list. When the administrator of the organization did not set the distance rule, a default distance rule with id: null
is returned.
Parameters
organization_id: | integer |
Definition
GET https://app.rexpense.com/api/v1/organizations/:organization_id/distances_rules
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/organizations/:organization_id/distances_rules \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example Success
HTTP 200 OK
Response Example when organization does not have a distance rule (return default values)
Update a distance rule
Parameters
organization_id: | integer |
amount: | float |
currency: | integer |
distance_kind: | string options: km , mi |
Definition
POST https://app.rexpense.com/api/v1/organizations/:organization_id/distances_rules
Example Request
$ curl -u $YOUR_API_TOKEN:X -X POST https://app.rexpense.com/api/v1/organizations/:organization_id/distances_rules \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"amount": 10.00, "currency": "BRL", "distance_kind": "mi"}'
Response Example Success
HTTP 200 OK