openapi: 3.2.0 info: title: Phasio Orders API description: This is the API documentation for the Phasio application. version: '1.0' servers: - url: https://m-api.eu.phas.io description: Generated server url security: - Phasio API Bearer Token: [] tags: - name: Orders description: API for managing orders and their lifecycle paths: /api/manufacturer/v1/order: get: tags: - Orders summary: Retrieve orders description: Retrieves a paginated list of orders with optional filtering and search operationId: get_2 parameters: - name: filter in: query description: RSQL query string for filtering (e.g. paymentStatus=in=(PAID,UNPAID);price>10) required: true schema: type: string - name: page in: query description: Zero-based page index (0..N) required: false schema: type: integer default: 0 minimum: 0 - name: size in: query description: The size of the page to be returned required: false schema: type: integer default: 20 minimum: 1 - name: sort in: query description: 'Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.' required: false schema: type: array default: - createdAt,DESC items: type: string - name: search in: query description: Optional search term required: false schema: type: string responses: '200': description: Successfully retrieved orders content: application/json: schema: $ref: '#/components/schemas/Paginated' '400': description: Invalid filter specification content: application/json: schema: $ref: '#/components/schemas/ApiError' post: tags: - Orders summary: Create an order description: Creates a new order with the provided details operationId: create_2 parameters: - name: threadId in: query description: ID of the thread to associate with the order required: false schema: type: integer format: int64 - name: customerOrganisationId in: query description: ID of the customer organisation to associated with the order required: true schema: type: integer format: int64 - name: state in: query description: Whether to create an order, quote, or internal draft required: false schema: type: string default: QUOTE enum: - QUOTE - ORDER - DRAFT requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateOrderDto' required: true responses: '200': description: Order successfully created content: application/json: schema: $ref: '#/components/schemas/CreateOrderResponseDto' '400': description: Invalid order data or creation failed content: application/json: schema: $ref: '#/components/schemas/ApiError' '401': description: Unauthorized - missing operator context content: application/json: schema: $ref: '#/components/schemas/ApiError' /api/manufacturer/v1/order/{id}/kanban-column: patch: tags: - Orders summary: Update order kanban column description: Moves an order to a different kanban column. Optional skipAutomationTypes field suppresses the named column automations for this request only. operationId: updateKanbanColumn parameters: - name: id in: path description: ID of the order to update required: true schema: type: integer format: int64 example: 1 requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateOrderKanbanColumnDto' required: true responses: '204': description: Kanban column successfully updated '400': description: Failed to update kanban column content: application/json: schema: $ref: '#/components/schemas/ApiError' '404': description: Order or kanban column not found content: application/json: schema: $ref: '#/components/schemas/ApiError' /api/manufacturer/v1/order/{id}: get: tags: - Orders summary: Retrieve an order description: Retrieves a specific order by its ID operationId: getById_5 parameters: - name: id in: path description: ID of the order to retrieve required: true schema: type: integer format: int64 example: 1 responses: '200': description: Successfully retrieved order content: application/json: schema: $ref: '#/components/schemas/OrderDto' '404': description: Order not found content: application/json: schema: $ref: '#/components/schemas/ApiError' components: schemas: ParcelAllocationDto: type: object properties: requisitionId: type: integer format: int64 quantity: type: integer required: - quantity - requisitionId CollectionShipmentDto: allOf: - $ref: '#/components/schemas/ShipmentDto' description: Collection shipment with no destination address or tracking required: - documents - fromAddress - parcels - type PostProcessingVariablesDto: type: object properties: postProcessingId: type: integer format: int64 variables: type: object additionalProperties: type: number required: - postProcessingId - variables CreateDiscountDto: type: object properties: discountType: type: string percentage: type: number required: - discountType - percentage ShippingDto: type: object discriminator: propertyName: shippingMode properties: id: type: integer format: int64 operatorId: type: integer format: int64 shippingMode: type: string enum: - SELF_COLLECTION - FIXED_PRICE - CARRIER_ACCOUNT - CUSTOMER_ACCOUNT shippingMethodId: type: integer format: int64 customerOrganisationId: type: integer format: int64 rateId: type: string toAddressId: type: integer format: int64 expectedDispatchDate: type: string format: date incoterm: type: string enum: - EXW - FCA - CPT - CIP - DAP - DPU - DDP - FAS - FOB - CFR - CIF dispatchDate: type: string format: date readOnly: true required: - operatorId - shippingMode ShipmentUserDto: type: object properties: id: type: string format: uuid firstName: type: string lastName: type: string displayName: type: string required: - firstName - id - lastName ExpenseDto: type: object properties: expenseId: type: integer format: int64 name: type: string description: type: string type: type: string accountingCategoryCode: type: string required: - expenseId - name - type CreateInstantDiscountDto: allOf: - $ref: '#/components/schemas/CreateDiscountDto' - type: object properties: note: type: string required: - discountType - note - percentage FixedPriceShippingDto: allOf: - $ref: '#/components/schemas/ShippingDto' - type: object properties: rate: type: number manualRate: type: number toAddress: oneOf: - $ref: '#/components/schemas/CustomerOrganisationAddressDto' - $ref: '#/components/schemas/OperatorAddressDto' name: type: string required: - operatorId - shippingMode RequisitionDto: type: object properties: id: type: integer format: int64 partSpecificationId: type: string format: uuid partRevisionId: type: string format: uuid orderId: type: integer format: int64 orderNumber: type: string customReference: type: string customerOrganisationId: type: integer format: int64 customerOrganisationName: type: string pricingType: type: string manualPrice: type: number pricePaid: type: number quantity: type: integer createdAt: type: string format: date-time lastUpdated: type: string format: date-time leadTimeId: type: string format: uuid workOrders: type: array items: $ref: '#/components/schemas/WorkOrderDto' variables: type: object additionalProperties: type: number postProcessingVariables: type: array items: $ref: '#/components/schemas/PostProcessingVariablesDto' duration: type: integer name: type: string sequence: type: integer format: int32 required: - createdAt - id - lastUpdated - name - orderId - orderNumber - partRevisionId - partSpecificationId - postProcessingVariables - pricingType - quantity - sequence - variables - workOrders CreateRequisitionDto: type: object properties: requisitionIntentId: type: string format: uuid partRevisionId: type: string format: uuid units: type: string enum: - CENTIMETERS - MILLIMETERS - METRES - INCHES - FEET quantity: type: integer materialId: type: integer format: int64 processPricesId: type: string format: uuid infillId: type: integer format: int64 precisionId: type: integer format: int64 colorId: type: integer format: int64 postProcessing: type: array items: $ref: '#/components/schemas/CreateRequisitionPostProcessingDto' uniqueItems: true variables: type: object additionalProperties: type: number manualPrice: type: number leadTimeId: type: string format: uuid comments: type: array items: oneOf: - $ref: '#/components/schemas/CreateLocationCommentDto' - $ref: '#/components/schemas/CreateRequisitionCommentDto' name: type: string constraints: type: array items: oneOf: - $ref: '#/components/schemas/CreateFixedOrientationRequisitionConstraintDto' sequence: type: integer format: int32 required: - comments - constraints - materialId - partRevisionId - postProcessing - processPricesId - quantity - requisitionIntentId - sequence - units - variables CustomerAccountShippingDto: allOf: - $ref: '#/components/schemas/ShippingDto' - type: object properties: accountNumber: type: string name: type: string toAddress: oneOf: - $ref: '#/components/schemas/CustomerOrganisationAddressDto' - $ref: '#/components/schemas/OperatorAddressDto' required: - operatorId - shippingMode ApiError: type: object additionalProperties: true description: Stable error contract. `error` is a SCREAMING_SNAKE code that clients match on; `message` is a human-readable sentence. Some errors add extra string fields (for example organisationId). properties: error: type: string example: ORDER_NOT_FOUND message: type: string example: Order not found required: - error - message CreateRequisitionCommentDto: allOf: - $ref: '#/components/schemas/CreateOrderCommentDto' required: - conversationType - message CreateOrderDto: type: object description: Order details properties: requisitions: type: array items: $ref: '#/components/schemas/CreateRequisitionDto' assemblyRequisitions: type: array items: $ref: '#/components/schemas/CreateAssemblyRequisitionDto' expenses: type: array items: oneOf: - $ref: '#/components/schemas/CreateFixedExpenseDto' - $ref: '#/components/schemas/CreateHourlyExpenseDto' currency: type: string enum: - USD - SGD - EUR - INR - JPY - AUD - GBP - NZD - MYR - CAD - CHF - DKK - SEK - MXN - ZAR - UAH - NOK - PHP - TRY source: type: string discountId: type: integer format: int64 operatorNote: type: string isSilent: type: boolean affiliate: type: string paymentDueDate: type: string format: date-time discount: oneOf: - $ref: '#/components/schemas/CreateCustomerDiscountDto' - $ref: '#/components/schemas/CreateGenericDiscountDto' - $ref: '#/components/schemas/CreateInstantDiscountDto' shipping: oneOf: - $ref: '#/components/schemas/CarrierAccountShippingDto' - $ref: '#/components/schemas/CustomerAccountShippingDto' - $ref: '#/components/schemas/FixedPriceShippingDto' - $ref: '#/components/schemas/SelfCollectionShippingDto' billingAddressId: type: integer format: int64 ccCustomerIds: type: array items: type: integer format: int64 uniqueItems: true customReference: type: string required: - assemblyRequisitions - ccCustomerIds - currency - expenses - requisitions - source AssemblyRequisitionDto: type: object properties: id: type: integer format: int64 assemblyId: type: string format: uuid assemblyName: type: string quantity: type: integer assemblyPricePaid: type: number totalPricePaid: type: number partCount: type: integer format: int32 createdAt: type: string format: date-time required: - assemblyId - assemblyName - assemblyPricePaid - id - partCount - quantity - totalPricePaid ShipmentDocumentDto: type: object properties: id: type: string format: uuid name: type: string contentType: type: string size: type: integer format: int64 uploadedBy: $ref: '#/components/schemas/ShipmentUserDto' createdAt: type: string format: date-time required: - contentType - createdAt - id - name - size - uploadedBy CreateCustomerDiscountDto: allOf: - $ref: '#/components/schemas/CreateDiscountDto' - type: object properties: code: type: string startTime: type: string format: date-time endTime: type: string format: date-time customerId: type: integer format: int64 required: - code - customerId - discountType - endTime - percentage - startTime OrderWorkOrderDto: type: object properties: id: type: string format: uuid workOrderNumber: type: integer format: int64 partName: type: string quantity: type: integer startDate: type: string format: date-time dueDate: type: string format: date-time stages: type: array items: $ref: '#/components/schemas/OrderWorkOrderStageDto' required: - id - quantity - stages - startDate CreateHourlyExpenseDto: allOf: - $ref: '#/components/schemas/CreateExpenseDto' - type: object properties: hours: type: number rate: type: number required: - hours - name - rate - type OrderWorkOrderStageDto: type: object properties: operationId: type: string format: uuid name: type: string quantity: type: integer required: - name - operationId - quantity OperatorAddressDto: allOf: - $ref: '#/components/schemas/AddressDto' required: - addressId - addressType - city - company - country - countryAlpha2Code - countryAlpha3Code - email - isBillingAddress - isDeleted - isShippingAddress - name - phone - residential - street1 - street2 - zip CreateOrderCommentDto: type: object discriminator: propertyName: conversationType properties: message: type: string customerId: type: integer format: int64 conversationType: type: string actorType: type: string required: - conversationType - message CustomerOrganisationAddressDto: allOf: - $ref: '#/components/schemas/AddressDto' required: - addressId - addressType - city - company - country - countryAlpha2Code - countryAlpha3Code - email - isBillingAddress - isDeleted - isShippingAddress - name - phone - residential - street1 - street2 - zip CreateRequisitionConstraintDto: type: object discriminator: propertyName: constraintType properties: constraintType: type: string required: - constraintType ProductionProgressDto: type: object properties: volume: type: number quantity: type: number required: - quantity - volume CreateOrderResponseDto: type: object properties: order: $ref: '#/components/schemas/OrderDto' requisitions: type: object additionalProperties: $ref: '#/components/schemas/RequisitionDto' accountingSyncWarning: type: string required: - requisitions AddressDto: type: object discriminator: propertyName: addressType mapping: OPERATOR: '#/components/schemas/OperatorAddressDto' CUSTOMER_ORGANISATION: '#/components/schemas/CustomerOrganisationAddressDto' properties: addressId: type: integer format: int64 isBillingAddress: type: boolean isShippingAddress: type: boolean street1: type: string street2: type: string city: type: string state: type: string country: type: string countryAlpha2Code: type: string countryAlpha3Code: type: string jurisdictionIsoCode: type: string zip: type: string name: type: string company: type: string phone: type: string email: type: string residential: type: boolean addressType: type: string isDeleted: type: boolean taxId: type: string required: - addressId - addressType - city - company - country - countryAlpha2Code - countryAlpha3Code - email - isBillingAddress - isDeleted - isShippingAddress - name - phone - residential - street1 - street2 - zip HourlyExpenseDto: allOf: - $ref: '#/components/schemas/ExpenseDto' - type: object properties: hours: type: number rate: type: number required: - expenseId - hours - name - rate - type FixedExpenseDto: allOf: - $ref: '#/components/schemas/ExpenseDto' - type: object properties: quantity: type: number unitPrice: type: number localUnitPrice: type: number price: type: number costForOperator: type: number required: - costForOperator - expenseId - localUnitPrice - name - price - quantity - type - unitPrice OrderTaxDto: type: object properties: id: type: string format: uuid components: type: array items: $ref: '#/components/schemas/OrderTaxComponentDto' totalPrice: type: number localTotalPrice: type: number isTaxAppliedToShipping: type: boolean isTaxExempted: type: boolean accountingSystemTaxId: type: string taxNumber: type: string required: - components - id - isTaxAppliedToShipping - isTaxExempted - localTotalPrice - totalPrice DiscountDto: type: object properties: discountId: type: integer format: int64 discountType: type: string code: type: string percentage: type: number startTime: type: string format: date-time endTime: type: string format: date-time customerId: type: integer format: int64 customerEmail: type: string customerPhoneNumber: type: string required: - discountId - discountType - endTime - percentage - startTime OrderDto: type: object properties: id: type: integer format: int64 customerOrganisationId: type: integer format: int64 customerOrganisationName: type: string threadId: type: integer format: int64 createdAt: type: string format: date-time updateDt: type: string format: date-time isArchived: type: boolean isVoided: type: boolean isPurchaseOrder: type: boolean isInProject: type: boolean isSilent: type: boolean hasWorkOrders: type: boolean workOrders: type: array items: $ref: '#/components/schemas/OrderWorkOrderDto' source: type: string billingAddressId: type: integer format: int64 currency: type: string localCurrency: type: string paymentStatus: type: string awaitingStatus: type: string kanbanColumnId: type: string quoteNumber: type: string orderNumber: type: string state: type: string enum: - QUOTE - ORDER - DRAFT accountingSystemEstimateId: type: string accountingSystemEstimateNumber: type: string accountingSystemConfirmationId: type: string accountingSystemConfirmationNumber: type: string accountingSystemInvoiceId: type: string accountingSystemInvoiceNumber: type: string affiliate: type: string createdBy: $ref: '#/components/schemas/OrderUserDto' owner: $ref: '#/components/schemas/OrderUserDto' actorType: type: string paymentDueDate: type: string format: date-time productionProgress: $ref: '#/components/schemas/ProductionProgressDto' requisitionIds: type: array items: type: integer format: int64 assemblyRequisitions: type: array items: $ref: '#/components/schemas/AssemblyRequisitionDto' expenses: type: array items: oneOf: - $ref: '#/components/schemas/FixedExpenseDto' - $ref: '#/components/schemas/HourlyExpenseDto' shipping: oneOf: - $ref: '#/components/schemas/CarrierAccountShippingDto' - $ref: '#/components/schemas/CustomerAccountShippingDto' - $ref: '#/components/schemas/FixedPriceShippingDto' - $ref: '#/components/schemas/SelfCollectionShippingDto' shipments: type: array items: oneOf: - $ref: '#/components/schemas/CollectionShipmentDto' - $ref: '#/components/schemas/CourierShipmentDto' discount: $ref: '#/components/schemas/DiscountDto' tax: $ref: '#/components/schemas/OrderTaxDto' price: type: number localPrice: type: number topUpPrice: type: number purchaseOrderNumber: type: string customerAcceptedTime: type: string format: date-time operatorNote: type: string customReference: type: string bypassPurchasabilityChecks: type: boolean subscribedCustomerIds: type: array items: type: integer format: int64 uniqueItems: true isEditable: type: boolean shipment: oneOf: - $ref: '#/components/schemas/CarrierAccountShippingDto' - $ref: '#/components/schemas/CustomerAccountShippingDto' - $ref: '#/components/schemas/FixedPriceShippingDto' - $ref: '#/components/schemas/SelfCollectionShippingDto' readOnly: true required: - assemblyRequisitions - awaitingStatus - bypassPurchasabilityChecks - createdAt - currency - expenses - hasWorkOrders - id - isArchived - isEditable - isInProject - isPurchaseOrder - isSilent - isVoided - localCurrency - paymentStatus - requisitionIds - shipments - source - state - subscribedCustomerIds - threadId - updateDt - workOrders CreateAssemblyRequisitionDto: type: object properties: requisitionIntentId: type: string format: uuid assemblyId: type: string format: uuid quantity: type: integer required: - assemblyId - quantity - requisitionIntentId Paginated: type: object properties: content: type: array items: {} totalElements: type: integer totalPages: type: integer pageNumber: type: integer pageSize: type: integer isEmpty: type: boolean isFirst: type: boolean isLast: type: boolean required: - content - isEmpty - isFirst - isLast - pageNumber - pageSize - totalElements - totalPages RoutingStepDto: type: object properties: operationId: type: string format: uuid sequence: type: integer format: int32 statusId: type: string format: uuid required: - operationId - sequence - statusId CreateFixedExpenseDto: allOf: - $ref: '#/components/schemas/CreateExpenseDto' - type: object properties: quantity: type: number unitPrice: type: number costForOperator: type: number required: - costForOperator - name - quantity - type - unitPrice CreateGenericDiscountDto: allOf: - $ref: '#/components/schemas/CreateDiscountDto' - type: object properties: code: type: string startTime: type: string format: date-time endTime: type: string format: date-time genericDiscountNoe: type: string required: - code - discountType - endTime - genericDiscountNoe - percentage - startTime OrderUserDto: type: object properties: email: type: string firstName: type: string lastName: type: string required: - email - firstName - lastName CreateExpenseDto: type: object properties: name: type: string description: type: string type: type: string accountingCategoryCode: type: string required: - name - type CreateRequisitionPostProcessingDto: type: object properties: postProcessingId: type: integer format: int64 variables: type: object additionalProperties: type: number required: - postProcessingId - variables WorkOrderDto: type: object properties: id: type: string format: uuid workOrderNumber: type: integer format: int64 routingTemplateId: type: string format: uuid name: type: string quantity: type: integer routing: type: array items: $ref: '#/components/schemas/RoutingStepDto' createdAt: type: string format: date-time startDate: type: string format: date-time dueDate: type: string format: date-time required: - createdAt - id - quantity - routing - startDate CreateFixedOrientationRequisitionConstraintDto: allOf: - $ref: '#/components/schemas/CreateRequisitionConstraintDto' - type: object properties: rotationMatrix: type: array items: type: array items: type: number maxItems: 3 minItems: 3 required: - constraintType - rotationMatrix GenerateShippingLabelDto: allOf: - $ref: '#/components/schemas/KanbanColumnAutomationRequestDto' - type: object properties: parcelContentsType: type: string parcelContentsDescription: type: string required: - parcelContentsDescription - parcelContentsType - type OrderTaxComponentDto: type: object properties: id: type: string format: uuid shortName: type: string longName: type: string percentage: type: number amount: type: number localAmount: type: number required: - amount - id - localAmount - longName - percentage - shortName ShipmentAddressDto: type: object description: Address snapshot stored on the shipment. Do not send an address-book ID. properties: street1: type: string street2: type: string city: type: string state: type: string country: type: string zip: type: string name: type: string company: type: string phone: type: string email: type: string jurisdictionIsoCode: type: string residential: type: boolean taxId: type: string required: - city - country - email - name - phone - residential - street1 - street2 - zip ParcelDto: type: object description: Physical parcel on a shipment. Weights are grams; dimensions are millimetres; value is required. properties: id: type: string format: uuid grossWeightGrams: type: integer format: int32 netWeightGrams: type: integer format: int32 value: type: number width: type: integer format: int32 height: type: integer format: int32 length: type: integer format: int32 allocations: type: array items: $ref: '#/components/schemas/ParcelAllocationDto' required: - allocations - grossWeightGrams - height - length - netWeightGrams - value - width KanbanColumnAutomationRequestDto: type: object properties: type: type: string required: - type ShipmentDto: type: object description: A concrete shipment on an order. Discriminated by `type`. discriminator: propertyName: type mapping: COURIER: '#/components/schemas/CourierShipmentDto' COLLECTION: '#/components/schemas/CollectionShipmentDto' properties: id: type: string format: uuid type: type: string enum: - COURIER - COLLECTION status: type: string enum: - PREPARED - RELEASED - FULFILLED incoterm: type: string enum: - EXW - FCA - CPT - CIP - DAP - DPU - DDP - FAS - FOB - CFR - CIF fromAddress: $ref: '#/components/schemas/ShipmentAddressDto' parcels: type: array items: $ref: '#/components/schemas/ParcelDto' preparedAt: type: string format: date-time preparedBy: $ref: '#/components/schemas/ShipmentUserDto' releasedAt: type: string format: date-time releasedBy: $ref: '#/components/schemas/ShipmentUserDto' fulfilledAt: type: string format: date-time fulfilledBy: $ref: '#/components/schemas/ShipmentUserDto' documents: type: array items: $ref: '#/components/schemas/ShipmentDocumentDto' required: - documents - fromAddress - parcels - type CourierShipmentDto: allOf: - $ref: '#/components/schemas/ShipmentDto' description: Courier shipment with a destination address and optional tracking required: - documents - fromAddress - parcels - toAddress - type UpdateOrderKanbanColumnDto: type: object description: Kanban column details properties: kanbanColumnId: type: string format: uuid kanbanColumnAutomationRequests: type: array items: oneOf: - $ref: '#/components/schemas/GenerateShippingLabelDto' skipAutomationTypes: type: array items: type: string required: - kanbanColumnAutomationRequests - kanbanColumnId - skipAutomationTypes CreateLocationCommentDto: allOf: - $ref: '#/components/schemas/CreateOrderCommentDto' - type: object properties: locationX: type: number locationY: type: number locationZ: type: number cameraPositionX: type: number cameraPositionY: type: number cameraPositionZ: type: number cameraRotationX: type: number cameraRotationY: type: number cameraRotationZ: type: number required: - cameraPositionX - cameraPositionY - cameraPositionZ - cameraRotationX - cameraRotationY - cameraRotationZ - conversationType - locationX - locationY - locationZ - message CarrierAccountShippingDto: allOf: - $ref: '#/components/schemas/ShippingDto' - type: object properties: toAddress: oneOf: - $ref: '#/components/schemas/CustomerOrganisationAddressDto' - $ref: '#/components/schemas/OperatorAddressDto' fromAddress: oneOf: - $ref: '#/components/schemas/CustomerOrganisationAddressDto' - $ref: '#/components/schemas/OperatorAddressDto' carrierAccountProvider: type: string carrierAccountServiceType: type: string carrierAccountServiceName: type: string estimatedRate: type: number finalRatePaid: type: number required: - operatorId - shippingMode SelfCollectionShippingDto: allOf: - $ref: '#/components/schemas/ShippingDto' - type: object properties: contactName: type: string contactPhoneNumber: type: string rate: type: number name: type: string required: - operatorId - shippingMode securitySchemes: Phasio_API_Bearer_Token: type: http name: Authorization in: header scheme: bearer bearerFormat: JWT