Skip to main content

fairjungle (2.0.0)

Download OpenAPI specification:Download

This is the documentation for:

Authentication

You need an API Key or an OAuth Access Token associated to a user with admin role in order to authenticate API requests.

An API Key or an OAuth Access Token carry many privileges, so be sure to keep them secure! Do not share them in publicly accessible areas such as GitHub, client-side code, and so forth.

Authentication is performed via HTTP Authorization header. Example:

  Authorization: Bearer BdA5ijnMx8m7dqX0Fnl7NmB18etmVhFI

All API requests must be made over HTTPS.

apiKey

API key

Security Scheme Type: API Key
Header parameter name: Authorization

openIdConnect

Security Scheme Type: OpenID Connect

Fairjungle API

Our custom REST API allows you to manage fairjungle resources.

Document Structure

A JSON object is at the root of every request and response containing data. This object defines a document’s “top level”.

Request document

A request document may contain the following top-level member:

  • data: the document’s “primary data”

Response document

A successfull response document may contain the following top-level members:

  • data: the document’s “primary data”
  • meta: additional informations

Primary data

Primary data is either:

  • a single resource object for requests that target single resources
  • an array of resource objects, or an empty array ([]), for requests that target resource collections

The resource attributes that have no value are not returned, except for booleans attributes that always have a false default value. It means that server nevers sends null values in resource data.

Fetching data

Data can be fetched by sending a GET request to an endpoint.

For example, the following request fetches a collection of users:

GET /api/users

The following request fetches a user:

GET /api/users/35c93884-5cca-4e72-98ff-eb52f611cb21

Responses

200 OK

The server responds to a successful request to fetch an individual resource or resource collection with a 200 OK response.

The server responds to a successful request to fetch a resource collection with an array of resource objects or an empty array ([]) as the response document’s primary data.

The server responds to a successful request to fetch an individual resource with a resource object provided as the response document’s primary data.

401 Unauthorized

The server responds with 401 Unauthorized when processing a request without authentication.

403 Forbidden

The server returns 403 Forbidden in response to an unsupported request to retrieve a resource.

404 Not Found

The server responds with 404 Not Found when processing a request to fetch a single resource that does not exist.

Pagination

All endpoints that return resource collections are paginated. A default pagination is applied if no pagination parameter is provided by client.

There are two kinds of paginations:

  • Offset based pagination
  • Cursor based pagination

The offset based pagination is supported by all endpoints, and it is the default pagination. Additionally, some endpoints may support cursor based pagination. Please refer to each individual endpoint documentation for more info.

To use cursor based pagination with endpoints that support it, then you have to set the pageKind query parameter with cursor as value.

Offset based pagination

Offset based pagination query parameters are:

  • pageKind: offset
  • limit: maximum number of items to return (default: 10)
  • offset: number of items to skip (default: 0)

The meta top-level member in the response document contains those fields:

  • pageKind: offset
  • limit: the query parameter value
  • offset: the query parameter value
  • total: the total number of items on the server

Cursor based pagination

Cursor based pagination query parameters are:

  • pageKind: cursor
  • limit: maximum number of items to return (default: 10)
  • after: a cursor value that identifies the first item to retrieve
  • before: a cursor value that identifies the last item to retrieve

The after and before parameters are mutually exclusive: only one of after or before may be used.

The meta top-level member in the response document contains those fields:

  • pageKind: cursor
  • limit: the query parameter value
  • after: the query parameter value
  • before: the query parameter value
  • nextAfter: a cursor value that can be used to retrieve next items with after query parameter
  • prevBefore: a cursor value that can be used to retrieve previous items with before query parameter

Sorting

Endpoints that return resource collections accepts additional query parameters to control sorting of returned resources:

  • order: sorting order (default: asc)
  • sortBy: sorting field (default: createdAt)

The meta top-level member in the response document contains those fields:

  • order: the query parameter value
  • sortBy: the query parameter value

The allowed order values are asc and desc.

The allowed sortBy values are endpoint specific. Please refer to each individual endpoint documentation for more info.

Creating, Updating and Deleting Resources

Creating Resources

A resource can be created by sending a POST request to a URL that represents a collection of resources. The request includes a single resource object as primary data.

Responses

201 Created

If the requested resource has been created successfully, the server returns a 201 Created status code.

The response also includes a document that contains the primary resource created.

401 Unauthorized

The server responds with 401 Unauthorized when processing a request without authentication.

403 Forbidden

The server returns 403 Forbidden in response to an unsupported request to create a resource.

422 Unprocessable Entity

The server returns 422 Unprocessable Entity when processing a POST request to create a resource if the resource validation failed.

Updating Resources

A resource can be:

  • partially updated by sending a PATCH request to the URL that represents the resource
  • entirely replaced by sending a PUT request to the URL that represents the resource

The request includes a single resource object as primary data.

The patching mecanism follows the JSON merge patch specification:

  • If a request does not include all of the attributes for a resource, the server interprets the missing attributes as if they were included with their current values.
  • An attribute can be deleted by explicitly sending the null value.
  • The server does not interpret missing attributes as null values.

If you use the PUT method, then:

  • If a request does not include all of the attributes for a resource, the server interprets the missing attributes as if they were deleted.
  • An attribute can still be deleted by explicitly sending the null value.

Responses

200 OK

The server returns a 200 OK status code if an update is successful. The response document includes a representation of the updated resource as if a GET request was made to the request URL.

401 Unauthorized

The server responds with 401 Unauthorized when processing a request without authentication.

403 Forbidden

The server returns 403 Forbidden in response to an unsupported request to update a resource.

404 Not Found

The server returns 404 Not Found when processing a request to modify a resource that does not exist.

422 Unprocessable Entity

The server returns 422 Unprocessable Entity when processing a PATCH request to update a resource if the resource validation failed.

Deleting Resources

An individual resource can be deleted by making a DELETE request to the resource’s URL.

Responses

200 OK

The server returns a 200 OK status code if a deletion request is successful. The response document includes a representation of the resource before deletion.

401 Unauthorized

The server responds with 401 Unauthorized when processing a request without authentication.

403 Forbidden

The server returns 403 Forbidden in response to an unsupported request to delete a resource.

404 Not Found

The server returns a 404 Not Found status code if a deletion request fails due to the resource not existing.

Errors

Processing errors

Fairjungle uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate a server error.

Error response

The error response provides additional information about problems encountered while performing an operation.

This is the error response schema:

code
required
string
Enum: "badRequest" "conflict" "forbidden" "internalError" "invalidParam" "notFound" "notImpl" "validationFailed"

Error code.

message
required
string

Short, human-readable summary of the problem type.

Array of objects
{
  • "code": "validationFailed",
  • "message": "Your request parameters didn't validate.",
  • "invalid": [
    ]
}

The error response always have the following fields:

  • code: an application-specific error code, expressed as a string value.
  • message: a short, human-readable summary of the problem.

The error response may have the following field:

  • invalid: if error code is validationFailed or invalidParam then that field contains an array of error details with associated invalid fields or parameters

Items in the invalid array have the following fields:

  • field: field or parameter name
  • value: invalid value received
  • code: validation code
  • message: validation message

Example for a 400 Bad Request error:

{
  "code": "badRequest",
  "message": "Top-level document 'data' member is missing"
}

Example for a 400 Bad Request error with invalid parameter:

{
  "code": "invalidParam",
  "invalid": [
    {
      "code": "paramValue",
      "field": "limit",
      "message": "limit parameter must be between 1 and 100",
      "value": 500
    }
  ],
  "message": "Invalid pagination parameter provided"
}

Example for a 422 Unprocessable Entity error:

{
  "code": "validationFailed",
  "invalid": [
    {
      "code": "country",
      "field": "address.country",
      "message": "The 'country' field is invalid",
      "value": "PLOP"
    },
    {
      "code": "email",
      "field": "email",
      "message": "The 'email' field is invalid",
      "value": "john @mycompany.com"
    },
    {
      "code": "required",
      "field": "name",
      "message": "The 'name' field is mandatory",
      "value": ""
    }
  ],
  "message": "Resource validation failed"
}

Billing operations

A billing operation represents the lowest billing granularity.

The transactionKind field:

A purchase billing operation is created:

  • when fairjungle booked a trip on your behalf (a billing operation is created for each part of the trip)
  • when your subscription invoice is emitted

A refund billing operation is created when a booking is canceled, or when a manual refund is issued. There are then two cases:

  • if this is done before the corresponding invoice is emitted, then the invoice balance is adjusted and no refund resource is created (ie. the refundId attribute is null)
  • if this is done after the corresponding invoice was emitted, then a money transfer is performed, a refund resource is created, and the refundId attributed is filled

A dispute billing operarion is created when our billing provider detects an issue with an already paid invoice, and automatically refunds back the invoice charge to your bank account. A dispute resource is created, and the refundId attributed is filled. This is a special case that must be regularized with our support team. Note that the dispute does not appear on the invoice, and no refund resource is created.

The operationType field:

An operation can be:

  • a booking related operation, with either the generic booking value, or with one of the more specific values: car, flight, hotel, rail or seminar
  • a subscription operation
  • an other operation (performed by the support team)

In case of booking operation, the bookingSnapshot field contains the informations at the time of the booking, and if booking was performed via online channel then the tripProjectId field links to the corresponding trip project.

The status field:

This field value depends on transactionKind field:

  • purchase: this is either the status of the corresponding invoice resource, or delayed if no invoice was emitted yet. Possible values: delayed, open, paid, uncollectible and void.
  • refund: this is either the status of the corresponding refund resource if corresponding invoice status is paid, or delayed if refund is performed while the corresponding invoice status is still open, otherwise succeeded if no invoice was emitted yet. Possible values: delayed, waiting, pending, succeeded, failed and canceled.
  • dispute: this is the status of the corresponding dispute resource.

Billing operation

This is the billingOperation resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the billing operation.

type
required
string
Value: "billingOperation"

The resource type.

createdAt
required
string <date-time>

Time at which the billing operation resource was created.

required
object

The billing operation amount.

object

Snapshot of informations at the time of booking.

Present only if this is a booking related operation.

costCenterId
string = 24 characters ^[a-f\d]{24}$

The ID of the associated cost center.

Array of objects

Array of custom fields.

date
required
string <date-time>

Time at which the related action was performed. For example, the booking date in case of booking operation.

description
string

Description.

disputeId
string = 24 characters ^[a-f\d]{24}$

The ID of the associated dispute.

invoiceId
string = 24 characters ^[a-f\d]{24}$

The ID of the associated invoice.

operationType
required
string
Enum: "booking" "car" "flight" "hotel" "other" "rail" "seminar" "subscription"

Billing operation type.

projectCodeId
string = 24 characters ^[a-f\d]{24}$

The ID of the associated project code.

refundId
string = 24 characters ^[a-f\d]{24}$

The ID of the associated refund.

status
required
string

Billing operation status.

transactionKind
required
string
Enum: "dispute" "purchase" "refund"

Transaction kind.

tripProjectId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

The ID of the associated trip project.

Present only if this is a booking operation and if bookingSnapshot.channel value is online.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "billingOperation",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "amount": {
    },
  • "bookingSnapshot": {
    },
  • "costCenterId": "5de7bc72bf882f3bb31619bf",
  • "customFields": [
    ],
  • "date": "2019-09-25T07:35:42Z",
  • "description": "Roundtrip flight - Diego de la Vega - Paris > Tokyo - 25SEP2020",
  • "disputeId": "5de7bc72bf882f3bb31619bf",
  • "invoiceId": "5de7bc72bf882f3bb31619bf",
  • "operationType": "booking",
  • "projectCodeId": "5de7bc72bf882f3bb31619bf",
  • "refundId": "5de7bc72bf882f3bb31619bf",
  • "status": "string",
  • "transactionKind": "dispute",
  • "tripProjectId": "35c93884-5cca-4e72-98ff-eb52f611cb21"
}

List billing operations

Returns a list of billing operations.

By default, billing operations are returned sorted by creation date with oldest operations returned first.

The sortBy parameter allows you to sort billing operations by date field too.

You can enable cursor based pagination by setting pageKind parameter with cursor value.

query Parameters
pageKind
string
Default: "offset"
Enum: "offset" "cursor"

Pagination kind.

limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

before
string
Example: before=ZG9jX2lkOjVkOTc2OTYxYTI0YjBjMTcyNmY2NWJkMg==

Cursor value that identifies the last item to retrieve. Can be used only for cursor based pagination.

after
string
Example: after=ZG9jX2lkOjVkYWVmYThhMTg1YjNlNmNiM2Q3OTY3OA==

Cursor value that identifies the first item to retrieve. Can be used only for cursor based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "date"

Sorting field.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve a billing operation

Retrieves a billing operation.

path Parameters
id
required
string <uuid>

The identifier of the billing operation to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Billing profiles

Each billing profile has its own payment method and billing informations.

NOTE: you can't associate a payment method to a billing profile through the API.

Billing profile

This is the billingProfile resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the billing profile.

type
required
string
Value: "billingProfile"

The resource type.

createdAt
required
string <date-time>

Time at which the billing profile was created.

object (BillingProfileAddress)

The billing profile postal address.

archived
required
boolean

If true, then that billing profile is archived.

companyName
string

Full business name.

email
required
string <email>

Email used to receive billing infos.

lang
required
string
Enum: "en" "fr"

Language used for billing emails and generated invoices.

name
required
string

Billing profile name.

paymentMethodSummary
string

The payment method associated to that billing profile.

taxId
string

European VAT number.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this billing profile.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "billingProfile",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "address": {
    },
  • "archived": true,
  • "companyName": "Fairjungle",
  • "email": "john.smith@example.com",
  • "lang": "en",
  • "name": "France Department",
  • "paymentMethodSummary": "Credit card (****-4242)",
  • "taxId": "DE123456789",
  • "travelPolicyId": "5de7bc72bf882f3bb31619bf"
}

List billing profiles

Returns a list of billing profiles.

The archived parameter permits to returns only archived or non archived billing profiles.

By default, billing profiles are returned sorted by creation date with oldest billing profiles returned first.

The sortBy parameter allows you to sort billing operations by name field too.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "name"

Sorting field.

archived
string
Example: archived=false

If true then only archived resources are returned. If false then only non-archived resources are returned. If not provided then all resources are returned.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a billing profile

Creates a new billing profile.

Request Body schema: application/json
required

Billing profile resource

required
object (BillingProfileReplace)

The billing profile resource.

object (BillingProfileAddress)

The billing profile postal address.

archived
boolean

If true, then that billing profile is archived.

companyName
string

Full business name.

email
required
string <email>

Email used to receive billing infos.

lang
required
string
Enum: "en" "fr"

Language used for billing emails and generated invoices.

name
required
string

Billing profile name.

taxId
string

European VAT number.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this billing profile.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a billing profile

Retrieves a billing profile.

path Parameters
id
required
string <uuid>

The identifier of the billing profile to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a billing profile

Updates a billing profile with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the billing profile to update.

Request Body schema: application/json
required

Billing profile resource

required
object (BillingProfilePatch)

The billing profile fields to update.

object (BillingProfileAddress)

The billing profile postal address.

archived
boolean

If true, then that billing profile is archived.

companyName
string

Full business name.

email
string <email>

Email used to receive billing infos.

lang
string
Enum: "en" "fr"

Language used for billing emails and generated invoices.

name
string

Billing profile name.

taxId
string

European VAT number.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this billing profile.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a billing profile

Updates a billing profile by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the billing profile to update.

Request Body schema: application/json
required

Billing profile resource

required
object (BillingProfileReplace)

The billing profile resource.

object (BillingProfileAddress)

The billing profile postal address.

archived
boolean

If true, then that billing profile is archived.

companyName
string

Full business name.

email
required
string <email>

Email used to receive billing infos.

lang
required
string
Enum: "en" "fr"

Language used for billing emails and generated invoices.

name
required
string

Billing profile name.

taxId
string

European VAT number.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this billing profile.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a billing profile

Deletes a billing profile.

path Parameters
id
required
string <uuid>

The identifier of the billing profile to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Cost centers

Associating users to cost centers permit to tag emitted invoices with cost centers.

Cost center

This is the costCenter resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the cost center.

type
required
string
Value: "costCenter"

The resource type.

createdAt
required
string <date-time>

Time at which the cost center was created.

archived
required
boolean

If true, then that cost center is archived.

name
required
string

Cost center name.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this cost center.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "costCenter",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "archived": true,
  • "name": "VIP",
  • "travelPolicyId": "5de7bc72bf882f3bb31619bf"
}

List cost centers

Returns a list of cost centers.

The archived parameter permits to returns only archived or non archived cost centers.

By default, cost centers are returned sorted by creation date with oldest cost centers returned first.

The sortBy parameter allows you to sort cost centers by name field too.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "name"

Sorting field.

archived
string
Example: archived=false

If true then only archived resources are returned. If false then only non-archived resources are returned. If not provided then all resources are returned.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a cost center

Creates a new cost center.

Request Body schema: application/json
required

Cost center resource

required
object (CostCenterReplace)

The cost center resource.

archived
boolean

If true, then that cost center is archived.

name
required
string

Cost center name.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this cost center.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a cost center

Retrieves a cost center.

path Parameters
id
required
string <uuid>

The identifier of the cost center to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a cost center

Updates a cost center with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the cost center to update.

Request Body schema: application/json
required

Cost center resource

required
object (CostCenterPatch)

The cost center fields to update.

archived
boolean

If true, then that cost center is archived.

name
string

Cost center name.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this cost center.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a cost center

Updates a cost center by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the cost center to update.

Request Body schema: application/json
required

Cost center resource

required
object (CostCenterReplace)

The cost center resource.

archived
boolean

If true, then that cost center is archived.

name
required
string

Cost center name.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this cost center.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a cost center

Deletes a cost center.

path Parameters
id
required
string <uuid>

The identifier of the cost center to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Custom fields

Associate custom fields to resources.

Custom field

This is the customField resource schema:

dataType
required
string
Enum: "text" "option" "optionsList"

Custom field value data type.

resourceType
required
string
Enum: "tripProject" "user"

Custom field is attached to that resource type.

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the custom field.

type
required
string
Value: "customField"

The resource type.

createdAt
required
string <date-time>

Time at which the custom field was created.

description
string

Custom field description.

disabled
required
boolean

If true, then that custom field can't be assigned to resource anymore.

editableByApprover
boolean

If true, then custom field can be edited by approver.

mandatory
required
boolean

If true, then custom field id not optional.

name
required
string

Custom field name.

validationRegexp
string

A regular expression used to ensure that custom field value has a particular format.

{
  • "dataType": "text",
  • "resourceType": "tripProject",
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "customField",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "description": "string",
  • "disabled": true,
  • "editableByApprover": true,
  • "mandatory": true,
  • "name": "Budget Code",
  • "validationRegexp": "^\\\\d\\\\d\\\\d\\\\d$"
}

This is the customFieldOption resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the custom field option.

type
required
string
Value: "customFieldOption"

The resource type.

createdAt
required
string <date-time>

Time at which the custom field option was created.

customFieldId
required
string = 24 characters ^[a-f\d]{24}$

The ID of the custom field associated to this option.

data
required
string

custom field option value data.

disabled
required
boolean

If true, then that custom field option can't be assigned to resource anymore.

displayName
string

custom field option display name.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "customFieldOption",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "customFieldId": "5de7bc72bf882f3bb31619bf",
  • "data": "string",
  • "disabled": true,
  • "displayName": "string"
}

List custom fields

Returns a list of custom fields.

Custom fields are returned sorted by creation date, and by default oldest custom fields are returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a custom field

Creates a new custom field.

Request Body schema: application/json
required

Custom field resource

required
object (CustomFieldCreate)

The custom field resource.

dataType
required
string
Enum: "text" "option" "optionsList"

Custom field value data type.

resourceType
required
string
Enum: "tripProject" "user"

Custom field is attached to that resource type.

description
string

Custom field description.

disabled
boolean

If true, then that custom field can't be assigned to resource anymore.

editableByApprover
boolean

If true, then custom field can be edited by approver.

mandatory
boolean

If true, then custom field id not optional.

name
required
string

Custom field name.

validationRegexp
string

A regular expression used to ensure that custom field value has a particular format.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a custom field

Retrieves a custom field.

path Parameters
id
required
string <uuid>

The identifier of the custom field to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a custom field

Updates a custom field with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the custom field to update.

Request Body schema: application/json
required

Custom field resource

required
object (CustomFieldPatch)

The custom field fields to update.

description
string

Custom field description.

disabled
boolean

If true, then that custom field can't be assigned to resource anymore.

editableByApprover
boolean

If true, then custom field can be edited by approver.

mandatory
boolean

If true, then custom field id not optional.

name
string

Custom field name.

validationRegexp
string

A regular expression used to ensure that custom field value has a particular format.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a custom field

Updates a custom field by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the custom field to update.

Request Body schema: application/json
required

Custom field resource

required
object (CustomFieldReplace)

The custom field resource.

description
string

Custom field description.

disabled
boolean

If true, then that custom field can't be assigned to resource anymore.

editableByApprover
boolean

If true, then custom field can be edited by approver.

mandatory
boolean

If true, then custom field id not optional.

name
required
string

Custom field name.

validationRegexp
string

A regular expression used to ensure that custom field value has a particular format.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a custom field

Deletes a custom field.

path Parameters
id
required
string <uuid>

The identifier of the custom field to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

List custom field options

Returns a list of custom field options.

Custom field options are returned sorted by creation date, and by default oldest custom field options are returned first.

Cursor based pagination is not available.

path Parameters
id
required
string <uuid>

The identifier of the custom field.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a custom field option

Creates a new custom field option.

path Parameters
id
required
string <uuid>

The identifier of the custom field.

Request Body schema: application/json
required

Custom field option resource

required
object (CustomFieldOptionReplace)

The custom field option resource.

data
required
string

custom field option value data.

disabled
boolean

If true, then that custom field option can't be assigned to resource anymore.

displayName
string

custom field option display name.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a custom field option

Retrieves a custom field option.

path Parameters
id
required
string <uuid>

The identifier of the custom field.

optionId
required
string <uuid>

The identifier of the custom field option to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a custom field option

Updates a custom field option with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the custom field.

optionId
required
string <uuid>

The identifier of the custom field option to update.

Request Body schema: application/json
required

Custom field option resource

required
object (CustomFieldOptionPatch)

The custom field option fields to update.

data
string

custom field option value data.

disabled
boolean

If true, then that custom field option can't be assigned to resource anymore.

displayName
string

custom field option display name.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a custom field option

Updates a custom field option by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the custom field.

optionId
required
string <uuid>

The identifier of the custom field option to update.

Request Body schema: application/json
required

Custom field option resource

required
object (CustomFieldOptionReplace)

The custom field option resource.

data
required
string

custom field option value data.

disabled
boolean

If true, then that custom field option can't be assigned to resource anymore.

displayName
string

custom field option display name.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a custom field option

Deletes a custom field option.

path Parameters
id
required
string <uuid>

The identifier of the custom field.

optionId
required
string <uuid>

The identifier of the custom field option to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Disputes

A payment dispute may be emitted by our payment provider.

Dispute

This is the dispute resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the dispute.

type
required
string
Value: "dispute"

The resource type.

createdAt
required
string <date-time>

Time at which the dispute was created.

required
object

The dispute amount.

invoiceId
required
string = 24 characters ^[a-f\d]{24}$

The ID of the invoice associated to this dispute.

reason
required
string
Enum: "warningNeedsResponse" "bankCannotProcess" "creditNotProcessed" "customerInitiated" "debitNotAuthorized" "duplicate" "fraudulent" "general" "incorrectAccountDetails" "insufficientFunds" "productNotReceived" "productUnacceptable" "subscriptionCanceled" "unrecognized"

Dispute reason

status
required
string
Enum: "warningNeedsResponse" "warningUnderReview" "warningClosed" "needsResponse" "underReview" "chargeRefunded" "won" "lost" "solved"

Dispute status

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "dispute",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "amount": {
    },
  • "invoiceId": "5de7bc72bf882f3bb31619bf",
  • "reason": "warningNeedsResponse",
  • "status": "warningNeedsResponse"
}

List disputes

Returns a list of disputes.

Disputes are returned sorted by creation date, and by default oldest disputes are returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve a dispute

Retrieves a dispute.

path Parameters
id
required
string <uuid>

The identifier of the dispute to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Events

Events occur when the state of another API resource changes. The state of that resource at the time of the change is embedded in the event's data field. For example, a costCenter.created event will contain a cost center, and an invoice.updated event will contain an invoice.

Events can be sent to your applications with webhooks.

NOTE: access to events through the API is guaranteed only for 30 days.

Event

This is the event resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the event.

type
required
string
Value: "event"

The resource type.

createdAt
required
string <date-time>

Time at which the event was created.

required
BillingOperation (object) or BillingProfile (object) or Booking (object) or BookingCancellation (object) or BookingModification (object) or CostCenter (object) or Invoice (object) or ProjectCode (object) or TravelPolicy (object) or TripProject (object) or User (object) or Webhook (object)

Object containing the resource relevant to the event.

kind
required
string
Enum: "billingOperation.created" "billingOperation.updated" "billingProfile.created" "billingProfile.deleted" "billingProfile.updated" "bookingCancellation.created" "bookingModification.created" "costCenter.created" "costCenter.deleted" "costCenter.updated" "dispute.created" "dispute.updated" "invoice.created" "invoice.updated" "projectCode.created" "projectCode.deleted" "projectCode.updated" "refund.created" "refund.updated" "travelPolicy.created" "travelPolicy.deleted" "travelPolicy.updated" "tripProject.booking.failed" "tripProject.booking.succeeded" "tripProject.created" "user.created" "user.deleted" "user.updated" "webhook.created" "webhook.deleted" "webhook.updated"

Event kind

previousAttributes
object

Object containing the names of the attributes that have changed, and their previous values (sent along only with *.updated events).

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "event",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "data": {
    },
  • "kind": "billingOperation.created",
  • "previousAttributes": { }
}

List events

Returns a list of events.

Events are returned sorted by creation date, and by default oldest operations are returned first.

You can enable cursor based pagination by setting pageKind parameter with cursor value.

query Parameters
pageKind
string
Default: "offset"
Enum: "offset" "cursor"

Pagination kind.

limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

before
string
Example: before=ZG9jX2lkOjVkOTc2OTYxYTI0YjBjMTcyNmY2NWJkMg==

Cursor value that identifies the last item to retrieve. Can be used only for cursor based pagination.

after
string
Example: after=ZG9jX2lkOjVkYWVmYThhMTg1YjNlNmNiM2Q3OTY3OA==

Cursor value that identifies the first item to retrieve. Can be used only for cursor based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve an event

Retrieves an event.

path Parameters
id
required
string <uuid>

The identifier of the event to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Invoices

An emitted invoice is the aggregate of one or several purchase and refund billing operations.

Invoice

This is the invoice resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the invoice.

type
required
string
Value: "invoice"

The resource type.

createdAt
required
string <date-time>

Time at which the invoice was created.

required
object

The invoice amount.

billingOperationsCount
required
integer <int32>

Number of billing operations associated to that invoice.

billingProfileId
required
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with invoice.

description
required
string

Description.

kind
required
string
Enum: "booking" "other" "subscription"

Invoice kind.

paymentMethodSummary
string

The payment method used for that invoice.

paymentReference
string

Payment reference.

pdf
string

The URL for the invoice PDF.

reference
string

Invoice reference.

status
required
string
Enum: "open" "paid" "uncollectible" "void"

Invoice status.

url
string

The URL for the hosted invoice page.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "invoice",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "amount": {
    },
  • "billingOperationsCount": 0,
  • "billingProfileId": "5de7bc72bf882f3bb31619bf",
  • "description": "Monthly invoice - February 2020.",
  • "kind": "booking",
  • "paymentMethodSummary": "Credit card (****-4242)",
  • "paymentReference": "Fairjungle p1gh025yx",
  • "pdf": "string",
  • "reference": "5D4B4AC8-0009",
  • "status": "open",
  • "url": "string"
}

List invoices

Returns a list of invoices.

Invoices are returned sorted by creation date, and by default oldest invoices are returned first.

You can enable cursor based pagination by setting pageKind parameter with cursor value.

query Parameters
pageKind
string
Default: "offset"
Enum: "offset" "cursor"

Pagination kind.

limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

before
string
Example: before=ZG9jX2lkOjVkOTc2OTYxYTI0YjBjMTcyNmY2NWJkMg==

Cursor value that identifies the last item to retrieve. Can be used only for cursor based pagination.

after
string
Example: after=ZG9jX2lkOjVkYWVmYThhMTg1YjNlNmNiM2Q3OTY3OA==

Cursor value that identifies the first item to retrieve. Can be used only for cursor based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve an invoice

Retrieves an invoice.

path Parameters
id
required
string <uuid>

The identifier of the invoice to retrieve.

Responses

Response samples

Content type
application/json
{}

List invoice billing operations

Returns a list of billing operations corresponding to invoice.

By default, billing operations are returned sorted by creation date with oldest operations returned first.

The sortBy parameter allows you to sort billing operations by date field too.

You can enable cursor based pagination by setting pageKind parameter with cursor value.

path Parameters
id
required
string <uuid>

The identifier of the invoice.

query Parameters
pageKind
string
Default: "offset"
Enum: "offset" "cursor"

Pagination kind.

limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

before
string
Example: before=ZG9jX2lkOjVkOTc2OTYxYTI0YjBjMTcyNmY2NWJkMg==

Cursor value that identifies the last item to retrieve. Can be used only for cursor based pagination.

after
string
Example: after=ZG9jX2lkOjVkYWVmYThhMTg1YjNlNmNiM2Q3OTY3OA==

Cursor value that identifies the first item to retrieve. Can be used only for cursor based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "date"

Sorting field.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Project codes

Project codes can be associated to trips, and to their corresponding invoices.

Project code

This is the projectCode resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the project code.

type
required
string
Value: "projectCode"

The resource type.

createdAt
required
string <date-time>

Time at which the project code was created.

approverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of approver associated with that project code.

archived
required
boolean

If true, then that project code is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with project code.

code
required
string

Project code.

confidential
required
boolean

A confidential project does not appear in search input auto-completion.

name
string

Project code name.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "projectCode",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "approverId": "35c93884-5cca-4e72-98ff-eb52f611cb21",
  • "archived": true,
  • "billingProfileId": "5de7bc72bf882f3bb31619bf",
  • "code": "NextGen",
  • "confidential": true,
  • "name": "The next generation"
}

List project codes

Returns a list of project codes.

The archived parameter permits to returns only archived or non archived project codes.

By default, project codes are returned sorted by creation date with oldest project codes returned first.

The sortBy parameter allows you to sort project codes by code field too.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "code"

Sorting field.

archived
string
Example: archived=false

If true then only archived resources are returned. If false then only non-archived resources are returned. If not provided then all resources are returned.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a project code

Creates a new project code.

Request Body schema: application/json
required

Project code resource

required
object (ProjectCodeReplace)

The project code resource.

approverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of approver associated with that project code.

archived
boolean

If true, then that project code is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with project code.

code
required
string

Project code.

confidential
boolean

A confidential project does not appear in search input auto-completion.

name
string

Project code name.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a project code

Retrieves a project code.

path Parameters
id
required
string <uuid>

The identifier of the project code to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a project code

Updates a project code with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the project code to update.

Request Body schema: application/json
required

Project code resource

required
object (ProjectCodePatch)

The project code fields to update.

approverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of approver associated with that project code.

archived
boolean

If true, then that project code is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with project code.

code
string

Project code.

confidential
boolean

A confidential project does not appear in search input auto-completion.

name
string

Project code name.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a project code

Updates a project code by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the project code to update.

Request Body schema: application/json
required

Project code resource

required
object (ProjectCodeReplace)

The project code resource.

approverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of approver associated with that project code.

archived
boolean

If true, then that project code is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with project code.

code
required
string

Project code.

confidential
boolean

A confidential project does not appear in search input auto-completion.

name
string

Project code name.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a project code

Deletes a project code.

path Parameters
id
required
string <uuid>

The identifier of the project code to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Refunds

A refund is an actual money transfer from fairjungle back to your bank account.

Refund

This is the refund resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the refund.

type
required
string
Value: "refund"

The resource type.

createdAt
required
string <date-time>

Time at which the refund was created.

required
object

The refund amount.

invoiceId
required
string = 24 characters ^[a-f\d]{24}$

The ID of the invoice associated to this refund.

pdf
string

The URL for the refund PDF.

status
required
string
Enum: "waiting" "pending" "succeeded" "failed" "canceled"

Refund status

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "refund",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "amount": {
    },
  • "invoiceId": "5de7bc72bf882f3bb31619bf",
  • "pdf": "string",
  • "status": "waiting"
}

List refunds

Returns a list of refunds.

Refunds are returned sorted by creation date, and by default oldest refunds are returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve a refund

Retrieves a refund.

path Parameters
id
required
string <uuid>

The identifier of the refund to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

SCIM User Mappings

SCIM user mapping permits you to control how user attributes are provisioned with SCIM protocol.

You can map a SCIM attribute to either:

  • a custom field
  • a user attribute

SCIM User Mapping

This is the scimUserMapping resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the user mapping.

type
required
string
Value: "scimUserMapping"

The resource type.

createdAt
required
string <date-time>

Time at which the user mapping was created.

scimAttribute
required
string
Enum: "displayName" "name.honorificPrefix" "name.honorificSuffix" "name.middleName" "nickName" "title" "userType" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:costCenter" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:division" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.displayName" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.value"

SCIM attribute.

customFieldId
string = 24 characters ^[a-f\d]{24}$

The ID of the custom field mapped to SCIM attribute.

If present, then userAttribute must be null.

userAttribute
string
Enum: "dateOfBirth" "email" "firstName" "lastName" "phoneNumber"

The name of the user attribute mapped to SCIM attribute.

If present, then customFieldId must be null.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "scimUserMapping",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "scimAttribute": "displayName",
  • "customFieldId": "5de7bc72bf882f3bb31619bf",
  • "userAttribute": "dateOfBirth"
}

List SCIM user mappings

Returns a list of SCIM user mappings.

By default, SCIM user mappings are returned sorted by creation date with oldest SCIM user mappings returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a SCIM user mapping

Creates a new SCIM user mapping.

Request Body schema: application/json
required

SCIM user mapping resource

required
object (SCIMUserMappingReplace)

The user mapping resource.

scimAttribute
required
string
Enum: "displayName" "name.honorificPrefix" "name.honorificSuffix" "name.middleName" "nickName" "title" "userType" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:costCenter" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:division" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.displayName" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.value"

SCIM attribute.

customFieldId
string = 24 characters ^[a-f\d]{24}$

The ID of the custom field mapped to SCIM attribute.

If present, then userAttribute must be null.

userAttribute
string
Enum: "dateOfBirth" "email" "firstName" "lastName" "phoneNumber"

The name of the user attribute mapped to SCIM attribute.

If present, then customFieldId must be null.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a SCIM user mapping

Retrieves a SCIM user mapping.

path Parameters
id
required
string <uuid>

The identifier of the SCIM user mapping to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a SCIM user mapping

Updates a SCIM user mapping with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the SCIM user mapping to update.

Request Body schema: application/json
required

SCIM user mapping resource

required
object (SCIMUserMappingPatch)

The user mapping fields to update.

scimAttribute
string
Enum: "displayName" "name.honorificPrefix" "name.honorificSuffix" "name.middleName" "nickName" "title" "userType" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:costCenter" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:division" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.displayName" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.value"

SCIM attribute.

customFieldId
string = 24 characters ^[a-f\d]{24}$

The ID of the custom field mapped to SCIM attribute.

If present, then userAttribute must be null.

userAttribute
string
Enum: "dateOfBirth" "email" "firstName" "lastName" "phoneNumber"

The name of the user attribute mapped to SCIM attribute.

If present, then customFieldId must be null.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a SCIM user mapping

Updates a SCIM user mapping by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the SCIM user mapping to update.

Request Body schema: application/json
required

SCIM user mapping resource

required
object (SCIMUserMappingReplace)

The user mapping resource.

scimAttribute
required
string
Enum: "displayName" "name.honorificPrefix" "name.honorificSuffix" "name.middleName" "nickName" "title" "userType" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:costCenter" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:division" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.displayName" "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager.value"

SCIM attribute.

customFieldId
string = 24 characters ^[a-f\d]{24}$

The ID of the custom field mapped to SCIM attribute.

If present, then userAttribute must be null.

userAttribute
string
Enum: "dateOfBirth" "email" "firstName" "lastName" "phoneNumber"

The name of the user attribute mapped to SCIM attribute.

If present, then customFieldId must be null.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a SCIM user mapping

Deletes a SCIM user mapping.

path Parameters
id
required
string <uuid>

The identifier of the SCIM user mapping to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Travel policies

Travel policies enables you to control your company travel spend, volume and safety.

Travel policy

This is the travelPolicy resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the travel policy.

type
required
string
Value: "travelPolicy"

The resource type.

createdAt
required
string <date-time>

Time at which the travel policy was created.

control
required
string
Enum: "full" "none" "notif" "smart"

Travel control type.

  • full: all travels need approval
  • none: all travels are allowed
  • notif: all travels are allowed, with a notification sent to approver
  • smart: travel control is computed thanks to smartSettings
default
required
boolean
Default: false

This is default travel policy.

defaultApproverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of default approver to use.

required
object

Settings to compute hotel budget.

name
required
string

Travel policy name.

object

Settings for smart control. Present only if control field value is smart.

required
object

Settings to compute transport budget.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "travelPolicy",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "control": "full",
  • "default": false,
  • "defaultApproverId": "35c93884-5cca-4e72-98ff-eb52f611cb21",
  • "hotelBudget": {
    },
  • "name": "The next generation",
  • "smartSettings": {
    },
  • "transportBudget": {
    }
}

List travel policies

Returns a list of travel policies.

Travel policies are returned sorted by creation date, and by default oldest travel policies are returned first.

The sortBy parameter allows you to sort travel policies by name field too.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "name"

Sorting field.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a travel policy

Creates a new travel policy.

Request Body schema: application/json
required

Travel policy resource

required
object (TravelPolicyReplace)

The travel policy resource.

control
required
string
Enum: "full" "none" "notif" "smart"

Travel control type.

  • full: all travels need approval
  • none: all travels are allowed
  • notif: all travels are allowed, with a notification sent to approver
  • smart: travel control is computed thanks to smartSettings
default
boolean
Default: false

This is default travel policy.

defaultApproverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of default approver to use.

required
object

Settings to compute hotel budget.

name
required
string

Travel policy name.

object

Settings for smart control. Present only if control field value is smart.

required
object

Settings to compute transport budget.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a travel policy

Retrieves a travel policy.

path Parameters
id
required
string <uuid>

The identifier of the travel policy to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a travel policy

Updates a travel policy with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the travel policy to update.

Request Body schema: application/json
required

Travel policy resource

required
object (TravelPolicyPatch)

The travel policy fields to update.

control
string
Enum: "full" "none" "notif" "smart"

Travel control type.

  • full: all travels need approval
  • none: all travels are allowed
  • notif: all travels are allowed, with a notification sent to approver
  • smart: travel control is computed thanks to smartSettings
default
boolean
Default: false

This is default travel policy.

defaultApproverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of default approver to use.

object

Settings to compute hotel budget.

name
string

Travel policy name.

object

Settings for smart control. Present only if control field value is smart.

object

Settings to compute transport budget.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a travel policy

Updates a travel policy by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the travel policy to update.

Request Body schema: application/json
required

Travel policy resource

required
object (TravelPolicyReplace)

The travel policy resource.

control
required
string
Enum: "full" "none" "notif" "smart"

Travel control type.

  • full: all travels need approval
  • none: all travels are allowed
  • notif: all travels are allowed, with a notification sent to approver
  • smart: travel control is computed thanks to smartSettings
default
boolean
Default: false

This is default travel policy.

defaultApproverId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of default approver to use.

required
object

Settings to compute hotel budget.

name
required
string

Travel policy name.

object

Settings for smart control. Present only if control field value is smart.

required
object

Settings to compute transport budget.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a travel policy

Deletes a travel policy.

path Parameters
id
required
string <uuid>

The identifier of the travel policy to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Trip projects

A Trip Project represents a travel project with bookings and participants.

Trip project

This is the tripProject resource schema:

id
required
string <uuid> <= 50 characters ^[@~\-\.\w]+$

Unique identifier for the trip project.

type
required
string
Value: "tripProject"

The resource type.

createdAt
required
string <date-time>

Time at which the trip project was created.

approvalStatus
string
Enum: "approved" "awaitApproval" "bookingAllowed" "declined"

The project approval status.

Note that bookingAllowed means that no approval workflow was needed.

Array of objects

Array of booking resources.

Array of objects

Array of car rentals.

Array of objects

Array of custom fields.

Array of objects

Array of hotel stays.

projectCodeId
string = 24 characters ^[a-f\d]{24}$

The ID of the associated project code.

required
Array of objects

Array of rates.

required
object

The search that created that trip project.

Array of objects

Array of transports legs.

travelerIds
required
Array of strings <uuid> [^[@~\-\.\w]+$]

Array of user ids that participate to trip project.

{
  • "id": "35c93884-5cca-4e72-98ff-eb52f611cb21",
  • "type": "tripProject",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "approvalStatus": "approved",
  • "bookings": [
    ],
  • "carRentals": [
    ],
  • "customFields": [
    ],
  • "hotelStays": [
    ],
  • "projectCodeId": "5de7bc72bf882f3bb31619bf",
  • "rates": [
    ],
  • "search": {
    },
  • "transportLegs": [
    ],
  • "travelerIds": [
    ]
}

List trip projects

Returns a list of trip projects.

Trip projects are returned sorted by creation date, and by default oldest trip projects are returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve a trip project

Retrieves a trip project.

path Parameters
id
required
string <uuid>

The identifier of the trip project to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

List trip project billing operations

Returns a list of billing operations corresponding to trip project.

By default, billing operations are returned sorted by creation date with oldest operations returned first.

The sortBy parameter allows you to sort billing operations by date field too.

You can enable cursor based pagination by setting pageKind parameter with cursor value.

path Parameters
id
required
string <uuid>

The identifier of the trip project.

query Parameters
pageKind
string
Default: "offset"
Enum: "offset" "cursor"

Pagination kind.

limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

before
string
Example: before=ZG9jX2lkOjVkOTc2OTYxYTI0YjBjMTcyNmY2NWJkMg==

Cursor value that identifies the last item to retrieve. Can be used only for cursor based pagination.

after
string
Example: after=ZG9jX2lkOjVkYWVmYThhMTg1YjNlNmNiM2Q3OTY3OA==

Cursor value that identifies the first item to retrieve. Can be used only for cursor based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "date"

Sorting field.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

List trip project travelers

Returns a list of users.

path Parameters
id
required
string <uuid>

The identifier of the trip project.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Users

This is an object representing a person associated with a fairjungle account.

User

This is the user resource schema:

id
required
string <uuid> <= 50 characters ^[@~\-\.\w]+$

Unique identifier for the user.

type
required
string
Value: "user"

The resource type.

createdAt
required
string <date-time>

Time at which the user was created.

object

User postal address.

archived
required
boolean

If true, then that user is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with user.

costCenterId
string = 24 characters ^[a-f\d]{24}$

The ID of a cost center associated with user.

currency
string

Display currency preference.

dateOfBirth
string

Date of birth (format: YYYY-MM-DD).

Example: 1977-09-25

email
required
string <email>

User email.

firstName
string

User first name.

gender
string
Enum: "female" "male"

User gender.

lang
string
Enum: "en" "fr"

User language.

lastName
string

User last name.

managerId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of manager.

phoneNumber
string

User international phone number.

Example: +33 661328598.

The space between region code and phone number if mandatory.

roles
Array of strings
Items Enum: "accountant" "admin" "authAdmin" "guest" "guestCreator" "manager" "organizer" "premium"

Array of user roles

object

Traveler preferences.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this user.

Array of objects

Array of custom fields.

{
  • "id": "35c93884-5cca-4e72-98ff-eb52f611cb21",
  • "type": "user",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "address": {
    },
  • "archived": true,
  • "billingProfileId": "5de7bc72bf882f3bb31619bf",
  • "costCenterId": "5de7bc72bf882f3bb31619bf",
  • "currency": "EUR",
  • "dateOfBirth": "1977-09-25",
  • "email": "john.smith@example.com",
  • "firstName": "John",
  • "gender": "female",
  • "lang": "en",
  • "lastName": "Smith",
  • "managerId": "35c93884-5cca-4e72-98ff-eb52f611cb21",
  • "phoneNumber": "+33 661328598",
  • "roles": [
    ],
  • "travelerPrefs": {
    },
  • "travelPolicyId": "5de7bc72bf882f3bb31619bf",
  • "customFields": [
    ]
}

List users

Returns a list of users.

The archived parameter permits to returns only archived or non archived users

The emails parameter permits to returns only users that match those emails.

The sortBy parameter allows you to sort users by email field too.

By default, users are returned sorted by creation date with oldest users returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

sortBy
string
Default: "createdAt"
Enum: "createdAt" "email"

Sorting field.

archived
string
Example: archived=false

If true then only archived resources are returned. If false then only non-archived resources are returned. If not provided then all resources are returned.

emails
string
Example: emails=jean@mycorp.fr,juan@mycorp.es

A comma separated list of emails. Permits to filter results to return only resources that match those emails.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a user

Creates a new user.

Request Body schema: application/json
required

User resource

required
object (UserPatch)

The user fields to update.

object

User postal address.

archived
boolean

If true, then that user is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with user.

costCenterId
string = 24 characters ^[a-f\d]{24}$

The ID of a cost center associated with user.

currency
string

Display currency preference.

dateOfBirth
string

Date of birth (format: YYYY-MM-DD).

Example: 1977-09-25

email
string <email>

User email.

firstName
string

User first name.

gender
string
Enum: "female" "male"

User gender.

lang
string
Enum: "en" "fr"

User language.

lastName
string

User last name.

managerId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of manager.

phoneNumber
string

User international phone number.

Example: +33 661328598.

The space between region code and phone number if mandatory.

roles
Array of strings
Items Enum: "accountant" "admin" "authAdmin" "guest" "guestCreator" "manager" "organizer" "premium"

Array of user roles

object

Traveler preferences.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this user.

Array of objects

Array of custom fields.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a user

Retrieves a user.

path Parameters
id
required
string <uuid>

The identifier of the user to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a user

Updates a user with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the user to update.

Request Body schema: application/json
required

User resource

required
object (UserPatch)

The user fields to update.

object

User postal address.

archived
boolean

If true, then that user is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with user.

costCenterId
string = 24 characters ^[a-f\d]{24}$

The ID of a cost center associated with user.

currency
string

Display currency preference.

dateOfBirth
string

Date of birth (format: YYYY-MM-DD).

Example: 1977-09-25

email
string <email>

User email.

firstName
string

User first name.

gender
string
Enum: "female" "male"

User gender.

lang
string
Enum: "en" "fr"

User language.

lastName
string

User last name.

managerId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of manager.

phoneNumber
string

User international phone number.

Example: +33 661328598.

The space between region code and phone number if mandatory.

roles
Array of strings
Items Enum: "accountant" "admin" "authAdmin" "guest" "guestCreator" "manager" "organizer" "premium"

Array of user roles

object

Traveler preferences.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this user.

Array of objects

Array of custom fields.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a user

Updates a user by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the user to update.

Request Body schema: application/json
required

User resource

required
object (UserReplace)

The user resource.

object

User postal address.

archived
boolean

If true, then that user is archived.

billingProfileId
string = 24 characters ^[a-f\d]{24}$

The ID of a billing profile associated with user.

costCenterId
string = 24 characters ^[a-f\d]{24}$

The ID of a cost center associated with user.

currency
string

Display currency preference.

dateOfBirth
string

Date of birth (format: YYYY-MM-DD).

Example: 1977-09-25

email
string <email>

User email.

firstName
string

User first name.

gender
string
Enum: "female" "male"

User gender.

lang
string
Enum: "en" "fr"

User language.

lastName
string

User last name.

managerId
string <uuid> <= 50 characters ^[@~\-\.\w]+$

User ID of manager.

phoneNumber
string

User international phone number.

Example: +33 661328598.

The space between region code and phone number if mandatory.

roles
Array of strings
Items Enum: "accountant" "admin" "authAdmin" "guest" "guestCreator" "manager" "organizer" "premium"

Array of user roles

object

Traveler preferences.

travelPolicyId
string = 24 characters ^[a-f\d]{24}$

The ID of the travel policy associated to this user.

Array of objects

Array of custom fields.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a user

Deletes a user.

path Parameters
id
required
string <uuid>

The identifier of the user to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Webhooks

Fairjungle uses webhooks to notify your application when an event happens in your account.

Webhook

This is the webhook resource schema:

id
required
string = 24 characters ^[a-f\d]{24}$

Unique identifier for the webhook.

type
required
string
Value: "webhook"

The resource type.

createdAt
required
string <date-time>

Time at which the webhook was created.

description
string

What this webhook is used for.

disabled
required
boolean
Default: false

Webhook is disabled.

events
Array of strings
Items Enum: "billingOperation.created" "billingOperation.updated" "billingProfile.created" "billingProfile.deleted" "billingProfile.updated" "bookingCancellation.created" "bookingModification.created" "costCenter.created" "costCenter.deleted" "costCenter.updated" "dispute.created" "dispute.updated" "invoice.created" "invoice.updated" "projectCode.created" "projectCode.deleted" "projectCode.updated" "refund.created" "refund.updated" "travelPolicy.created" "travelPolicy.deleted" "travelPolicy.updated" "tripProject.booking.failed" "tripProject.booking.succeeded" "tripProject.created" "user.created" "user.deleted" "user.updated" "webhook.created" "webhook.deleted" "webhook.updated"

The list of events kinds enabled for this endpoint.

url
required
string <url>

The endpoint URL.

{
  • "id": "5de7bc72bf882f3bb31619bf",
  • "type": "webhook",
  • "createdAt": "2019-09-25T07:35:42Z",
  • "description": "string",
  • "disabled": false,
  • "events": [
    ],
  • "url": "string"
}

List webhooks

Returns a list of webhooks.

Webooks are returned sorted by creation date, and by default oldest webooks are returned first.

Cursor based pagination is not available.

query Parameters
limit
integer <int32> [ 1 .. 100 ]
Default: 10

Maximum number of items to return.

offset
integer <int32>
Default: 0

Number of items to skip. Can be used only for offset based pagination.

order
string
Default: "asc"
Enum: "asc" "desc"

Sort order.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Create a webhook

Creates a new webhook.

Request Body schema: application/json
required

Webhook resource

required
object (WebhookReplace)

The webhook resource.

description
string

What this webhook is used for.

disabled
boolean
Default: false

Webhook is disabled.

events
Array of strings
Items Enum: "billingOperation.created" "billingOperation.updated" "billingProfile.created" "billingProfile.deleted" "billingProfile.updated" "bookingCancellation.created" "bookingModification.created" "costCenter.created" "costCenter.deleted" "costCenter.updated" "dispute.created" "dispute.updated" "invoice.created" "invoice.updated" "projectCode.created" "projectCode.deleted" "projectCode.updated" "refund.created" "refund.updated" "travelPolicy.created" "travelPolicy.deleted" "travelPolicy.updated" "tripProject.booking.failed" "tripProject.booking.succeeded" "tripProject.created" "user.created" "user.deleted" "user.updated" "webhook.created" "webhook.deleted" "webhook.updated"

The list of events kinds enabled for this endpoint.

url
required
string <url>

The endpoint URL.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a webhook

Retrieves a webhook.

path Parameters
id
required
string <uuid>

The identifier of the webhook to retrieve.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch a webhook

Updates a webhook with merge patching:

  • missing attributes are left unchanged
  • set null value to remove an attribute.
path Parameters
id
required
string <uuid>

The identifier of the webhook to update.

Request Body schema: application/json
required

Webhook resource

required
object (WebhookPatch)

The webhook fields to update.

description
string

What this webhook is used for.

disabled
boolean
Default: false

Webhook is disabled.

events
Array of strings
Items Enum: "billingOperation.created" "billingOperation.updated" "billingProfile.created" "billingProfile.deleted" "billingProfile.updated" "bookingCancellation.created" "bookingModification.created" "costCenter.created" "costCenter.deleted" "costCenter.updated" "dispute.created" "dispute.updated" "invoice.created" "invoice.updated" "projectCode.created" "projectCode.deleted" "projectCode.updated" "refund.created" "refund.updated" "travelPolicy.created" "travelPolicy.deleted" "travelPolicy.updated" "tripProject.booking.failed" "tripProject.booking.succeeded" "tripProject.created" "user.created" "user.deleted" "user.updated" "webhook.created" "webhook.deleted" "webhook.updated"

The list of events kinds enabled for this endpoint.

url
string <url>

The endpoint URL.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Replace a webhook

Updates a webhook by replacing the resource. Missing attributes are removed.

path Parameters
id
required
string <uuid>

The identifier of the webhook to update.

Request Body schema: application/json
required

Webhook resource

required
object (WebhookReplace)

The webhook resource.

description
string

What this webhook is used for.

disabled
boolean
Default: false

Webhook is disabled.

events
Array of strings
Items Enum: "billingOperation.created" "billingOperation.updated" "billingProfile.created" "billingProfile.deleted" "billingProfile.updated" "bookingCancellation.created" "bookingModification.created" "costCenter.created" "costCenter.deleted" "costCenter.updated" "dispute.created" "dispute.updated" "invoice.created" "invoice.updated" "projectCode.created" "projectCode.deleted" "projectCode.updated" "refund.created" "refund.updated" "travelPolicy.created" "travelPolicy.deleted" "travelPolicy.updated" "tripProject.booking.failed" "tripProject.booking.succeeded" "tripProject.created" "user.created" "user.deleted" "user.updated" "webhook.created" "webhook.deleted" "webhook.updated"

The list of events kinds enabled for this endpoint.

url
required
string <url>

The endpoint URL.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a webhook

Deletes a webhook.

path Parameters
id
required
string <uuid>

The identifier of the webhook to delete.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Who am I

Helper endpoint to fetch current user.

Retrieve current user

Retrieves currently authenticated user.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

SCIM API

With the SCIM API, you can configure your identity provider to provision users on fairjungle.

This documentation describes the supported parts of the SCIM specification.

Error object

This is the Error response schema:

schemas
Array of strings

SCIM Error Schema URI.

detail
string

A detailed human-readable message.

scimType
string
Enum: "invalidFilter" "tooMany" "uniqueness" "mutability" "invalidSyntax" "invalidPath" "noTarget" "invalidValue" "invalidVers" "sensitive"

A SCIM detail error keyword.

status
string

The HTTP status code expressed as a JSON string.

{
  • "schemas": [
    ],
  • "detail": "Invalid 'email' value",
  • "scimType": "invalidValue",
  • "status": "400"
}

Users

Users provisioning.

SCIM User

This is the SCIM User resource schema:

schemas
Array of strings

List of one or more URIs that indicate included SCIM schemas that are used to indicate the attributes contained within resource

id
string

Unique identifier for the user.

object

User metadata.

active
boolean

If false, then that user is archived.

Array of objects

User work address.

Only one address is supported, with:

  • "type": "work"
  • "primary": true.
displayName
string

Setup a SCIM User Mapping to enable that attribute.

Array of objects

User email.

This field is mandatory.

This array must contain only one email, with:

  • "type": "work"
  • "primary": true.
externalId
string

An identifier for the user as defined by the provisioning client.

object

Components of the user's name.

nickName
string

Setup a SCIM User Mapping to enable that attribute.

Array of objects

User phone number.

Only one phone number is supported, with:

  • "type": "work"
  • "primary": true.
title
string

Setup a SCIM User Mapping to enable that attribute.

userName
string <email>

User email, used to login on fairjungle.

userType
string

Setup a SCIM User Mapping to enable that attribute.

object

Enterprise user extension.

object

Fairjungle user extension.

{
  • "schemas": [
    ],
  • "id": "517fac99-af7e-4791-bc7f-20613bc9e591",
  • "meta": {},
  • "active": true,
  • "addresses": [
    ],
  • "displayName": "string",
  • "emails": [
    ],
  • "externalId": "00u15yqwxsIVFisi6697",
  • "name": {
    },
  • "nickName": "string",
  • "phoneNumbers": [
    ],
  • "title": "string",
  • "userName": "user@example.com",
  • "userType": "string",
  • "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
    },
  • "urn:ietf:params:scim:schemas:extension:fairjungle:2.0:User": {
    }
}

List users

Query users, as specified in RFC 7644 - 3.4.2. Query Resources.

The sortBy, sortOrder, attributes and excludedAttributes query parameters are not supported.

query Parameters
startIndex
integer <int32> >= 1
Default: 1

The 1-based index of the first query result.

count
integer <int32> [ 0 .. 100 ]
Default: 10

Desired maximum number of query results per page.

filter
string

A filter expression to request a subset of resources (RFC 7644 - 3.4.2.2. Filtering)

Only those filter expressions are supported:

  • filter=userName eq "marcel@bellivo.com"
  • filter=emails eq "marcel@beliveau.com"
  • filter=externalId eq "10u1dhhb2fkIGP7RL1d8"
  • filter=id eq "5fc0c238-1112-11e8-8e45-830c87bdbd75"

Responses

Response samples

Content type
application/json
{
  • "schemas": [
    ],
  • "startIndex": 1,
  • "itemsPerPage": 2,
  • "totalResults": 427,
  • "Resources": [
    ]
}

Create a user

Creates a new user, as specified in RFC 7644 - 3.3. Creating Resources.

Request Body schema: application/json
required

User resource

schemas
Array of strings

List of one or more URIs that indicate included SCIM schemas that are used to indicate the attributes contained within resource

active
boolean

If false, then that user is archived.

Array of objects

User work address.

Only one address is supported, with:

  • "type": "work"
  • "primary": true.
displayName
string

Setup a SCIM User Mapping to enable that attribute.

Array of objects

User email.

This field is mandatory.

This array must contain only one email, with:

  • "type": "work"
  • "primary": true.
externalId
string

An identifier for the user as defined by the provisioning client.

object

Components of the user's name.

nickName
string

Setup a SCIM User Mapping to enable that attribute.

Array of objects

User phone number.

Only one phone number is supported, with:

  • "type": "work"
  • "primary": true.
title
string

Setup a SCIM User Mapping to enable that attribute.

userName
string <email>

User email, used to login on fairjungle.

userType
string

Setup a SCIM User Mapping to enable that attribute.

object

Enterprise user extension.

object

Fairjungle user extension.

Responses

Request samples

Content type
application/json
{
  • "schemas": [
    ],
  • "active": true,
  • "userName": "jean-mich.muche@example.com",
  • "externalId": "88wffghjuykyko81ef861d",
  • "name": {
    },
  • "emails": [
    ]
}

Response samples

Content type
application/json
{
  • "schemas": [
    ],
  • "id": "9433c45e-ac9e-43d8-80e2-18f4d2634a83",
  • "active": true,
  • "userName": "jean-mich.muche@example.com",
  • "externalId": "88wffghjuykyko81ef861d",
  • "name": {
    },
  • "emails": [
    ]
}

Retrieve a user

Retrieves a user as specified in RFC 7644 - 3.4.1. Retrieving a Known Resource.

path Parameters
id
required
string <uuid>

The identifier of the user to retrieve.

Responses

Response samples

Content type
application/json
{
  • "schemas": [
    ],
  • "id": "517fac99-af7e-4791-bc7f-20613bc9e591",
  • "meta": {},
  • "active": true,
  • "emails": [
    ],
  • "externalId": "00u15yqwxsIVFisi6697",
  • "name": {
    },
  • "phoneNumbers": [
    ],
  • "userName": "jean.peuplu@example.com",
  • "urn:ietf:params:scim:schemas:extension:fairjungle:2.0:User": {
    }
}

Patch a user

Patch an existing user, as specified in RFC 7644 - 3.5.2. Modifying with PATCH

Missing attributes are left unchanged. Set null value to remove an attribute.

Only a limited subset of path expressions are supported:

  • For add operation:

    • emails[type eq \"work\"].value
    • phoneNumbers[type eq \"work\"].value
  • For remove and replace operation:

    • active
    • emails
    • emails[type eq \"work\"].value
    • externalId
    • name
    • name.familyName
    • name.givenName
    • phoneNumbers
    • phoneNumbers[type eq \"work\"].value
    • userName
path Parameters
id
required
string <uuid>

The identifier of the user to update.

Request Body schema: application/json
required

User resource

schemas
Array of strings

SCIM PatchOp Schema URI.

Array of objects

Patch operations.

Responses

Request samples

Content type
application/json
{
  • "schemas": [
    ],
  • "Operations": [
    ]
}

Response samples

Content type
application/json
{
  • "schemas": [
    ],
  • "id": "9433c45e-ac9e-43d8-80e2-18f4d2634a83",
  • "active": false,
  • "userName": "jean-mich.muche@example.com",
  • "externalId": "88wffghjuykyko81ef861d",
  • "name": {
    },
  • "emails": [
    ],
  • "urn:ietf:params:scim:schemas:extension:fairjungle:2.0:User": {
    }
}

Replace a user

Updates a user by replacing the resource, as specified in RFC 7644 - 3.5.1. Replacing with PUT.

Attributes not provided in request are removed.

One notable exception is the attribute urn:ietf:params:scim:schemas:extension:fairjungle:2.0:User: if not present in request, then fairjungle specific attributes are left unchanged.

path Parameters
id
required
string <uuid>

The identifier of the user to update.

Request Body schema: application/json
required

User resource

schemas
Array of strings

List of one or more URIs that indicate included SCIM schemas that are used to indicate the attributes contained within resource

active
boolean

If false, then that user is archived.

Array of objects

User work address.

Only one address is supported, with:

  • "type": "work"
  • "primary": true.
displayName
string

Setup a SCIM User Mapping to enable that attribute.

Array of objects

User email.

This field is mandatory.

This array must contain only one email, with:

  • "type": "work"
  • "primary": true.
externalId
string

An identifier for the user as defined by the provisioning client.

object

Components of the user's name.

nickName
string

Setup a SCIM User Mapping to enable that attribute.

Array of objects

User phone number.

Only one phone number is supported, with:

  • "type": "work"
  • "primary": true.
title
string

Setup a SCIM User Mapping to enable that attribute.

userName
string <email>

User email, used to login on fairjungle.

userType
string

Setup a SCIM User Mapping to enable that attribute.

object

Enterprise user extension.

object

Fairjungle user extension.

Responses

Request samples

Content type
application/json
{
  • "schemas": [
    ],
  • "id": "9433c45e-ac9e-43d8-80e2-18f4d2634a83",
  • "active": true,
  • "userName": "jean-mich.muche@example.com",
  • "externalId": "88wffghjuykyko81ef861d",
  • "name": {
    },
  • "emails": [
    ]
}

Response samples

Content type
application/json
{
  • "schemas": [
    ],
  • "id": "9433c45e-ac9e-43d8-80e2-18f4d2634a83",
  • "active": true,
  • "userName": "jean-mich.muche@example.com",
  • "externalId": "88wffghjuykyko81ef861d",
  • "name": {
    },
  • "emails": [
    ]
}

Delete a user

Deletes a user, as specified in RFC 7644 - 3.6. Deleting Resources.

path Parameters
id
required
string <uuid>

The identifier of the user to delete.

Responses