# Create Purchase Order With Delivery This allows for the creation of a purchase order and a corresponding delivery as well as assigning DDS references. Endpoint: POST /organisations/{orgId}/workflows/orders Version: v2_31 Security: ApiKeyAuth ## Path parameters: - `orgId` (string, required) The organisation identity ## Header parameters: - `contentType` (string, required) ## Request fields (application/json): - `order` (object, required) The details of the purchase order that you wish to create. - `order.number` (string, required) The purchase order number. - `order.status` (string, required) The current status of the purchase order. Enum: "OPEN", "APPROVED", "COMPLETED", "CANCELLED" - `order.orderDate` (string) The date and time of the purchase order. - `order.expectedDeliveryDate` (string) The date and time the delivery is expected to . - `order.supplier` (string) The URI of the supplier. - `order.buyer` (string) The URI of the buyer. - `order.deliverToLocation` (string) The URI of the deliver to location. - `order.lineItems` (array, required) List of items included in the purchase order. - `order.lineItems.lineItemId` (string) An optional line item id. - `order.lineItems.product` (string, required) The URI of the product for the line item included in the purchase order. - `order.lineItems.quantity` (number, required) The quantity of the product included in the purchase order. - `order.lineItems.note` (string) A note for each line item. - `order.lineItems.productVariant` (string) The uri of the product variant if applicable to this purchase order line item. - `order.lineItems.additionalQuantities` (array, required) Additiononal quantities can be specified directly on the item. - `order.lineItems.additionalQuantities.baseUnit` (string, required) The additional quantity base unit of measurement. - `order.lineItems.additionalQuantities.conversionQuantity` (number, required) The additional quantity calculated if the product has a conversion to that base unit. - `order.lineItems.additionalQuantities.overrideQuantity` (number, required) An override quantity provided irrespective of whether or not there is a conversion on the product. - `order.note` (string) A note to pass any information. - `order.id` (string) System assigned or user defined id field. - `delivery` (object, required) Specify delivery configuration if you wish to create a delivery - `delivery.generate` (boolean) Specify as true if you want to generate a delivery based on this PO. Defaults to false. - `delivery.id` (string) System assigned or user defined id field - if left out then the workflow will use the PO number. - `delivery.deliveryId` (string) User-assigned unique identifier for the delivery - if left out then the workflow will use the PO number. - `delivery.from` (string, required) The URI of the location from which the delivery is being delivered from. - `delivery.status` (string) The status of the delivery. If left out then it will default to PENDING. Enum: "DELIVERED", "PENDING", "IN_PROGRESS" - `delivery.sent` (string) The date and time of when the delivery has/will been sent. - `delivery.delivered` (string) The date and time of when the delivery has/will been delivered. - `dds` (object) If specified DDS Statements and/or Reference Numbers can be associated with the PO and (if specified) the created delivery. - `dds.existing` (object) Instruct the workflow on the use of existing DDSs with the delivery creation. This cannot be specified with 'create' - `dds.existing.resolve` (boolean) Resolve and use any DDS's that can be found (equivalent to the Resolve endpoint.) - `dds.existing.ignoreMissing` (boolean, required) If the dds is missing do not fault, carry on. This defaults to false. - `dds.existing.references` (array) Specify existing DDS References if you want to assign them to this delivery. - `dds.existing.references.referenceNumber` (string, required) DDS Statement Reference Number - `dds.existing.references.verificationNumber` (string, required) DDS Reference Verification Number - `dds.create` (object) Instruct the workflow on the generation of a new DDS. This cannot be specified with 'existing'. - `dds.create.internalReferenceNumber` (string, required) An internal reference number that can be user defined to help identify the DDS Reference. If this is the only identifier provided then it is a mandatory field. - `dds.create.statementData` (object, required) Specifies the statement data required to create a DDS based on the created Delivery. - `dds.create.statementData.operatorType` (string) Enum: "OPERATOR" - `dds.create.statementData.activityType` (string) The activity type. Enum: "IMPORT", "EXPORT", "DOMESTIC" - `dds.create.statementData.countryOfActivity` (string) This is the country where the economic activity is taking place, typically (but not always) this is the operator's place of activity. Enum: "AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE", "XI" - `dds.create.statementData.borderCrossCountry` (string) This is required for IMPORT or EXPORT activities. Enum: "AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE", "XI" - `dds.create.statementData.comment` (string) - `dds.create.statementData.geoLocationConfidential` (boolean) IF this is set to true then downstream consumers of your DDS Reference will not have access to the Geo Location information. - `dds.create.statementData.associatedStatements` (array) - `dds.create.statementData.associatedStatements.referenceNumber` (string) Associated Due Diligence Reference Number (DDRN) - `dds.create.statementData.associatedStatements.verificationNumber` (string) Associated Due Diligence Verification Number (DDVN) - `dds.product` (object) If specified the workflow will assign Predictive Product DDS References to the delivery. - `dds.product.filterBySupplier` (boolean) If set to true then the supplier must be identified as part of the line items. - `dds.product.ignoreMissing` (boolean, required) If the Product dds is missing do not fault, carry on. This defaults to false. ## Response 201 fields (application/json): - `order` (object, required) This is the Purchase Order that has been created by the workflow. - `order.number` (string, required) The purchase order number. - `order.status` (string, required) The current status of the purchase order. Enum: "OPEN", "APPROVED", "COMPLETED", "CANCELLED" - `order.orderDate` (string) The date and time of the purchase order. - `order.expectedDeliveryDate` (string) The date and time the delivery is expected to . - `order.supplier` (string) The URI of the supplier. - `order.buyer` (string) The URI of the buyer. - `order.deliverToLocation` (string) The URI of the deliver to location. - `order.lineItems` (array, required) List of items included in the purchase order. - `order.lineItems.lineItemId` (string) An optional line item id. - `order.lineItems.product` (string, required) The URI of the product for the line item included in the purchase order. - `order.lineItems.quantity` (number, required) The quantity of the product included in the purchase order. - `order.lineItems.note` (string) A note for each line item. - `order.lineItems.productVariant` (string) The uri of the product variant if applicable to this purchase order line item. - `order.lineItems.additionalQuantities` (array, required) Additiononal quantities can be specified directly on the item. - `order.lineItems.additionalQuantities.baseUnit` (string, required) The additional quantity base unit of measurement. - `order.lineItems.additionalQuantities.conversionQuantity` (number, required) The additional quantity calculated if the product has a conversion to that base unit. - `order.lineItems.additionalQuantities.overrideQuantity` (number, required) An override quantity provided irrespective of whether or not there is a conversion on the product. - `order.note` (string) A note to pass any information. - `order.id` (string) System assigned or user defined id field. - `order.createdBy` (string) User who created the record. - `order.createdTime` (string) Date & Time that the record was created. - `order.updatedBy` (string) Last updated by user. - `order.updatedTime` (string) Date & Time that the record was last updated. - `delivery` (object) If specified, this is the delivery that was created by the workflow. - `delivery.deliveryId` (string, required) User-assigned unique identifier for the delivery. - `delivery.from` (string, required) The URI of the location from which the delivery is being delivered from. - `delivery.to` (string, required) The URI of the location to which the delivery is being delivered to. - `delivery.status` (string, required) The current status of the delivery. Enum: "DELIVERED", "PENDING", "IN_PROGRESS" - `delivery.sent` (string) The date and time of when the delivery has been sent. - `delivery.delivered` (string) The date and time of when the delivery has been delivered. - `delivery.items` (array) List of items included in the delivery. - `delivery.items.item` (string, required) The URI of the item included in the delivery. - `delivery.items.quantity` (number, required) The quantity of the item included in the delivery. - `delivery.agents` (array) List of agent organisation URIs that are associated with the delivery. - `delivery.purchaseOrderNumbers` (array) Associated Purchase Orders - `dds` (array) If the workflow has been called with resolve DDS configuration then it will return any DDSs that it has been able to resolve. - `dds.record` (string, required) This is the URI of the the record - i.e the Delivery, Purchase Order or Item - `dds.resolved` (array) The records and the DDS References that were found. - `dds.resolved.record` (string, required) This is the URI of the the record that the DDS was found attached to - i.e the Delivery, Purchase Order or Item - `dds.resolved.references` (array) The found Due Diligence Statement References. - `dds.resolved.references.internalReferenceNumber` (string) An internal reference number provided by a user to help identify the DDS Reference. - `dds.resolved.references.referenceNumber` (string) The Reference Number as provided by TracesNT. - `dds.resolved.references.verificationNumber` (string) The Verification Number provided by Traces NT. - `dds.unresolved` (array) The records where resolution was not possible. - `dds.unresolved.reason` (string) The reason why DDS Reference was not resolved for the given item. Enum: "DDS_DOES_NOT_EXIST", "SUBMITTED_OR_PENDING_DDS_EXISTS" ## Response 400 fields ## Response 401 fields ## Response 403 fields ## Response 429 fields ## Response 500 fields