Flags API

If a receipt Versa retrieved is not the one you expected, 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 Direct application, 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 '{
    "merchant_transaction_id": "my_booking_123456789",
    "notes": "The folio is for the wrong dates."
  }'

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

Use a production client credential of your organization to raise and read your flags. A test credential never reads or writes them: it works against a fixed example instead (see Testing with a test credential). 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.

Testing with a test credential

With a test credential, both routes work against one fixed example transaction instead of your organization's data, so you can build against the real response shapes before you hold a production credential. Nothing is read from or saved to your account.

  • POST /flags naming the example transaction, by "transaction_id": "good_transaction_id" or "merchant_transaction_id": "good_external_identifier", answers 201 with an open example flag carrying your trimmed notes and the current time as created. Nothing is saved, so repeating it succeeds again (the one-open-flag 409 is never returned). Any other id, including the documented misses missing_transaction_id and unrecognized_external_identifier and your real ids, answers 404 with {"error": "Transaction not found"}. Each example id works only under its own field. The 400 checks on the body still apply first.
  • GET /flags always holds exactly one flag: an open flag (id flag_55555555555555555555555555) on the example transaction (direct_transaction_id dtx_55555555555555555555555555, transaction_id good_transaction_id, merchant_transaction_id good_external_identifier). The query parameters filter and page it as they would your real flags: status=corrected, or a transaction_id that is not good_transaction_id, returns an empty page.

API Reference

Raise a flag

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

Name the transaction by exactly one of the two ids you already hold for it and say what is wrong. These are the same two ids every webhook event carries: the Versa transaction_id returned when you posted the event, or the merchant_transaction_id you supplied with it. Send one or the other, not both.

Request Parameters

FieldTypeDescription
transaction_idstringThe Versa id returned when you posted the event, for example txn_555raszzb2esgvra33qn9kyw6t. Omit it if you send merchant_transaction_id.
merchant_transaction_idstringThe id you supplied when you posted the event, for example my_booking_123456789. Omit it if you send transaction_id.
notesstringWhat is wrong, in your words. Trimmed; between 1 and 255 characters.

Example Request: Flag by Versa transaction_id

curl -X POST https://api.versa.org/flags \
  -H 'Authorization: Basic CLIENT_ID:CLIENT_SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "transaction_id": "txn_555raszzb2esgvra33qn9kyw6t",
    "notes": "The receipt attached is for a different guest."
  }'

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; neither or both of transaction_id and merchant_transaction_id were sent; or the one sent is blank.
404No transaction of your organization carries that id, or it has been deleted.
409The 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": "org",
      "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_typeenumorg for a flag raised through this API (your organization, via its client credential), 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.