API reference

HTS APIs

Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.

PUT/contracts/{id}/cancelCancel

Cancel Contract

https://fintech.staging.htsapis.com/flights-dafar/v2/contracts/{id}/cancel

Canceling a contract does not result in the customer being refunded the total price of the product. This should be used when the itinerary associated with the contracts is canceled outside of the void window.

Parameters

id
path · string
required

A unique identifier for a contract.

Request body application/json

reason
reason1 · one of 2
required

Explanation for why this cancellation occurred.

Show fields

Explanation for why this cancellation occurred.

Exactly one of the following, selected by type:
chargeback (chargeback) chargeback
type
string
required

value: chargeback

other (other2) other2
type
string
required

value: other

reason
string
required

Human-readable explanation for why this policy cancellation was performed.

Length ≥ 1

Responses

204
No body.
400Syntactic errors were encountered while handling the request
Array of error
message
string
required
code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
401The client could not be authenticated
No body.
403The authenticated client does not have permission to call this endpoint
No body.
404The requested resource could not be found
No body.
422Semantic errors were encountered while handling the request
Array of dafar_cancel_contract_error · one of 3
Items ≥ 1
Exactly one of the following, selected by code:
invalid_contract_status (invalid_contract_status2) invalid_contract_status2
message
string
required

A human-readable message describing the error

code
string
required
order_item_not_found (order_item_not_found) order_item_not_found
message
string
required

A human-readable message describing the error

code
string
required
refund_amount_more_than_outstanding_balance (refund_amount_more_than_outstanding_balance1) refund_amount_more_than_outstanding_balance1
message
string
required

A human-readable message describing the error

code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
499The client cancelled the request
No body.
500The server encountered an internal error
No body.
Request
curl -X PUT "https://fintech.staging.htsapis.com/flights-dafar/v2/contracts/<id>/cancel" \
  -H "X-Api-Key: $HTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": {
    "type": "string"
  }
}'

Examples are generated from the schema where the spec publishes none; field values are illustrative.