{"openapi":"3.0.1","info":{"title":"Courierbackend API","description":"Courierbackend API documentation","termsOfService":"","contact":{"name":"","url":"","email":""},"license":{"name":"unlicensed","url":""},"version":"0.0.1"},"servers":[{"url":"https://courier-service.brain24-prod.1c1f95b1c4134aa59e09.northeurope.aksapp.io","description":"Generated server url"}],"paths":{"/api/courier-parcels/{id}":{"get":{"tags":["courier-parcel-resource"],"operationId":"getCourierParcel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}}}}}},"put":{"tags":["courier-parcel-resource"],"operationId":"updateCourierParcel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}}}}}},"delete":{"tags":["courier-parcel-resource"],"operationId":"deleteCourierParcel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"}}},"patch":{"tags":["courier-parcel-resource"],"operationId":"partialUpdateCourierParcel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}},"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}}}}}}},"/api/courier-parcel-documents/{id}":{"get":{"tags":["courier-parcel-document-resource"],"operationId":"getCourierParcelDocument","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}}}}},"put":{"tags":["courier-parcel-document-resource"],"operationId":"updateCourierParcelDocument","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}}}}},"delete":{"tags":["courier-parcel-document-resource"],"operationId":"deleteCourierParcelDocument","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"}}},"patch":{"tags":["courier-parcel-document-resource"],"operationId":"partialUpdateCourierParcelDocument","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}},"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}}}}}},"/api/courier-parcels":{"get":{"tags":["courier-parcel-resource"],"operationId":"getAllCourierParcels","parameters":[{"name":"criteria","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CourierParcelCriteria"}},{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":20}},{"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","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CourierParcelDTO"}}}}}}},"post":{"tags":["courier-parcel-resource"],"operationId":"createCourierParcel","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourierParcelDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}}}}}},"/api/courier-parcels/by-external-id":{"post":{"tags":["courier-parcel-resource"],"summary":"Registers a new parcel in a terminal","description":"This endpoint creates a reservation for a terminal locker specified for the given external id (código orgânico).\nSupports public and private terminals Currently this operation does some validation checks (dimensions).\nDoes not validate the terminal capacity.This operation does not return any response.\nIts execution is asynchronous.","operationId":"createCourierParcelByTerminalExternalId","requestBody":{"description":"Parcel Reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParcelReservationDTO"},"examples":{"Reservation":{"description":"Reservation to be created","value":{"externalId":"4100019","originalCourierLabel":"originalCourierLabel","parcelPartnerLabel":"EM2334342399PT","partner":"CTT","customerEmail":"joao.teste@polarising.com","customerPhone":"123456789","customerName":"Teste Teste","parcelHeight":10,"parcelWidth":10,"parcelDepth":10,"climatizationType":"DRY","epv":"WZBMHM","collectOffsetLimit":"30","operationType":"DELIVERY","checkLogicOccupancy":"false"}}}}},"required":true},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized (Invalid Credentials)"},"403":{"description":"Forbidden"},"409":{"description":"Duplicated"},"500":{"description":"Internal Server Error"}},"security":[{"Bearer":[]}]}},"/api/courier-parcel-documents":{"get":{"tags":["courier-parcel-document-resource"],"operationId":"getAllCourierParcelDocuments","parameters":[{"name":"criteria","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CourierParcelDocumentCriteria"}},{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":20}},{"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","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}}}}}},"post":{"tags":["courier-parcel-document-resource"],"operationId":"createCourierParcelDocument","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CourierParcelDocumentDTO"}}}}}}},"/api/users":{"get":{"tags":["public-user-resource"],"operationId":"getAllPublicUsers","parameters":[{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":20}},{"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","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDTO"}}}}}}}},"/api/courier-parcels/count":{"get":{"tags":["courier-parcel-resource"],"operationId":"countCourierParcels","parameters":[{"name":"criteria","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CourierParcelCriteria"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}}}}},"/api/courier-parcel-documents/{parcelPartnerLabel}/reprint":{"get":{"tags":["courier-parcel-document-resource"],"operationId":"reprintLabel","parameters":[{"name":"parcelPartnerLabel","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/api/courier-parcel-documents/{documentId}/download":{"get":{"tags":["courier-parcel-document-resource"],"operationId":"downloadCourierParcelDocument","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/api/courier-parcel-documents/count":{"get":{"tags":["courier-parcel-document-resource"],"operationId":"countCourierParcelDocuments","parameters":[{"name":"criteria","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CourierParcelDocumentCriteria"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}}}}},"/api/courier-customer/{EpvCode}":{"get":{"tags":["courier-customer-resource"],"operationId":"getCourierCustomerDetails","parameters":[{"name":"EpvCode","in":"path","required":true,"schema":{"type":"string"}},{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CourierCustomerDto"}}}}}}}},"/api/authorities":{"get":{"tags":["public-user-resource"],"operationId":"getAuthorities","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/api/admin/users":{"get":{"tags":["user-resource"],"operationId":"getAllUsers","parameters":[{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":20}},{"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","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserDTO"}}}}}}}},"/api/admin/users/{login}":{"get":{"tags":["user-resource"],"operationId":"getUser","parameters":[{"name":"login","in":"path","required":true,"schema":{"pattern":"^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$","type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AdminUserDTO"}}}}}}}},"components":{"schemas":{"CourierParcelDTO":{"required":["externalId","parcelPartnerLabel","status"],"type":"object","properties":{"id":{"type":"integer","format":"int64"},"externalId":{"type":"string","description":"id of the terminal where parcel is registered"},"status":{"type":"string","enum":["ERROR","PENDING","CREATED","PROCESSED"]},"originalCourierLabel":{"maxLength":100,"minLength":0,"type":"string","description":"The original courier label"},"parcelPartnerLabel":{"maxLength":100,"minLength":0,"type":"string","description":"Represents the order number of the parcel and is used for communications that are made to the customer or as a parcel identifier by the partner. It does not have to match the barcode"},"partner":{"type":"string"},"customerEmail":{"maxLength":300,"minLength":0,"type":"string"},"customerPhone":{"maxLength":300,"minLength":0,"type":"string"},"customerName":{"maxLength":300,"minLength":0,"type":"string"},"parcelHeight":{"type":"integer","format":"int32"},"parcelWidth":{"type":"integer","format":"int32"},"parcelDepth":{"type":"integer","format":"int32"},"parcelWeight":{"type":"integer","format":"int32"},"climatizationType":{"type":"string","enum":["DRY","FRIDGE","FROZEN"]},"epv":{"type":"string"},"payed":{"type":"boolean"},"userBalance":{"type":"number","format":"double"},"defaultLockerPrice":{"type":"number","format":"double"},"operationType":{"type":"string","enum":["DELIVERY","RETURN"]}},"description":"Courier Parcel. Represents a new parcel, or a new order to a shipping at courier when the courier is CTT."},"CourierParcelDocumentDTO":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"documentId":{"maxLength":2000,"minLength":0,"type":"string","description":"Document UUID stored in a Azure Storage Account"},"courierParcel":{"$ref":"#/components/schemas/CourierParcelDTO"}}},"ParcelReservationDTO":{"required":["externalId","parcelPartnerLabel","partner"],"type":"object","properties":{"id":{"type":"integer","format":"int64"},"externalId":{"type":"string","description":"External id (código orgânico) of the terminal where parcel is registered"},"originalCourierLabel":{"maxLength":100,"minLength":0,"type":"string","description":"Represents the order number of the parcel (CTT Label) and is used for communications\nthat are made to the customer or as a parcel identifier by the partner"},"parcelPartnerLabel":{"maxLength":100,"minLength":0,"type":"string","description":"represents the physical parcel order number"},"partner":{"maxLength":250,"minLength":0,"type":"string"},"customerEmail":{"maxLength":300,"minLength":0,"type":"string"},"customerPhone":{"maxLength":300,"minLength":0,"type":"string"},"customerName":{"maxLength":300,"minLength":0,"type":"string"},"parcelHeight":{"type":"integer","format":"int32"},"parcelWidth":{"type":"integer","format":"int32"},"parcelDepth":{"type":"integer","format":"int32"},"parcelWeight":{"type":"integer","format":"int32"},"payed":{"type":"boolean"},"climatizationType":{"type":"string","enum":["DRY","FRIDGE","FROZEN"]},"epv":{"type":"string"},"collectOffsetLimit":{"type":"integer","format":"int32"},"operationType":{"type":"string","enum":["DELIVERY","RETURN"]},"checkLogicOccupancy":{"type":"boolean"}},"description":"Parcel/Package. Sent by CTT Engine. A physical parcel that is deposited in the terminal.\nThe terms reservation and parcel can be used indistinctly\nReservation. Booking of space made in a terminal for a specific date. Includes the whole process, even if the parcel has not been deposited."},"UserDTO":{"type":"object","properties":{"id":{"type":"string"},"login":{"type":"string"}}},"BooleanFilter":{"type":"object","properties":{"equals":{"type":"boolean"},"notEquals":{"type":"boolean"},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"boolean"}},"notIn":{"type":"array","items":{"type":"boolean"}}}},"ClimatizationTypeEnumFilter":{"type":"object","properties":{"equals":{"type":"string","enum":["DRY","FRIDGE","FROZEN"]},"notEquals":{"type":"string","enum":["DRY","FRIDGE","FROZEN"]},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"string","enum":["DRY","FRIDGE","FROZEN"]}},"notIn":{"type":"array","items":{"type":"string","enum":["DRY","FRIDGE","FROZEN"]}}}},"CourierParcelCriteria":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/LongFilter"},"terminalId":{"$ref":"#/components/schemas/LongFilter"},"terminalProvider":{"$ref":"#/components/schemas/TerminalProviderEnumFilter"},"status":{"$ref":"#/components/schemas/CourierParcelStatusEnumFilter"},"originalCourierLabel":{"$ref":"#/components/schemas/StringFilter"},"parcelPartnerLabel":{"$ref":"#/components/schemas/StringFilter"},"reservationDate":{"$ref":"#/components/schemas/InstantFilter"},"expirationDate":{"$ref":"#/components/schemas/InstantFilter"},"depositedDate":{"$ref":"#/components/schemas/InstantFilter"},"collectedDate":{"$ref":"#/components/schemas/InstantFilter"},"returnedDate":{"$ref":"#/components/schemas/InstantFilter"},"customerEmail":{"$ref":"#/components/schemas/StringFilter"},"customerPhone":{"$ref":"#/components/schemas/StringFilter"},"customerName":{"$ref":"#/components/schemas/StringFilter"},"parcelHeight":{"$ref":"#/components/schemas/IntegerFilter"},"parcelWidth":{"$ref":"#/components/schemas/IntegerFilter"},"parcelDepth":{"$ref":"#/components/schemas/IntegerFilter"},"parcelWeight":{"$ref":"#/components/schemas/IntegerFilter"},"climatizationType":{"$ref":"#/components/schemas/ClimatizationTypeEnumFilter"},"epv":{"$ref":"#/components/schemas/StringFilter"},"payed":{"$ref":"#/components/schemas/BooleanFilter"},"operationType":{"$ref":"#/components/schemas/ParcelOperationTypeEnumFilter"},"distinct":{"type":"boolean"}}},"CourierParcelStatusEnumFilter":{"type":"object","properties":{"equals":{"type":"string","enum":["ERROR","PENDING","CREATED","PROCESSED"]},"notEquals":{"type":"string","enum":["ERROR","PENDING","CREATED","PROCESSED"]},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"string","enum":["ERROR","PENDING","CREATED","PROCESSED"]}},"notIn":{"type":"array","items":{"type":"string","enum":["ERROR","PENDING","CREATED","PROCESSED"]}}}},"InstantFilter":{"type":"object","properties":{"equals":{"type":"string","format":"date-time"},"notEquals":{"type":"string","format":"date-time"},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"string","format":"date-time"}},"notIn":{"type":"array","items":{"type":"string","format":"date-time"}},"greaterThan":{"type":"string","format":"date-time"},"lessThan":{"type":"string","format":"date-time"},"greaterThanOrEqual":{"type":"string","format":"date-time"},"lessThanOrEqual":{"type":"string","format":"date-time"}}},"IntegerFilter":{"type":"object","properties":{"equals":{"type":"integer","format":"int32"},"notEquals":{"type":"integer","format":"int32"},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"integer","format":"int32"}},"notIn":{"type":"array","items":{"type":"integer","format":"int32"}},"greaterThan":{"type":"integer","format":"int32"},"lessThan":{"type":"integer","format":"int32"},"greaterThanOrEqual":{"type":"integer","format":"int32"},"lessThanOrEqual":{"type":"integer","format":"int32"}}},"LongFilter":{"type":"object","properties":{"equals":{"type":"integer","format":"int64"},"notEquals":{"type":"integer","format":"int64"},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"integer","format":"int64"}},"notIn":{"type":"array","items":{"type":"integer","format":"int64"}},"greaterThan":{"type":"integer","format":"int64"},"lessThan":{"type":"integer","format":"int64"},"greaterThanOrEqual":{"type":"integer","format":"int64"},"lessThanOrEqual":{"type":"integer","format":"int64"}}},"ParcelOperationTypeEnumFilter":{"type":"object","properties":{"equals":{"type":"string","enum":["DELIVERY","RETURN"]},"notEquals":{"type":"string","enum":["DELIVERY","RETURN"]},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"string","enum":["DELIVERY","RETURN"]}},"notIn":{"type":"array","items":{"type":"string","enum":["DELIVERY","RETURN"]}}}},"StringFilter":{"type":"object","properties":{"equals":{"type":"string"},"notEquals":{"type":"string"},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"string"}},"notIn":{"type":"array","items":{"type":"string"}},"contains":{"type":"string"},"doesNotContain":{"type":"string"}}},"TerminalProviderEnumFilter":{"type":"object","properties":{"equals":{"type":"string","enum":["PUDO","MICROIO","PTE"]},"notEquals":{"type":"string","enum":["PUDO","MICROIO","PTE"]},"specified":{"type":"boolean"},"in":{"type":"array","items":{"type":"string","enum":["PUDO","MICROIO","PTE"]}},"notIn":{"type":"array","items":{"type":"string","enum":["PUDO","MICROIO","PTE"]}}}},"CourierParcelDocumentCriteria":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/LongFilter"},"documentId":{"$ref":"#/components/schemas/StringFilter"},"parcelPartnerLabel":{"$ref":"#/components/schemas/StringFilter"},"courierParcelId":{"$ref":"#/components/schemas/LongFilter"},"distinct":{"type":"boolean"}}},"Pageable":{"type":"object","properties":{"page":{"minimum":0,"type":"integer","format":"int32"},"size":{"minimum":1,"type":"integer","format":"int32"},"sort":{"type":"array","items":{"type":"string"}}}},"CourierCustomerDto":{"type":"object","properties":{"epv":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"mobile":{"type":"string"},"userBalance":{"type":"number"},"defaultTerminalId":{"type":"string"},"defaultLockerPrice":{"type":"number"},"cached":{"type":"boolean"}}},"AdminUserDTO":{"required":["login"],"type":"object","properties":{"id":{"type":"string"},"login":{"maxLength":50,"minLength":1,"pattern":"^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$","type":"string"},"firstName":{"maxLength":50,"minLength":0,"type":"string"},"lastName":{"maxLength":50,"minLength":0,"type":"string"},"email":{"maxLength":254,"minLength":5,"type":"string"},"imageUrl":{"maxLength":256,"minLength":0,"type":"string"},"activated":{"type":"boolean"},"langKey":{"maxLength":10,"minLength":2,"type":"string"},"createdBy":{"type":"string"},"createdDate":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"},"lastModifiedDate":{"type":"string","format":"date-time"},"authorities":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"partner":{"type":"string"}}}},"securitySchemes":{"Bearer":{"type":"oauth2","description":"Authentication using your Client Id and Client Secret.\nThis authentication gets a token which has a 30 seconds duration.\nThis token needs another authentication every 30 seconds.","in":"header","flows":{"clientCredentials":{"authorizationUrl":"https://auth.brain24-prod.1c1f95b1c4134aa59e09.northeurope.aksapp.io/auth/realms/brain24/protocol/openid-connect/auth","tokenUrl":"https://auth.brain24-prod.1c1f95b1c4134aa59e09.northeurope.aksapp.io/auth/realms/brain24/protocol/openid-connect/token","refreshUrl":"https://auth.brain24-prod.1c1f95b1c4134aa59e09.northeurope.aksapp.io/auth/realms/brain24/protocol/openid-connect/token","scopes":{"openid":"","profile":"","email":""}}}}}}}