Skip to main content
PUT
/
api
/
v1
/
ops
/
promotions
/
{promotionalId}
/
round-trip-rule
Define Promotion Round Trip Rule
curl --request PUT \
  --url https://api.example.com/api/v1/ops/promotions/{promotionalId}/round-trip-rule \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sameRoute": true,
  "outboundRouteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "returnRouteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "minHoursBetweenTrips": 123,
  "maxDaysBetweenTrips": 123
}
'
{
  "promotionalRoundTripRuleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "promotionalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "outboundRouteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "returnRouteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sameRoute": true,
  "minHoursBetweenTrips": 123,
  "maxDaysBetweenTrips": 123,
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z",
  "deletedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deletedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

promotionalId
string<uuid>
required

Promotion identifier

Example:

"0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a"

Query Parameters

fields
string

Comma-separated list of fields to include in the response. Supports dot notation for nested projection (e.g. id,name,user.email,trips.route.id). Unknown fields are silently dropped.

Body

application/json

Define promotion round trip rule payload

sameRoute
boolean
required

Indica se ida e volta devem pertencer ao mesmo par de rota

applyTo
enum<string>
required

Onde o desconto é aplicado

Available options:
RETURN_TICKET,
CHEAPEST_TICKET,
ORDER
outboundRouteId
string<uuid> | null

Rota de ida exigida, quando a regra é restrita a uma rota

returnRouteId
string<uuid> | null

Rota de volta exigida, quando a regra é restrita a uma rota

minHoursBetweenTrips
integer | null

Intervalo mínimo entre ida e volta

maxDaysBetweenTrips
integer | null

Janela máxima entre ida e volta

Response

OK

Regra fixa de promoção para ida e volta

promotionalRoundTripRuleId
string<uuid>
required

Identificador único

promotionalId
string<uuid>
required

Promoção dona da regra

organizationId
string<uuid>
required

Organização da Company responsável pela promoção

companyId
string<uuid>
required

Company dona da promoção

outboundRouteId
string<uuid> | null
required

Rota de ida exigida, quando a regra é restrita a uma rota

returnRouteId
string<uuid> | null
required

Rota de volta exigida, quando a regra é restrita a uma rota

sameRoute
boolean
required

Indica se ida e volta devem pertencer ao mesmo par de rota

minHoursBetweenTrips
integer | null
required

Intervalo mínimo entre ida e volta

maxDaysBetweenTrips
integer | null
required

Janela máxima entre ida e volta

applyTo
enum<string>
required

Onde o desconto é aplicado

Available options:
RETURN_TICKET,
CHEAPEST_TICKET,
ORDER
createdBy
string<uuid> | null
required

Usuário que criou o registro, quando aplicável

createdAt
string<date-time>
required

Data de criação

updatedBy
string<uuid> | null
required

Usuário que fez a última atualização, quando aplicável

updatedAt
string<date-time>
required

Data da última atualização

deletedBy
string<uuid> | null
required

Usuário que removeu o registro, quando aplicável

deletedAt
string<date-time> | null
required

Data de remoção lógica