openapi: 3.2.0 info: title: Phasio Operator Addresses 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: Operator Addresses description: API for managing manufacturer operator addresses paths: /api/manufacturer/v1/operator/address/{addressId}: get: tags: - Operator Addresses summary: Get an operator address by ID description: Retrieves address details for the specified operator address ID operationId: getById parameters: - name: addressId in: path description: ID of the address to retrieve required: true schema: type: integer format: int64 example: 1 responses: '200': description: Address retrieved successfully content: application/json: schema: $ref: '#/components/schemas/AddressDto' '404': description: 'Address not found; error code: ADDRESS_NOT_FOUND' content: application/json: schema: $ref: '#/components/schemas/ApiError' put: tags: - Operator Addresses summary: Edit an existing operator address description: Creates a new address with the updated details, soft-deletes the old address, and transfers billing and shipping defaults if applicable operationId: edit parameters: - name: addressId in: path description: ID of the address to edit required: true schema: type: integer format: int64 example: 1 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditOperatorAddressDto' required: true responses: '200': description: Address edited successfully content: application/json: schema: $ref: '#/components/schemas/AddressDto' '404': description: 'Address not found or already deleted; error code: ADDRESS_NOT_FOUND' content: application/json: schema: $ref: '#/components/schemas/ApiError' delete: tags: - Operator Addresses summary: Delete an operator address description: Soft-deletes the specified operator address operationId: delete_1 parameters: - name: addressId in: path description: ID of the address to delete required: true schema: type: integer format: int64 example: 1 responses: '204': description: Address deleted successfully '404': description: 'Address not found; error code: ADDRESS_NOT_FOUND' content: application/json: schema: $ref: '#/components/schemas/ApiError' /api/manufacturer/v1/operator/address: get: tags: - Operator Addresses summary: List operator addresses description: Retrieves all non-deleted addresses for the current operator operationId: list_2 responses: '200': description: Addresses retrieved successfully content: application/json: schema: type: array items: $ref: '#/components/schemas/AddressDto' post: tags: - Operator Addresses summary: Create a new operator address description: Creates a new ship-from / facility address for the current operator operationId: create_4 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateOperatorAddressDto' required: true responses: '200': description: Address created successfully content: application/json: schema: $ref: '#/components/schemas/AddressDto' '400': description: Invalid address data content: application/json: schema: $ref: '#/components/schemas/ApiError' /api/manufacturer/v1/operator/address/{addressId}/shipping: patch: tags: - Operator Addresses summary: Set address as default shipping address description: Marks an operator address as the default shipping address operationId: setShippingAddress parameters: - name: addressId in: path description: ID of the address to set as shipping address required: true schema: type: integer format: int64 example: 1 responses: '200': description: Address set as shipping address successfully '404': description: 'Address not found; error code: ADDRESS_NOT_FOUND' content: application/json: schema: $ref: '#/components/schemas/ApiError' /api/manufacturer/v1/operator/address/{addressId}/billing: patch: tags: - Operator Addresses summary: Set address as default billing address description: Marks an operator address as the default billing address operationId: setBillingAddress parameters: - name: addressId in: path description: ID of the address to set as billing address required: true schema: type: integer format: int64 example: 1 responses: '200': description: Address set as billing address successfully '404': description: 'Address not found; error code: ADDRESS_NOT_FOUND' content: application/json: schema: $ref: '#/components/schemas/ApiError' components: schemas: 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 CreateOperatorAddressDto: type: object properties: street1: type: string street2: type: string city: type: string state: type: string country: type: string jurisdictionIsoCode: type: string zip: type: string name: type: string company: type: string phone: type: string email: type: string residential: type: boolean required: - city - company - country - email - name - phone - residential - state - street1 - street2 - zip EditOperatorAddressDto: type: object properties: street1: type: string street2: type: string city: type: string state: type: string country: type: string jurisdictionIsoCode: type: string zip: type: string name: type: string company: type: string phone: type: string email: type: string residential: type: boolean required: - city - company - country - email - name - phone - residential - state - street1 - street2 - zip 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 securitySchemes: Phasio_API_Bearer_Token: type: http name: Authorization in: header scheme: bearer bearerFormat: JWT