Flags API

Sometimes a receipt Versa retrieved is not the one you expected: a folio that is missing a night, a receipt attached to the wrong booking, a total that does not match the charge. The Flags API lets you raise an issue flag against a transaction from your own systems, exactly as a user would with the "Flag Issue" button in the Versa portal, and read back the status of every flag your team has raised while Versa reviews and resolves it.

The Flags API is served at https://api.versa.org/flags and uses the same client credentials as the Events API.

Quick Example: Flag a booking

cURL Example
curl -X POST https://api.versa.org/flags \
  -H 'Authorization: Basic CLIENT_ID:CLIENT_SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "kind": "booking",
    "id": "bkg_7f3a2c1e9b4d4e6f8a1b2c3d4e5f6a7b",
    "notes": "The folio is missing the second night."
  }'

Versa reviews the flag, corrects the document where it can, and records the outcome. You can read the outcome back at any time with GET /flags, or watch for it in the portal.

Authentication

Every request carries your client credentials in an Authorization header using the Basic scheme, either as the raw pair or base64-encoded:

Authorization: Basic CLIENT_ID:CLIENT_SECRET

Any client credential of your organization works, whether it was created as a sender or a receiver, in test or production mode. A missing or incorrect credential answers 401 with the body {"error": "Invalid client credentials"}.

Every error on this API is a JSON object with a single error message.

API Reference

Raise a flag

POST https://api.versa.org/flags

Tell Versa what you were looking at and what is wrong with it. The record is resolved to the transaction it belongs to, and the flag is raised against that transaction.

Request Parameters

FieldTypeDescription
kindenumWhat id identifies: booking, card_transaction, or direct_transaction.
idstringThe id of that record, as Versa reports it (for example the direct_transaction_id on a receipt.retrieval.completed webhook).
notesstringWhat is wrong, in your words. Trimmed; between 1 and 255 characters.

Response

201 Created with the flag in the same shape as a list item (below). Its status starts as open.

StatusMeaning
400notes is empty or too long.
404The record does not exist, does not belong to your organization, or has been deleted.
409The record is not linked to a transaction yet, or the transaction already has a flag awaiting resolution.

A transaction carries one open flag at a time. Add to the open one through the portal rather than raising a second.

List flags

GET https://api.versa.org/flags

Your organization's flags, newest first. By default only active flags are returned: those still awaiting resolution.

Query Parameters

ParameterTypeDescription
activebooleantrue (default) returns flags awaiting resolution; false returns every flag.
statusenumExactly one status: open, in_review, corrected, failed, or no_action. Overrides active.
direct_transaction_idstringOnly flags on the transaction with this Versa id.
transaction_idstringOnly flags on the transaction with this Versa network transaction_id (as returned when you posted the event).
merchant_transaction_idstringOnly flags on the transaction you identified with this id when you posted the event.
limitintegerPage size, 1 to 100. Default 10.
pageintegerZero-based page index. Default 0.

Example Request: Flags on one of your bookings

curl 'https://api.versa.org/flags?merchant_transaction_id=my_booking_123456789&active=false' \
  -H 'Authorization: Basic CLIENT_ID:CLIENT_SECRET'

Response

{
  "items": [
    {
      "id": "flg_2b1c9d8e7f6a4b5c8d9e0f1a2b3c4d5e",
      "status": "corrected",
      "triage_state": "incomplete_document",
      "resolution_state": "corrected",
      "notes": "The folio is missing the second night.",
      "resolution_notes": "Re-requested the folio from the property; the full stay is now attached.",
      "raised_by_actor_type": "client",
      "created": 1760371200,
      "transaction": {
        "direct_transaction_id": "dtx_9c8b7a6d5e4f4a3b2c1d0e9f8a7b6c5d",
        "transaction_id": "txn_abc123def456",
        "merchant_transaction_id": "my_booking_123456789",
        "kind": "booking",
        "merchant_name": "Courtland Grand Hotel",
        "description": "COURTLAND GRAND HOTEL ATLANTA",
        "amount": 39488,
        "currency": "usd",
        "booking_id": "bkg_7f3a2c1e9b4d4e6f8a1b2c3d4e5f6a7b",
        "property_name": "Courtland Grand Hotel",
        "travel_start_date": "2026-08-21",
        "travel_end_date": "2026-08-23",
        "guest_name": "Susan Doe"
      }
    }
  ],
  "total": 1,
  "page": 0,
  "page_size": 10,
  "total_pages": 1,
  "has_more": false
}

Flag fields

FieldTypeDescription
idstringThe flag's id.
statusenumWhere the flag is in review: open, in_review, corrected, failed, or no_action. See below.
triage_stateenumWhat review concluded: pending, working_as_intended, incomplete_document, or incorrect_document.
resolution_stateenumHow the flag was closed out: pending, corrected, failed, or no_action.
notesstringWhat was reported.
resolution_notesnullable stringVersa's account of what was done, once resolved.
raised_by_actor_typeenumclient for a flag raised through this API, user for one raised in the portal.
createdintegerWhen the flag was raised, in Unix seconds.
transactionobjectThe transaction the flag was raised against: its ids, what backs it (kind), the merchant, the amount in minor units with its ISO currency, and the booking's property, travel dates and guest where there is one.

Statuses

StatusMeaning
openRaised, not yet reviewed. Active.
in_reviewReviewed; Versa is working on a fix. Active.
correctedThe problem was fixed.
failedThe problem could not be fixed; resolution_notes says why.
no_actionReview found the document and transaction as they should be; nothing to fix.