createReturnRequest
post
/ccstore/v1/returnRequests
Creates return request and returns the appropriate ID. Persists in DB. Optionally takes the x-ccasset-language headers to get translated content in another language. Also, additionally takes X-CCOrganization and x-ccsite headers.
Request
Supported Media Types
- application/json
Body Parameter
Root Schema : createReturnRequest_request
{
"returnItems":[
{
"quantityToReturn":1,
"commerceItemId":"ci8000005",
"productId":"prod10003",
"returnReason":"didNotLike",
"shippingGroupId":"sg80003",
"catRefId":"sku30019"
}
],
"orderId":"o80003"
}
- orderId
-
Type:
string
Required:true
Order ID for which return request has to be created. - returnItems
-
Type:
array
returnItemsRequired:true
Additional Properties Allowed:List of returnable Items.
Nested Schema : returnItems
Nested Schema : items
Type:
object
- catRefId
-
Type:
string
The SKU ID - commerceItemId
-
Type:
string
ID of the commerce item. - productId
-
Type:
string
The Product ID - quantityToReturn
-
Type:
integer
Quantity to be Returned - returnReason
-
Type:
string
Reason to return an Item - shippingGroupId
-
Type:
string
Shipping group ID of the returned item
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createReturnRequest_response
- result
-
Type:
string
The string specifying success in creation of return request. - returnRequestId
-
Type:
string
The Return Request ID.
Example application/json
{
"result":"success",
"returnRequestId":"700002",
"links":[
{
"rel":"self",
"href":"http://example.com/ccstoreui/v1/returnRequests"
}
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|100094|Organization passed in the header is currently inactive|
|100095|The order or return request does not belong to the current organization of the shopper profile|
|100096|The organization associated to the order or return request was deleted / does not exist|
|100097|The organization associated to the order or return request is currently inactive|
|100098|Current operation is being performed in an organization context and the shopper profile is not associated to any organization|
|100099|Current operation is being performed in an organization context and the order or return request does not belong to any organization|
|200114|Order is not allowed for return.|
|30015|SiteId passed in x-ccsite header is currently inactive|
|30014|SiteId passed in x-ccsite header is invalid or the site was deleted|
|30020|The Site to which the order belongs was deleted|
|30021|The Site to which the order belongs is currently inactive|
|100101|The shopper profile does not belong to organization passed in the header|
|30019|SiteId passed in x-ccsite header is not related to the order being worked upon|
|210105|Specified order does not exist.|
Body
Root Schema : errorModel
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Request:
{ "returnItems": [{ "quantityToReturn": 1, "commerceItemId": "ci8000005", "productId": "prod10003", "returnReason": "didNotLike", "shippingGroupId": "sg80003", "catRefId": "sku30019" }], "orderId": "o80003" }
Sample Response Payload returned by endpoint:
{ "result": "success", "returnRequestId": "700002", "links": [{ "rel": "self", "href": "http://example.com/ccstoreui/v1/returnRequests" }] }