Partner - Transaction API

Create transaction.

Adds a new transaction to the system and returns its ID and details. The creation is done synchronously, when you get a 201 response the transaction is fully validated and created. In case of a fuelcard payment input, this also means that the fuelcard is accepted for payment. In case validation fails, the response is a 422 with details indicating the violation. Some example responses are given in the table below.


Open Swagger Specification

Endpoint

    POST - https://api.travisroadservices.com/partners/v1/transactions
    Copy
  

Header params

Parameter Type Description
location string Location ID of the requesting location.

Request body

Response body

Response 201

TransactionResource resource created

Fields

Field Type Description
id integer Unique identifier of the transaction.
service string Service for which the transaction is created. Possible values: parking, repair, tankcleaning.
serviceInformation object Service-specific information such as arrival and departure for parking, order number for repair, or reference and cost specification for tankcleaning.
arrival string (date-time) In local time. Required and applicable only to the parking service.
departure string (date-time) In local time. Required and applicable only to the parking service.
orderNumber string Work order number for repair service. Required and applicable only to the repair service.
reference string Optional partner reference. Applicable only to the tankcleaning service.
costSpecification array Optional itemised cost specification. Applicable only to the tankcleaning service. When provided, the sum of the line costs must equal the transaction price amount.
vehicles object Vehicles involved in the transaction. At least one vehicle (truck or trailer) must be provided, unless the payment is a travis booking code, in which case vehicles are taken from the booking and must not be provided.
truck object
licensePlate string
trailer object
licensePlate string
driver string Name or identifier of the driver. Optional. Must not be provided when the payment is a booking travis code.
payment object Payment means used for the transaction.
type string The type of payment used. Available choices: travis_code, fuel_card. If "travis_code", then a travis code must be provided in "information". If "fuel_card", then the track data must be provided in "information.fuelCard".
information object
travisCode string Travis code for payment.
fuelCard object
provider string Fuel card provider.
holder string Fuel card holder name.
cardNumber string Fuel card number.
expiryDate string (date-time) Fuel card expiration date.
licensePlateType string Plate type that paid the transaction. "truck" or "trailer". Only set for drive_in payments.
price object Total price of the transaction.
amount number Price amount in the specified currency.
currency string ISO 4217 currency code.
payout object Payout amount applicable to the transaction.
amount number Price amount in the specified currency.
currency string ISO 4217 currency code.
customerDiscount object Customer discount applied to the transaction.
amount number Price amount in the specified currency.
currency string ISO 4217 currency code.
status object Current status of the transaction. Possible values: created and cancelled.
createdAt string (date-time) Date and time the transaction was created.
cancelledAt string (date-time) Date and time the transaction was cancelled, if applicable.
creditTransactionId integer Identifier of the related credit transaction. Only present when the transaction has been credited.
additionalCosts array List of additional cost transactions related to this transaction.
priceParts object Price of parts. Required and applicable to the repair service only.
amount number Price amount in the specified currency.
currency string ISO 4217 currency code.
priceLabour object Price of labour. Required and applicable to the repair service only.
amount number Price amount in the specified currency.
currency string ISO 4217 currency code.

Example

Response 400

Invalid input

Fields

Field Type Description
title string A short, human-readable summary of the problem.
detail string A human-readable explanation specific to this occurrence of the problem.
status integer The HTTP status code applicable to this problem.
instance string A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
type string A URI reference that identifies the problem type

Example

Response 401

No response body - No bearer token set verify if your token is added as bearer token

Response 403

No response body - You don't have access to this API resource

Response 422

Validation failed in the input given.

Response 503

An error occurred while creating the transaction. A tracking ID is provided which our customer support team can use to help.