{
 "openapi": "3.1.0",
 "info": {
  "title": "Supplier Portal Users (Supply Chain)",
  "version": "20261030b",
  "description": "People at your suppliers and carriers who sign in to the supplier portal: invited by email, held to their own records, with a second step where you require one. People at customers are invited from CRM."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "portal-users": {
    "type": "object",
    "required": [
     "full_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
     },
     "kind": {
      "type": "string",
      "description": "Works for a",
      "enum": [
       "supplier",
       "carrier"
      ],
      "readOnly": true
     },
     "party_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier",
      "readOnly": true
     },
     "email": {
      "type": "string",
      "description": "Email",
      "readOnly": true
     },
     "full_name": {
      "type": "string",
      "description": "Name"
     },
     "phone": {
      "type": "string",
      "description": "Phone"
     },
     "job_title": {
      "type": "string",
      "description": "Job title"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "password_hash": {
      "type": "string",
      "description": "Password hash",
      "readOnly": true
     },
     "invite_token_hash": {
      "type": "string",
      "description": "Invite token hash",
      "readOnly": true
     },
     "invite_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Invite expires at",
      "readOnly": true
     },
     "invited_at": {
      "type": "string",
      "format": "date-time",
      "description": "Invited at",
      "readOnly": true
     },
     "invited_by": {
      "type": "string",
      "format": "uuid",
      "description": "Invited by",
      "readOnly": true
     },
     "activated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Activated at",
      "readOnly": true
     },
     "scopes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "May use",
      "enum": [
       "Orders",
       "Shipping notices",
       "Invoices",
       "Enquiries",
       "Payments",
       "Our details",
       "Dock bookings",
       "Cases"
      ]
     },
     "mfa_required": {
      "type": "boolean",
      "description": "Require a second step"
     },
     "totp_secret": {
      "type": "string",
      "description": "Totp secret",
      "readOnly": true
     },
     "pending_secret": {
      "type": "string",
      "description": "Pending secret",
      "readOnly": true
     },
     "pending_at": {
      "type": "string",
      "format": "date-time",
      "description": "Pending at",
      "readOnly": true
     },
     "mfa_enrolled_at": {
      "type": "string",
      "format": "date-time",
      "description": "Mfa enrolled at",
      "readOnly": true
     },
     "last_step": {
      "type": "string",
      "format": "decimal",
      "description": "Last step",
      "readOnly": true
     },
     "recovery_hashes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Recovery hashes",
      "readOnly": true
     },
     "failed_attempts": {
      "type": "integer",
      "description": "Failed attempts",
      "readOnly": true
     },
     "locked_until": {
      "type": "string",
      "format": "date-time",
      "description": "Locked until",
      "readOnly": true
     },
     "last_login_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last login at",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "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
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact id",
      "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/scm/portal-users": {
   "get": {
    "summary": "list portal-users",
    "operationId": "list_portal_users_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create portal-users",
    "operationId": "create_portal_users_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}": {
   "get": {
    "summary": "get portal-users",
    "operationId": "get_portal_users_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change portal-users",
    "operationId": "change_portal_users_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete portal-users",
    "operationId": "delete_portal_users_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}/reinvite": {
   "post": {
    "summary": "Reinvite",
    "operationId": "action_portal_users_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}/disable": {
   "post": {
    "summary": "Disable",
    "operationId": "action_portal_users_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}/enable": {
   "post": {
    "summary": "Enable",
    "operationId": "action_portal_users_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}/reset-mfa": {
   "post": {
    "summary": "Reset mfa",
    "operationId": "action_portal_users_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}/activity": {
   "get": {
    "summary": "Activity",
    "operationId": "action_portal_users_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/attachments/{id}": {
   "get": {
    "summary": "Attachments",
    "operationId": "action_portal_users_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/portal-users/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_portal_users_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"
     }
    }
   }
  }
 }
}