{
 "openapi": "3.1.0",
 "info": {
  "title": "Order Profitability (Manufacturing)",
  "version": "20261030b",
  "description": "Quoted against actual, for every customer order: what it was sold for, what it was estimated to cost, what it actually cost element by element, and the margin that came of it."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "order-profitability": {
    "type": "object",
    "required": [],
    "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
     },
     "so_no": {
      "type": "string",
      "description": "So no",
      "readOnly": true
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account id",
      "readOnly": true
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact id",
      "readOnly": true
     },
     "quotation_id": {
      "type": "string",
      "format": "uuid",
      "description": "Quotation id",
      "readOnly": true
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity id",
      "readOnly": true
     },
     "order_date": {
      "type": "string",
      "format": "date",
      "description": "Order date",
      "readOnly": true
     },
     "requested_date": {
      "type": "string",
      "format": "date",
      "description": "Requested date",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "subtotal": {
      "type": "string",
      "format": "decimal",
      "description": "Subtotal",
      "readOnly": true
     },
     "tax_total": {
      "type": "string",
      "format": "decimal",
      "description": "Tax total",
      "readOnly": true
     },
     "total": {
      "type": "string",
      "format": "decimal",
      "description": "Total",
      "readOnly": true
     },
     "customer_po_ref": {
      "type": "string",
      "description": "Customer po ref",
      "readOnly": true
     },
     "ship_to_address": {
      "type": "string",
      "description": "Ship to address",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location id",
      "readOnly": true
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse id",
      "readOnly": true
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center id",
      "readOnly": true
     },
     "profit_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Profit center id",
      "readOnly": true
     },
     "cancelled_at": {
      "type": "string",
      "format": "date-time",
      "description": "Cancelled at",
      "readOnly": true
     },
     "cancelled_by": {
      "type": "string",
      "format": "uuid",
      "description": "Cancelled by",
      "readOnly": true
     },
     "cancel_reason": {
      "type": "string",
      "description": "Cancel reason",
      "readOnly": true
     },
     "reversed_by_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reversed by id",
      "readOnly": true
     },
     "reverses_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reverses id",
      "readOnly": true
     },
     "exchange_rate": {
      "type": "string",
      "format": "decimal",
      "description": "Exchange rate",
      "readOnly": true
     },
     "base_total": {
      "type": "string",
      "format": "decimal",
      "description": "Base total",
      "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
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "edi_interchange_id": {
      "type": "string",
      "format": "uuid",
      "description": "Edi interchange id",
      "readOnly": true
     },
     "customer_po_date": {
      "type": "string",
      "format": "date",
      "description": "Customer po date",
      "readOnly": true
     },
     "source_channel": {
      "type": "string",
      "description": "Source channel",
      "readOnly": true
     },
     "channel_order_ref": {
      "type": "string",
      "description": "Channel order ref",
      "readOnly": true
     },
     "commerce_connector_id": {
      "type": "string",
      "format": "uuid",
      "description": "Commerce connector id",
      "readOnly": true
     },
     "supplier_gstin": {
      "type": "string",
      "description": "Supplier gstin",
      "readOnly": true
     },
     "buyer_gstin": {
      "type": "string",
      "description": "Buyer gstin",
      "readOnly": true
     },
     "place_of_supply": {
      "type": "string",
      "description": "Place of supply",
      "readOnly": true
     },
     "is_interstate": {
      "type": "boolean",
      "description": "Is interstate",
      "readOnly": true
     },
     "is_reverse_charge": {
      "type": "boolean",
      "description": "Is reverse charge",
      "readOnly": true
     },
     "export_type": {
      "type": "string",
      "description": "Export type",
      "readOnly": true
     },
     "cgst_total": {
      "type": "string",
      "format": "decimal",
      "description": "Cgst total",
      "readOnly": true
     },
     "sgst_total": {
      "type": "string",
      "format": "decimal",
      "description": "Sgst total",
      "readOnly": true
     },
     "igst_total": {
      "type": "string",
      "format": "decimal",
      "description": "Igst total",
      "readOnly": true
     },
     "cess_total": {
      "type": "string",
      "format": "decimal",
      "description": "Cess total",
      "readOnly": true
     },
     "order_type_id": {
      "type": "string",
      "format": "uuid",
      "description": "Order type id",
      "readOnly": true
     },
     "charges_total": {
      "type": "string",
      "format": "decimal",
      "description": "Charges total",
      "readOnly": true
     },
     "accrued_charges_total": {
      "type": "string",
      "format": "decimal",
      "description": "Accrued charges total",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/mfg/order-profitability": {
   "get": {
    "summary": "list order-profitability",
    "operationId": "list_order_profitability_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post order profitability",
    "operationId": "action_order_profitability_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/order-profitability/{sales_order_id}": {
   "get": {
    "summary": "get order-profitability",
    "operationId": "get_order_profitability_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/order-profitability/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_order_profitability_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/mfg/order-profitability/{id}": {
   "put": {
    "summary": "Put order profitability",
    "operationId": "action_order_profitability_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete order profitability",
    "operationId": "action_order_profitability_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}