Related Documents
Document Properties
Kbid25A170
Last Modified23-Jun-2020
Added to KB20-Sep-2013
Public AccessEveryone
StatusOnline
Doc TypeReferences

REST API - Create new order (valid until 7.4 CI)

URI

/orders

Http Method

POST

Short Description

Creates/submits an order

Query Parameters

none

Example Requests

/orders

HTTP Status Codes

200 OK
400 Bad Request

Possible values for header value "error-key":

    • basket.not_found.error
    • basket.id_required.error
    • shopping_cart.create_order.error
    • shopping_cart.giftcard.error
    • shopping_cart.inventory.error
    • shopping_cart.not_covered.error
    • shopping_cart.payment_redirect.error
    • shopping_cart.tax.calculation.error
    • shopping_cart.terms_and_conditions.error

403 Forbidden
404 Not found

Description

The request creates / submits a new order based an the basket given by basket id.

Cartridge

app_sf_rest

Application

B2C Web Shop, SMB Web Shop

Product Version

7.4

Product To Version

7.4.6

Status

final

JSON

Request Data Format

application/json

Request related java object

com.intershop.sellside.rest.common.capi.resource.OrderListResource
com.intershop.sellside.rest.common.capi.resourceobject.OrderDescriptionRO

Request Example

{
    "basketID": "mwnAqMgoQWUAAAE8irJXwIE5", 
    "acceptTermsAndConditions": "true"
}

If Payment method is Credit Credit and a Credit Card Security Code has to be used this code has to be added here:

{
    "basketID": "mwnAqMgoQWUAAAE8irJXwIE5", 
    "acceptTermsAndConditions": "true",
    "creditCardSecurityCode" : "123"
}

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.common.capi.resource.OrderListResource
com.intershop.sellside.rest.common.capi.resourceobject.OrderDescriptionRO
com.intershop.component.rest.capi.resourceobject.LinkRO

Response Example

Successful order

{
	"name": "ConfirmedOrder",
	"type": "Link",
	"uri": "PrimeTech-PrimeTechSpecials-Site/-/orders/mwnAqMgoQWUAAAE8irJXwIE5"
}

Create Order failed

{
	"type": "OrderValidation",
	"errorMessage": "An order with this basket was already created.",
	"validOrder": false,
	"basketLink": {
		"title": "BasketLink",
		"type": "Link",
		"uri": "PrimeTech-PrimeTechSpecials-Site/-/baskets/mwnAqMgoQWUAAAE8irJXwIE5"
	}
}

XML

XML Request Data Format

text/xml

XML Request Java Objects

com.intershop.sellside.rest.common.capi.resource.OrderListResource
com.intershop.sellside.rest.common.capi.resourceobject.OrderDescriptionRO

XML Request Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OrderDescription>
	<acceptTermsAndConditions>true</acceptTermsAndConditions>
	<basketID>mwnAqMgoQWUAAAE8irJXwIE5</basketID>
</OrderDescription>
  

If Payment method is Credit Credit and a Credit Card Security Code has to be used this code has to be added here:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OrderDescription>
	<acceptTermsAndConditions>true</acceptTermsAndConditions>
	<basketID>mwnAqMgoQWUAAAE8irJXwIE5</basketID>
	<creditCardSecurityCode>123</creditCardSecurityCode>
</OrderDescription>
 
  

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.common.capi.resource.OrderListResource 
com.intershop.sellside.rest.common.capi.resourceobject.OrderDescriptionRO
com.intershop.component.rest.capi.resourceobject.LinkRO

XML Response Example

Successful order

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link name="ConfirmedOrder" type="Link">
    <uri>PrimeTech-PrimeTechSpecials-Site/-/orders/mwnAqMgoQWUAAAE8irJXwIE5</uri>
</Link>

Create Order failed

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OrderValidation type="OrderValidation">
    <basketLink name="BasketLink" type="Link">
       <title>BasketLink</title>
       <uri>PrimeTech-PrimeTechSpecials-Site/-/baskets/mwnAqMgoQWUAAAE8irJXwIE5</uri>
    </basketLink>
    <errorMessage>An order with this basket was already created.</errorMessage>
    <validOrder>false</validOrder>
</OrderValidation>

Reference - WebShop REST APIs

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Tickets