{
 "openapi": "3.1.0",
 "info": {
  "title": "Card Transactions (Accounting)",
  "version": "20261030b",
  "description": "An unmatched card charge is not an outstanding claim — it is money gone with no explanation, and on a corporate-liability card the company has already paid it."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "card-transactions": {
    "type": "object",
    "required": [
     "card_id",
     "transaction_date"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "card_id": {
      "type": "string",
      "format": "uuid",
      "description": "Card"
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Holder"
     },
     "external_id": {
      "type": "string",
      "description": "The scheme's own id"
     },
     "transaction_date": {
      "type": "string",
      "format": "date",
      "description": "Date"
     },
     "posted_date": {
      "type": "string",
      "format": "date",
      "description": "Posted"
     },
     "merchant": {
      "type": "string",
      "description": "Merchant"
     },
     "merchant_category_code": {
      "type": "string",
      "description": "Merchant category code"
     },
     "city": {
      "type": "string",
      "description": "City"
     },
     "country": {
      "type": "string",
      "description": "Country"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "amount": {
      "type": "string",
      "format": "decimal",
      "description": "Amount"
     },
     "billing_currency": {
      "type": "string",
      "description": "Billed in"
     },
     "billing_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Billed amount"
     },
     "exchange_rate": {
      "type": "string",
      "format": "decimal",
      "description": "Exchange rate"
     },
     "detail": {
      "type": "object",
      "description": "Detail"
     },
     "expense_line_id": {
      "type": "string",
      "format": "uuid",
      "description": "Claim line"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "matched_at": {
      "type": "string",
      "format": "date-time",
      "description": "Matched at",
      "readOnly": true
     },
     "dispute_reason": {
      "type": "string",
      "description": "Dispute reason"
     },
     "statement_ref": {
      "type": "string",
      "description": "Statement"
     },
     "statement_date": {
      "type": "string",
      "format": "date",
      "description": "Statement date"
     },
     "journal_id": {
      "type": "string",
      "format": "uuid",
      "description": "Journal id",
      "readOnly": true
     },
     "imported_at": {
      "type": "string",
      "format": "date-time",
      "description": "Imported at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/card-transactions": {
   "get": {
    "summary": "list card-transactions",
    "operationId": "list_card_transactions_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create card-transactions",
    "operationId": "create_card_transactions_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/card-transactions/{id}": {
   "get": {
    "summary": "get card-transactions",
    "operationId": "get_card_transactions_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change card-transactions",
    "operationId": "change_card_transactions_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete card-transactions",
    "operationId": "delete_card_transactions_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/card-transactions/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_card_transactions_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/card-transactions/{id}/match-line": {
   "post": {
    "summary": "Match line",
    "operationId": "action_card_transactions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/card-transactions/{id}/unmatch": {
   "post": {
    "summary": "Unmatch",
    "operationId": "action_card_transactions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}