{
 "openapi": "3.1.0",
 "info": {
  "title": "Staffing Clients (Talent & Contingent Workforce)",
  "version": "20261030b",
  "description": "The buying organizations. A client bought through an MSP is governed by that programme rather than by whatever was agreed with the hiring manager."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "clients": {
    "type": "object",
    "required": [
     "name"
    ],
    "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
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Office"
     },
     "client_no": {
      "type": "string",
      "description": "Client no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "name_local": {
      "type": "string",
      "description": "Local name"
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "CRM account"
     },
     "client_type": {
      "type": "string",
      "description": "Type"
     },
     "msp_program_id": {
      "type": "string",
      "format": "uuid",
      "description": "Programme"
     },
     "industry": {
      "type": "string",
      "description": "Industry"
     },
     "website": {
      "type": "string",
      "description": "Website"
     },
     "owner_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account manager"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "payment_terms_days": {
      "type": "integer",
      "description": "Payment terms (days)"
     },
     "credit_limit": {
      "type": "string",
      "format": "decimal",
      "description": "Credit limit"
     },
     "default_markup_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Default markup %"
     },
     "po_required": {
      "type": "boolean",
      "description": "PO number required on every invoice"
     },
     "timesheet_approval": {
      "type": "string",
      "description": "Timesheets approved by",
      "enum": [
       "client_manager",
       "vms",
       "auto",
       "none"
      ]
     },
     "invoice_frequency": {
      "type": "string",
      "description": "Invoice frequency",
      "enum": [
       "weekly",
       "biweekly",
       "semimonthly",
       "monthly",
       "milestone"
      ]
     },
     "billing_address": {
      "type": "string",
      "description": "Billing address"
     },
     "billing_email": {
      "type": "string",
      "description": "Billing email"
     },
     "msa_signed_on": {
      "type": "string",
      "format": "date",
      "description": "MSA signed"
     },
     "msa_expires_on": {
      "type": "string",
      "format": "date",
      "description": "MSA expires"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "prospect",
       "active",
       "on_hold",
       "dormant",
       "blacklisted",
       "closed"
      ]
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "is_active": {
      "type": "boolean",
      "description": "Active"
     },
     "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
     },
     "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
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/ats/clients": {
   "get": {
    "summary": "list clients",
    "operationId": "list_clients_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create clients",
    "operationId": "create_clients_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ats/clients/{id}": {
   "get": {
    "summary": "get clients",
    "operationId": "get_clients_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change clients",
    "operationId": "change_clients_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete clients",
    "operationId": "delete_clients_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ats/clients/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_clients_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/ats/clients/{parentId}/contacts": {
   "get": {
    "summary": "Contacts",
    "operationId": "action_clients_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Contacts",
    "operationId": "action_clients_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ats/clients/{parentId}/contacts/{lineId}": {
   "put": {
    "summary": "Contacts",
    "operationId": "action_clients_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Contacts",
    "operationId": "action_clients_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}