Skip to main content

Refund Ticket

Process a refund for an issued ticket or EMD (Electronic Miscellaneous Document). This endpoint supports a two-step refund flow: calculate refund information first, then confirm the refund by submitting the returned refundValue.


Endpoint

  • URL: /api/v1/flight/refundticket
  • Method: POST
  • Auth Required: Yes (Bearer Token/X-API-KEY)
  • Content-Type: application/json

Authentication

This endpoint requires a valid JWT Bearer token in the Authorization header:

Authorization: Bearer <access_token>

Obtain tokens via /api/v1/sign-in (POST) with your credentials.


Request Structure

FieldTypeRequiredDescription
systemstringYesBooking system code (e.g., VN, VJ, 1A)
bookingCodestringYesBooking code (PNR)
refundValuestringNoEncoded refund value returned by the refund calculation step
confirmbooleanNofalse to calculate refund information, true to confirm refund processing
ticketNumberstringNoTicket number to refund (Not applicable for Vietjet)
isEMDbooleanNoTrue: EMD refund; false: flight ticket refund
refundAllbooleanNoRefund all tickets in the booking

Step 1: Calculate Refund

Use confirm: false to check refund eligibility, refund fee, and expected refund amount. The response returns refundValue, which must be used in the confirmation step.

Sample Request

Calculate refund:

{
"system": "VN",
"bookingCode": "ABC123",
"confirm": false,
"ticketNumber": "738-1234567890",
"isEMD": false,
"refundAll": false
}

Step 2: Confirm Refund

Use confirm: true with the refundValue returned by Step 1 to process the refund.

Confirm refund:

{
"system": "VN",
"bookingCode": "ABC123",
"refundValue": "encoded_refund_value_from_step_1",
"confirm": true,
"ticketNumber": "738-1234567890",
"isEMD": false,
"refundAll": false
}

Request Constraints & Business Rules

  • Only issued tickets or EMDs can be refunded.
  • The bookingCode must match an existing booking.
  • Refund eligibility depends on fare rules and ticket status.
  • Set confirm to false first to calculate refund details and obtain refundValue.
  • Set confirm to true only after reviewing the refund details returned from the calculation step.
  • refundValue must be taken from the previous refund calculation response and must not be modified.
  • ticketNumber is used to refund a specific ticket and is not applicable for Vietjet.
  • Set isEMD to true when refunding an EMD; set it to false when refunding a flight ticket.
  • Some tickets may have refund penalties or restrictions.
  • refundAll will process refunds for all eligible tickets in the booking.
  • All refund transactions are auditable via trackingId and trackingTime.

Response Structure

FieldTypeNullableDescription
systemstringYesSystem name (e.g., VN, VJ, 1A)
statusbooleanNotrue if successful, false if failed
errorobjectYesError details (if any)
descriptionstringYesError description (if any)
trackingIdstringYesTracking ID for request logs
trackingTimestringYesTime for request tracking (ISO 8601 format)
refundValuestringYesRefund information for proceeding with refund
refundDocsarrayYesList of refund documents (see RefundDoc)

RefundDoc Object

FieldTypeNullableDescription
ticketNumberstringYesTicket number
passengerstringYesPassenger name
baseFareobjectYesBase fare amount (Money)
totalTaxobjectYesTotal tax amount (Money)
refundFeeobjectYesRefund fee or penalty amount (Money)
usedFareobjectYesUsed fare amount (Money)
refundFareobjectYesRefundable fare (Money)
refundTotalobjectYesTotal refund amount (Money)
refundRoutestringYesRefunded route

Money Object

FieldTypeDescription
amountnumberAmount value
currencystringCurrency code

Sample Response:

{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "abc-123",
"trackingTime": "2024-06-01T12:00:00Z",
"refundValue": "encoded_refund_value",
"refundDocs": [
{
"ticketNumber": "738-1234567890",
"passenger": "NGUYEN VAN A",
"baseFare": { "amount": 2000000, "currency": "VND" },
"totalTax": { "amount": 350000, "currency": "VND" },
"refundFee": { "amount": 200000, "currency": "VND" },
"usedFare": { "amount": 0, "currency": "VND" },
"refundFare": { "amount": 1800000, "currency": "VND" },
"refundTotal": { "amount": 1950000, "currency": "VND" },
"refundRoute": "SGN-HAN"
}
]
}

Error Codes

This endpoint may return the following error codes:

For a complete list of error codes, see Error Codes.


Security & Validation

  • All input is validated for type and required fields.
  • Only authenticated users can access this endpoint.
  • Ticket numbers are validated against existing issued tickets.
  • Refund eligibility is checked against fare rules.
  • All refund transactions are logged and traceable.

Validation Questions

  • What are the refund policies for different fare types?
  • How are refund penalties calculated and applied?
  • What happens if a ticket is partially used?
  • Are there time limits for processing refunds after ticket issuance?

For integration support, see Contact Support.