# Create a new customer order.
**POST /customer-orders**
Sample request:
POST /customer-orders
You have to call this service with following conditions:
1. Content-Type: multipart/form-data
2. 1st part: customer order data. The part name is "order"
3. 2nd part: List of attached documents. The part name is "files"
## Servers
- https://soget-api-integration.azure-api.net/customer-orders/v1: https://soget-api-integration.azure-api.net/customer-orders/v1 ()
## Authentication methods
- Bearer token & Api key
## Parameters
### Body: multipart/form-data (object)
- **Order** (object)
Model to be sent to server when you want to create a new customer order.
- **Files** (array[string(binary)])
IFormFile form multipart/form-data
## Responses
### 200
Identifiers of created customer order and all the associated segments.
#### Body: application/json (object)
- **elementaryOrders** (array[object] | null)
List of elementary orders (used for multi-container case).
- **segments** (array[object] | null)
List of segments (transport segment managed by the carrier).
- **id** (string | null)
Order identifier that is composed of a prefix of 3 characters and 10 digits.
The following prefix means :
- CDE : global customer order
- ELM : elementary order (used for the multi-container case)
- SEG : transport segment (managed by the carrier)
- **transportOrderNumber** (string | null)
Reference
- **type** (string)
Order types (note that the value handled by this service is only Master):
- Master: Global order.
- Elementary: Order linked to one container.
- SegmentTerminalEntrepot: The segment of Import order from the handling place to the warehouse.
- SegmentEntrepotDepot: The segment of Import order from the warehouse to the empty return location.
- SegmentDepotEntrepot: The segment of Export order from the empty release location to the warehouse.
- SegmentEntrepotTerminal: The segment of Export order from the warehouse to the handling place.
- SegmentTransfer: The segment of Transfer order. There are 3 cases:
- Transfer of a full export container from a warehouse to a loading terminal;
- Transfer of a full import container from an unloading terminal to a stripping or inspection location;
- Transfer of a container from an unloading terminal to a loading terminal.
### 400
Failed to create a new customer order.
#### Body: application/json (object)
- **timestamp** (string(date-time))
Time information.
ISO 8601 Extended Format
- **code** (string)
Error that could be returned by the system.- ACTOR_NOT_FOUND: Actor indicated in order doesn't exist in MouvONE.
- ALREADY_JOINED_GROUP: User has already joined a group
- CANNOT_CANCEL_NOT_MASTER_ORDER: You can only cancel an order if type of the order is Master.
It's not allowed to cancel an Elementary or Segment order.
- CANNOT_CANCEL_ORDER_WITH_ASSOCIATED_CONTAINER: Order cannot be cancelled because the container has been associated with a booking.
- CANNOT_CHANGE_NUMBER_OF_CONTAINERS: You can't change the number of containers when updating an order.
- CANNOT_UPDATE_VALID_ORDER_TO_DRAFT: Cannot update order status from VALID to DRAFT.
- CARRIER_EMAIL_REQUIRED: If carrier in the given order is unknown by GEDMOUV, then the carrier email is required.
- CONFLICT: This error can happens if you try to update an order but it has been updated by another user so your version has been out-dated.
You have to update your local version with the latest one before you can make any changes.
- CONTRACTOR_UNAUTHORIZED_BY_GEDMOUV: A contractor unknown by GEDMOUV is not allowed to create new transport order.
- CUSTOMER_ORDER_NOT_FOUND: Order doesn't exist in MouvONE.
- CUSTOMS_FLAG_NOT_BE_MODIFIED: You can't modify customs flag of an order.
- EVENT_LOCATION_FIELDS_REQUIRED: The fields of event location is required.
- EVENT_START_DATE_REQUIRED: Start date of event is required.
- EXISTS_ORDER_WITH_HANDLING_UNIT_SPI: Exists order with the given handling unit spi.
- HANDLING_UNIT_REFERENCE_INVALID: Reference of handling unit is invalid.
- LIMIT_NONPOSITIVE: The LIMIT parameter must be greater than 0 when searching order.
- NOT_SUPPORTED_ORDER_TYPE: The type of order is not supported for requested action.
- OFFSET_NEGATIVE: The OFFSET parameter cannot be negative when searching order.
- ORDER_ALREADY_CANCELED: The order has already been cancelled.
- ORDER_DUPLICATED: You cannot create order if an order with the same characteristics already exists.
- ORGANIZATION_ACTOR_CODE_INVALID: An organization must be verified by a SOGET administrator before its members can create and manage orders. Let's contact SOGET if you encounter this error.
- ORGANIZATION_NOT_FOUND: A user must belong to an organization to be able to create and manage orders.
- R0005: Cannot update information of containers and events.
- R0006: Cannot update order if it is in certain status.
- R0007: Cannot update container references.
- R0008: Cannot cancel the order due to the status is Submitted or InProgress.
- R0009: Cannot cancel the order that at least one of its segment is delivered.
- SEARCH_DATE_ERROR: Date parameters is invalid when searching order.
- UNKNOWN_LOCATION: Location is unknown by MouvONE.
- USER_ID_INVALID: User ID is invalid.
- WRONG_EVENT_DATE_ORDER: Dates of events must be in chronological order.
For Import order: LadingImport -> DeliveryImport -> EmptyReleaseImport -> EmptyReturnImport.
For Export order: EmptyReleaseExport -> PositioningExport -> LadingExport -> DeliveryExport.
- WRONG_FORMAT: Order identifier is in wrong format.
- **message** (string | null)
Error message.
[Powered by Bump.sh](https://bump.sh)