{
 "openapi": "3.1.0",
 "info": {
  "title": "Carrier Accounts (Supply Chain)",
  "version": "20261030b",
  "description": "One set of credentials with one provider. Sealed the way every other connector in the product seals them, and never sent back to the browser."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "carrier-accounts": {
    "type": "object",
    "required": [
     "code",
     "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
     },
     "code": {
      "type": "string",
      "description": "Code"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "provider_id": {
      "type": "string",
      "format": "uuid",
      "description": "Provider"
     },
     "carrier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Carrier"
     },
     "account_number": {
      "type": "string",
      "description": "Account number"
     },
     "meter_number": {
      "type": "string",
      "description": "Meter number"
     },
     "shipper_number": {
      "type": "string",
      "description": "Shipper number"
     },
     "site_id": {
      "type": "string",
      "description": "Site id"
     },
     "api_key_cipher": {
      "type": "string",
      "description": "Api key cipher",
      "readOnly": true
     },
     "api_secret_cipher": {
      "type": "string",
      "description": "Api secret cipher",
      "readOnly": true
     },
     "username": {
      "type": "string",
      "description": "Username"
     },
     "password_cipher": {
      "type": "string",
      "description": "Password cipher",
      "readOnly": true
     },
     "access_token_cipher": {
      "type": "string",
      "description": "Access token cipher",
      "readOnly": true
     },
     "token_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Token expires at",
      "readOnly": true
     },
     "environment": {
      "type": "string",
      "description": "Environment",
      "enum": [
       "sandbox",
       "production"
      ]
     },
     "ship_from_place_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ships from"
     },
     "default_label_format": {
      "type": "string",
      "description": "Label format"
     },
     "default_service_id": {
      "type": "string",
      "format": "uuid",
      "description": "Default service"
     },
     "negotiated_rates": {
      "type": "boolean",
      "description": "Use negotiated rates"
     },
     "webhook_secret_cipher": {
      "type": "string",
      "description": "Webhook secret cipher",
      "readOnly": true
     },
     "last_ok_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last ok at",
      "readOnly": true
     },
     "last_error_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last error at",
      "readOnly": true
     },
     "last_error": {
      "type": "string",
      "description": "Last error",
      "readOnly": true
     },
     "calls_today": {
      "type": "integer",
      "description": "Calls today",
      "readOnly": true
     },
     "is_default": {
      "type": "boolean",
      "description": "Default account"
     },
     "is_active": {
      "type": "boolean",
      "description": "Active"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created 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_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/scm/carrier-accounts": {
   "get": {
    "summary": "list carrier-accounts",
    "operationId": "list_carrier_accounts_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create carrier-accounts",
    "operationId": "create_carrier_accounts_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/carrier-accounts/{id}": {
   "get": {
    "summary": "get carrier-accounts",
    "operationId": "get_carrier_accounts_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change carrier-accounts",
    "operationId": "change_carrier_accounts_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete carrier-accounts",
    "operationId": "delete_carrier_accounts_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/carrier-accounts/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_carrier_accounts_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/scm/carrier-accounts/{id}/credentials": {
   "put": {
    "summary": "Credentials",
    "operationId": "action_carrier_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/carrier-accounts/{id}/check": {
   "post": {
    "summary": "Check",
    "operationId": "action_carrier_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}