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 -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 /flagsnaming the example transaction, by"transaction_id": "good_transaction_id"or"merchant_transaction_id": "good_external_identifier", answers201with anopenexample flag carrying your trimmednotesand the current time ascreated. Nothing is saved, so repeating it succeeds again (the one-open-flag409is never returned). Any other id, including the documented missesmissing_transaction_idandunrecognized_external_identifierand your real ids, answers404with{"error": "Transaction not found"}. Each example id works only under its own field. The400checks on the body still apply first.GET /flagsalways holds exactly one flag: anopenflag (idflag_55555555555555555555555555) on the example transaction (direct_transaction_iddtx_55555555555555555555555555,transaction_idgood_transaction_id,merchant_transaction_idgood_external_identifier). The query parameters filter and page it as they would your real flags:status=corrected, or atransaction_idthat is notgood_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
| Field | Type | Description |
|---|---|---|
transaction_id | string | The Versa id returned when you posted the event, for example txn_555raszzb2esgvra33qn9kyw6t. Omit it if you send merchant_transaction_id. |
merchant_transaction_id | string | The id you supplied when you posted the event, for example my_booking_123456789. Omit it if you send transaction_id. |
notes | string | What 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.
| Status | Meaning |
|---|---|
400 | notes is empty or too long; neither or both of transaction_id and merchant_transaction_id were sent; or the one sent is blank. |
404 | No transaction of your organization carries that id, or it has been deleted. |
409 | 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
| Parameter | Type | Description |
|---|---|---|
active | boolean | true (default) returns flags awaiting resolution; false returns every flag. |
status | enum | Exactly one status: open, in_review, corrected, failed, or no_action. Overrides active. |
direct_transaction_id | string | Only flags on the transaction with this Versa id. |
transaction_id | string | Only flags on the transaction with this Versa network transaction_id (as returned when you posted the event). |
merchant_transaction_id | string | Only flags on the transaction you identified with this id when you posted the event. |
limit | integer | Page size, 1 to 100. Default 10. |
page | integer | Zero-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
| Field | Type | Description |
|---|---|---|
id | string | The flag's id. |
status | enum | Where the flag is in review: open, in_review, corrected, failed, or no_action. See below. |
triage_state | enum | What review concluded: pending, working_as_intended, incomplete_document, or incorrect_document. |
resolution_state | enum | How the flag was closed out: pending, corrected, failed, or no_action. |
notes | string | What was reported. |
resolution_notes | nullable string | Versa's account of what was done, once resolved. |
raised_by_actor_type | enum | org for a flag raised through this API (your organization, via its client credential), user for one raised in the portal. |
created | integer | When the flag was raised, in Unix seconds. |
transaction | object | The 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
| Status | Meaning |
|---|---|
open | Raised, not yet reviewed. Active. |
in_review | Reviewed; Versa is working on a fix. Active. |
corrected | The problem was fixed. |
failed | The problem could not be fixed; resolution_notes says why. |
no_action | Review found the document and transaction as they should be; nothing to fix. |