APG PayAPG Paydocs

Merchants

Update travel entry

PATCH/travel-entries/{travelEntryId}

Correct the entry, match it to its payment now, set how much of it has been refunded, say which purchase a refund refunds, or record by hand how it matched. The last three are staff's.

5 actionsTvlentUpdateCorrectTvlentUpdateMatchNowTvlentUpdateRelinkOriginalTvlentUpdateResetRefundedAmountTvlentUpdateSettleMatch

Permissions

Required permission
merchantTravelData:update

Requires the `update` action on `merchantTravelData` for the supplied runtime context

Path parameters

travelEntryIdstring
required

Request body

This body is a typed union. Pick a variant to see its fields and a matching example.

Discriminated by type
type = "TvlentUpdateCorrect"
documentNumberFormatstringrequired

Example 2026-08-19T04:21:07Z

documentNumberstringrequired
serialNumberstringrequired
purchaseDatestring (date)

Example 2026-08-19

travellerNamestring

Example Ada Lovelace

The amounts of a corrected entry. All are in the single currency given here, which must be the entry's own.

approvalCodestringrequired

The merchant's own details and references, as the line stated them.

usageCodestringrequired
curl -X PATCH https://api.tst.au.apgpay.dev/travel-entries/{travelEntryId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "TvlentUpdateCorrect",
  "documentNumberFormat": "2026-08-19T04:21:07Z",
  "documentNumber": "string",
  "serialNumber": "string",
  "purchaseDate": "2026-08-19",
  "travellerName": "Ada Lovelace",
  "amounts": {
    "type": "TvlentCorrectedAmountsAttributes",
    "currency": "AUD",
    "amount": 1250,
    "netAmountNonVatable": 1250,
    "netAmountVatable": 1250,
    "vatAmount": 1250,
    "vatPercentage": "string",
    "vatIndicator": "string"
  },
  "approvalCode": "string",
  "merchantDetails": {
    "type": "TvlentMerchantDetailsAttributes",
    "name": "Ada Lovelace",
    "city": "string",
    "zipCode": "string",
    "stateCode": "string",
    "iataNumber": "string",
    "invoiceNumber": "string",
    "orderNumber": "string",
    "customerNumber": "string",
    "agencyDossierNumber": "string",
    "agencyDeliveryNoteNumber": "string"
  },
  "usageCode": "string"
}'

Responses

The response is a tagged shape: type is always "TvlentUpdateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "TvlentUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "TvlentUpdateRspAttributes",
  "updated": {
    "type": "TvlentViewAttributes",
    "travelEntryId": "tvlent_9f2Kd8QpLzXw",
    "travelFileId": "tvlfile_9f2Kd8QpLzXw",
    "travelBatchId": "tvlbat_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "ownerMerchantId": "mcht_9f2Kd8QpLzXw",
    "fileType": "Merchant",
    "processingDate": "2026-08-19",
    "lineNumber": 1250,
    "serviceKind": "Flight",
    "sign": "Purchase",
    "cardType": "Uatp",
    "hasCardToken": true,
    "documentNumberFormat": "2026-08-19T04:21:07Z",
    "documentNumber": "string",
    "serialNumber": "string",
    "purchaseDate": "2026-08-19",
    "travellerName": "Ada Lovelace",
    "amounts": {
      "type": "TvlentAmountsAttributes",
      "currency": "AUD",
      "amount": 1250,
      "netAmountNonVatable": 1250,
      "netAmountVatable": 1250,
      "vatAmount": 1250,
      "refundedAmount": 1250,
      "vatPercentage": "string",
      "vatIndicator": "string"
    },
    "approvalCode": "string",
    "merchantDetails": {
      "type": "TvlentMerchantDetailsAttributes",
      "name": "Ada Lovelace",
      "city": "string",
      "zipCode": "string",
      "stateCode": "string",
      "iataNumber": "string",
      "invoiceNumber": "string",
      "orderNumber": "string",
      "customerNumber": "string",
      "agencyDossierNumber": "string",
      "agencyDeliveryNoteNumber": "string"
    },
    "usageCode": "string",
    "validation": "Passed",
    "dbi": {
      "type": "TvlentDbiAttributes",
      "pk": "string",
      "ds": "string",
      "ks": "string",
      "ae": "string",
      "ik": "string",
      "bd": "2026-08-19",
      "pr": "string",
      "au": "string",
      "ak": "string",
      "rz": "string",
      "status": "NotRequired",
      "statusAt": "2026-08-19T04:21:07Z",
      "statusMessage": "Active",
      "mandatoryFields": "string"
    },
    "authorisation": {
      "type": "TvlentAuthorisationAttributes",
      "operator": "ApgPay",
      "status": "NotRequired",
      "statusAt": "2026-08-19T04:21:07Z",
      "statusMessage": "Active",
      "refundStatus": "NotRequired",
      "refundStatusAt": "2026-08-19T04:21:07Z"
    },
    "matching": {
      "type": "TvlentMatchAttributes",
      "status": "NotRequired",
      "statusAt": "2026-08-19T04:21:07Z",
      "statusMessage": "Active",
      "timedOut": true,
      "needsManualOriginalMatch": true,
      "originalTravelEntryId": "tvlent_9f2Kd8QpLzXw",
      "transactionId": "tran_9f2Kd8QpLzXw",
      "refundId": "rfnd_9f2Kd8QpLzXw",
      "issuerTransactionId": "itxn_9f2Kd8QpLzXw",
      "issuerRefundId": "rfnd_9f2Kd8QpLzXw",
      "loanId": "loan_9f2Kd8QpLzXw",
      "customerId": "cust_9f2Kd8QpLzXw"
    },
    "enabled": true,
    "serviceLines": [
      {
        "type": "TvlentServiceLineCar",
        "currency": "AUD",
        "rentalCompanyCode": "string",
        "contractNumber": "string",
        "vehicleClassCode": "string",
        "vehicleType": "string",
        "noShow": true,
        "pickUpDate": "2026-08-19",
        "pickUpTime": "string",
        "pickUpLocationCode": "string",
        "pickUpLocationCity": "string",
        "returnDate": "2026-08-19",
        "returnTime": "string",
        "returnLocationCode": "string",
        "returnLocationCity": "string",
        "rentalDays": 1250,
        "mileageIndicator": "string",
        "drivenDistance": "string",
        "charges": [
          {
            "type": "TvlentCarChargeAttributes",
            "kind": "string",
            "amount": 1250,
            "vatIndicator": "string"
          }
        ]
      }
    ],
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses