initiateReturn
post
/ccagent/v1/returnRequests
Initiate Return. It creates the return request based on the operation value. Operation value can be any of initiateReturn/calculateRefundAmounts/createReturnRequest. Gets list of items from an order for which return request can be created with operation set as 'initiateReturn'.Additonally takes x-ccsite header. If the site information is not provided by default it takes the order site. Optionally takes X-CCOrganization header which is a JSON field with organization ID as value.
Request
Supported Media Types
- application/json
Header Parameters
-
X-CCOrganization(optional): string
The organization Id to which the order belongs
-
x-ccsite(optional): string
the site id on which the orders is laced
Root Schema : initiateReturn_request
Type:
Show Source
object
-
orderId:
string
Order ID for which return has to be initiated.
Example:
{
"orderId":"o10400"
}
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : initiateReturn_response
Type:
Show Source
object
-
additionalProperties(optional):
object additionalProperties
Additional properties if any returned by the webhook.
-
authorizationNumber(optional):
string
RMA number of Return Request if available otherwise return request id
-
orderInfo(optional):
object orderInfo
Order Information.
-
profileInfo(optional):
object profileInfo
Profile Information for the order.
-
quoteInfo(optional):
object quoteInfo
The quote information of the order.
-
returnItems(optional):
array returnItems
List of returnable Items.
-
returnLabel(optional):
string
return label of the return request
-
trackingNumber(optional):
array trackingNumber
Tracking Number of the return request
Nested Schema : additionalProperties
Type:
object
Additional properties if any returned by the webhook.
Nested Schema : orderInfo
Type:
object
Order Information.
Show Source
-
creationDate(optional):
string
Date on which the Order was created.
-
orderId(optional):
string
Commerce id for this order.
-
priceInfo(optional):
object priceInfo
Price information of the order.
-
priceListGroup(optional):
object priceListGroup
PriceList group of the order.
-
siteId(optional):
string
Site Id on which the Order was placed.
-
submittedDate(optional):
string
Date on which the Order was submitted.
Nested Schema : profileInfo
Type:
object
Profile Information for the order.
Show Source
-
email(optional):
string
Email address of the profile
-
firstName(optional):
string
First name of profile.
-
lastName(optional):
string
Last name of profile.
-
middleName(optional):
string
Middle name of profile.
-
organization(optional):
object organization
The Organization associated with the B2B customer profile.
Nested Schema : quoteInfo
Type:
object
The quote information of the order.
Show Source
-
errorInfo(optional):
array errorInfo
the array of errors, if any
-
expirationDate(optional):
string
the expiration date of the quoted order, if any
-
externalId(optional):
string
the external id for the quote
-
notes(optional):
array notes
the notes (history) for the order
-
providerNote(optional):
string
the provider note for the quoted order
-
quoteDate(optional):
number
the date the order was quoted in milliseconds
-
rejectionDate(optional):
string
the rejection date for an order whose quote has been rejected by user
-
rejectionNote(optional):
string
the rejection note for an order whose quote has been rejected by user
-
requestDate(optional):
string
the date when the quote was requested in ISO format
Nested Schema : priceInfo
Type:
object
Price information of the order.
Show Source
-
amount(optional):
number
The raw number that represents the price.
-
currencyCode(optional):
string
Indicates the currency of the price. For example, USD indicates that the price is in US dollars.
-
isTaxIncluded(optional):
boolean
Indicates if tax is included in item price
-
orderDiscountAmount(optional):
number
Total Order Discount Ampunt
-
shipping(optional):
number
The shipping cost of the order.
-
subTotal(optional):
number
The subtotal of the order before applying order-level promotions.
-
tax(optional):
number
The tax on the order.
-
total(optional):
number
The current working total, including all promotions, tax, and billing costs.
-
totalWithoutTax(optional):
number
The total cost without Tax.
Nested Schema : priceListGroup
Type:
object
PriceList group of the order.
Show Source
-
active(optional):
boolean
Active status of pricelist group.
-
currency(optional):
object currency
Currency of the PriceList group.
-
deleted(optional):
boolean
Pricelist group deleted status.
-
displayName(optional):
string
Display Name.
-
id(optional):
string
Id.
-
listPriceList(optional):
object listPriceList
Price List for list prices
-
locale(optional):
string
Locale.
-
repositoryId(optional):
string
Repository Id.
-
salePriceList(optional):
object salePriceList
Price List for sale prices
-
shippingSurchargePriceList(optional):
object shippingSurchargePriceList
Price List for shipping surcharge prices
Nested Schema : currency
Type:
object
Currency of the PriceList group.
Show Source
-
currencyCode(optional):
string
Currency Code.
-
displayName(optional):
string
Display Name.
-
fractionalDigits(optional):
integer
Fractional Digits.
-
numericCode(optional):
string
Numeric Code.
-
repositoryId(optional):
string
Repository Id.
-
symbol(optional):
string
currency Symbol.
Nested Schema : listPriceList
Type:
object
Price List for list prices
Show Source
-
repositoryId(optional):
string
Repository ID of the list prices
Nested Schema : salePriceList
Type:
object
Price List for sale prices
Show Source
-
repositoryId(optional):
string
Repository ID of the sale prices
Nested Schema : shippingSurchargePriceList
Type:
object
Price List for shipping surcharge prices
Show Source
-
repositoryId(optional):
string
Repository ID of the shipping surcharge prices
Nested Schema : organization
Type:
object
The Organization associated with the B2B customer profile.
Show Source
-
id(optional):
string
The id of the organization.
-
name(optional):
string
The name of of the organization.
Nested Schema : items
Type:
Show Source
object
-
profileId(optional):
string
the profile id of the user
-
profileType(optional):
string
the profile type of the user that requested the quote
-
providerNote(optional):
string
the provider note for the quoted order
-
quoteDate(optional):
number
the date the order was quoted in milliseconds
-
rejectionDate(optional):
number
the rejection date for an order whose quote has been rejected by user
-
rejectionNote(optional):
string
the rejection note for an order whose quote has been rejected by user
-
requestDate(optional):
number
the date when the quote was requested in ISO format
-
requesterNote(optional):
string
the requester note
Nested Schema : items
Type:
Show Source
object
-
actionCode(optional):
string
The action code that has been set on the item by the configurator system.
-
activationDate(optional):
string
The activation date in ISO format.
-
additionalProperties(optional):
object additionalProperties
Additional Properties if any returned by webhook.
-
asset(optional):
boolean
The flag that determines if the current item is an asset or not.
-
assetKey(optional):
string
The assetKey is only assigned when the root item has been set as assetable in the catalog and has been configured.
-
billingAccountId(optional):
string
The billing account ID associated to the current item.
-
billingProfileId(optional):
string
The billing profile ID associated to the current item.
-
catRefId(optional):
string
Catalog Reference Id
-
childItems(optional):
array childItems
Returned Item child items
-
comments(optional):
string
Comments at returnItem level
-
commerceItemId(optional):
string
Commerce Id of the returned item
-
configuratorId(optional):
string
Configurator Id of the returned item
-
customerAccountId(optional):
string
The customer account ID associated to the current item.
-
deactivationDate(optional):
string
The deactivation date in ISO format.
-
displayName(optional):
string
Display Name of the Product
-
dynamicProperties(optional):
array dynamicProperties
Array of custom properties at order line item level.
-
externalData(optional):
array externalData
External data to be associated with a commerce item, provided by a configurator system.
-
nonreturnable(optional):
boolean
Indicates whether the item is returnable or not
-
nonReturnableReason(optional):
string
Non returnable reason if item is non returnable
-
parentAssetKey(optional):
string
The parentAssetKey is only assigned when the root item has been set as assetable in the catalog and has been configured.
-
price(optional):
number
Total price of items
-
productId(optional):
string
Id of the Product
-
quantityAvailableForReturn(optional):
number
Quantity Available
-
quantityReturned(optional):
number
Quantity Returned
-
quantityShipped(optional):
number
Quantity Shipped
-
rootAssetKey(optional):
string
The rootAssetKey is only assigned when the root item has been set as assetable in the catalog and has been configured.
-
serviceAccountId(optional):
string
The service account ID associated to the current item.
-
serviceId(optional):
string
The service ID associated to the current item.
-
shippingGroupId(optional):
string
Shipping group Id of the returned item
-
skuOptionInfo(optional):
array skuOptionInfo
Product Variant Information.
-
skuProperties(optional):
array skuProperties
Sku properties Information
-
transactionDate(optional):
string
ISO formatted Date on which the service action should be triggered.
-
unitPrice(optional):
number
Unit price of the item
Nested Schema : additionalProperties
Type:
object
Additional Properties if any returned by webhook.
Nested Schema : dynamicProperties
Type:
array
Array of custom properties at order line item level.
Show Source
Nested Schema : externalData
Type:
array
External data to be associated with a commerce item, provided by a configurator system.
Show Source
Nested Schema : items
Type:
Show Source
object
-
actionCode(optional):
string
The action code that has been set on the item by the configurator system.
-
activationDate(optional):
string
The activation date in ISO format.
-
asset(optional):
boolean
The flag that determines if the current item is an asset or not.
-
assetKey(optional):
string
The assetKey is only assigned when the root item has been set as assetable in the catalog and has been configured.
-
billingAccountId(optional):
string
The billing account ID associated to the current item.
-
billingProfileId(optional):
string
The billing profile ID associated to the current item.
-
catRefId(optional):
string
Catalog Reference Id of the child Item
-
customerAccountId(optional):
string
The customer account ID associated to the current item.
-
deactivationDate(optional):
string
The deactivation date in ISO format.
-
displayName(optional):
string
Product display name of the sub sku commerce item
-
externalData(optional):
array externalData
External data to be associated with a commerce item, provided by a configurator system.
-
parentAssetKey(optional):
string
The parentAssetKey is only assigned when the root item has been set as assetable in the catalog and has been configured.
-
productId(optional):
string
Product Id of teh
-
quantity(optional):
number
quantity of the child Item
-
rootAssetKey(optional):
string
The rootAssetKey is only assigned when the root item has been set as assetable in the catalog and has been configured.
-
route(optional):
string
Product path
-
selectedOptions(optional):
array selectedOptions
Child Product Variant Information.
-
serviceAccountId(optional):
string
The service account ID associated to the current item.
-
serviceId(optional):
string
The service ID associated to the current item.
-
transactionDate(optional):
string
ISO formatted Date on which the service action should be triggered.
Nested Schema : externalData
Type:
array
External data to be associated with a commerce item, provided by a configurator system.
Show Source
Nested Schema : items
Type:
Show Source
object
-
actionCode(optional):
string
The action code that has been set on the externalData item by the configurator system.
-
name(optional):
string
The name to be associated with the externalData item.
-
values(optional):
object values
The array of values associated with an externalData item.
Nested Schema : values
Type:
object
The array of values associated with an externalData item.
Show Source
-
dynamic_property_key(optional):
string
This property's name and value will be retrieved from a configurator system, so will be dynamically set.
Nested Schema : items
Type:
Show Source
object
-
optionName(optional):
string
Name of the Dynamic attribute.
-
optionValue(optional):
string
Value of the Dynamic attribute.
Nested Schema : items
Type:
Show Source
object
-
id(optional):
string
The ID of the dynamic property.
-
label(optional):
string
The label of the dynamic property.
-
value(optional):
string
The value of the dynamic property.
Nested Schema : items
Type:
Show Source
object
-
actionCode(optional):
string
The action code that has been set on the externalData item by the configurator system.
-
name(optional):
string
The name to be associated with the externalData item.
-
values(optional):
object values
The array of values associated with an externalData item.
Nested Schema : values
Type:
object
The array of values associated with an externalData item.
Show Source
-
dynamic_property_key(optional):
string
This property's name and value will be retrieved from a configurator system, so will be dynamically set.
Nested Schema : items
Type:
Show Source
object
-
optionName(optional):
string
Name of the Dynamic attribute
-
optionValue(optional):
string
Value of the Dynamic attribute
Nested Schema : items
Type:
Show Source
object
-
id(optional):
string
ID of the Dynamic SKU Property.
-
name(optional):
string
Name of the Dynamic SKU Property.
-
propertyType(optional):
string
Type that indicates whether it is a base or a custom SKU property,
-
value(optional):
string
Value of the Dynamic SKU Property.
Example Response (application/json)
{
"returnLabel":"return label 1",
"returnItems":[
{
"quantityReturned":0,
"unitPrice":9.99,
"shippingGroup":{
"firstName":null,
"lastName":null,
"emailAddress":null,
"phoneNumber":null,
"locationId":"testLoc2",
"shippingMethod":{
"shippingMethod":"inStorePickupShippingGroup",
"shippingMethodDescription":"inStorePickupShippingGroup"
},
"shippingGroupId":"sg40412",
"middleName":null,
"store":{
"country":"USA",
"hours":"Mon - Sat 10AM - 7PM Sun 11AM - 6 PM",
"address3":null,
"address2":"15th Floor",
"city":"San Francisco",
"address1":"475 Sansome Street",
"postalCode":"94111",
"county":null,
"stateAddress":"CA",
"phoneNumber":"(617) 386-1200",
"locationId":"testLoc2",
"name":"Cloud Store - SanFrancisco",
"faxNumber":"(617) 386-1200",
"email":"store113@example.com"
},
"type":"inStorePickupShippingGroup"
},
"comments":null,
"productId":"prod10035",
"displayName":"Fifa 2010",
"dynamicProperties":[
{
"id":"ReferralCode",
"label":"ReferralCode",
"value":null
},
{
"id":"OfferEndsDate",
"label":"OfferEndsDate",
"value":"2020-07-02T03:42:42.962Z"
},
{
"id":"Discount",
"label":"Discount",
"value":10
},
{
"id":"GiftWrapping",
"label":"Gift Wrapping",
"value":false
},
{
"id":"name",
"label":"Name on product(Mug)",
"value":"My name"
}
],
"shippingGroupId":"sg80417",
"externalData":[
],
"childItems":[
{
"serviceAccountId":"serviceAcc-123",
"deactivationDate":"2018-06-27T12:59:59Z",
"quantity":2,
"productId":"prod10040",
"displayName":"Super Smash Brothers Brawl",
"externalData":[
],
"parentAssetKey":"12345",
"billingProfileId":"billingProfile-123",
"billingAccountId":"billingAcc-123",
"childItems":[
{
"serviceAccountId":"serviceAcc-123",
"deactivationDate":"2018-06-27T12:59:59Z",
"quantity":1,
"productId":"prod10039",
"displayName":"Wii Music I ",
"externalData":[
],
"parentAssetKey":"23456",
"billingProfileId":"billingProfile-123",
"billingAccountId":"billingAcc-123",
"rootAssetKey":"12345",
"transactionDate":"2018-06-27T12:59:59Z",
"catRefId":"sku10049",
"assetKey":"93659",
"route":"product/prod10039",
"customerAccountId":"customerAcc-123",
"selectedOptions":[
],
"actionCode":"Add",
"activationDate":"2017-06-27T15:30:00Z",
"serviceId":"service-123",
"asset":false
}
],
"rootAssetKey":"12345",
"transactionDate":"2018-06-27T12:59:59Z",
"catRefId":"sku10041",
"assetKey":"23456",
"route":"product/prod10040",
"customerAccountId":"customerAcc-123",
"selectedOptions":[
],
"actionCode":"Add",
"activationDate":"2017-06-27T15:30:00Z",
"serviceId":"service-123",
"asset":false
},
{
"serviceAccountId":"serviceAcc-123",
"deactivationDate":"2018-06-27T12:59:59Z",
"quantity":1,
"productId":"prod10038",
"displayName":"Wii Music",
"externalData":[
],
"parentAssetKey":"12345",
"billingProfileId":"billingProfile-123",
"billingAccountId":"billingAcc-123",
"rootAssetKey":"12345",
"transactionDate":"2018-06-27T12:59:59Z",
"catRefId":"sku10042",
"assetKey":"64634",
"route":"product/prod10038",
"customerAccountId":"customerAcc-123",
"selectedOptions":[
],
"actionCode":"Add",
"activationDate":"2017-06-27T15:30:00Z",
"serviceId":"service-123",
"asset":false
}
],
"catRefId":"sku10037",
"configuratorId":"12345677",
"skuOptionInfo":[
],
"quantityAvailableForReturn":3,
"commerceItemId":"ci9000467",
"skuProperties":[
{
"propertyType":"sku-base",
"name":"Name",
"id":"displayName",
"value":null
},
{
"propertyType":"sku-base",
"name":"Id",
"id":"id",
"value":"camerasku_1_1"
},
{
"propertyType":"sku-custom",
"name":"dynamicskuprop1",
"id":"dynamicskuprop1",
"value":"dynamicskuprop1"
}
],
"quantityShipped":3,
"price":29.97,
"actionCode":"Add",
"additionalProperties":{
"description":"Additional properties of the return item",
"type":"object",
"properties":{
"property2":{
"description":"Additional Property 2",
"type":"string"
},
"property1":{
"description":"Additional Property 1",
"type":"string"
}
}
}
}
],
"profileInfo":{
"lastName":"Anderson",
"firstName":"Kim",
"organization":{
"name":"Oracle India Pvt Ltd",
"id":"oracle"
},
"middleName":null,
"email":"kim@example.com"
},
"orderInfo":{
"originOfOrder":"contactCenter",
"priceInfo":{
"total":58.4,
"amount":29.97,
"shipping":25,
"isTaxIncluded":false,
"tax":3.43,
"subTotal":29.97,
"orderDiscountAmount":0,
"currencyCode":"USD",
"totalWithoutTax":127.97
},
"recurringChargePriceInfo":{
"amount":20,
"total":20,
"shipping":0,
"subTotalByFrequency":[
{
"amount":20,
"frequency":"Monthly"
}
],
"taxByFrequency":[
{
"amount":0,
"frequency":"Monthly"
}
],
"tax":0,
"subTotal":20,
"currencyCode":"USD",
"totalWithoutTax":20
},
"orderId":"o10400",
"priceListGroup":{
"deleted":false,
"displayName":"UsDollar",
"repositoryId":"UsDollar",
"listPriceList":{
"repositoryId":"listPrices"
},
"active":true,
"salePriceList":{
"repositoryId":"salePrices"
},
"currency":{
"symbol":"$",
"displayName":"US Dollar",
"repositoryId":"hi_US",
"fractionalDigits":2,
"currencyCode":"USD",
"numericCode":"356"
},
"id":"UsDollar",
"locale":"hi_US",
"shippingSurchargePriceList":{
"repositoryId":"shippingSurchargePrices"
}
},
"siteId":"siteUS",
"creationDate":"2014-05-20 16:06:44.0",
"submittedDate":"2014-05-20 16:07:44.0"
},
"links":[
{
"rel":"self",
"href":"http://localhost:9080/ccagentui/v1/returnRequests"
}
],
"additionalProperties":{
"property2":"tag",
"property":"display"
},
"quoteInfo":{
"providerNote":null,
"notes":[
{
"providerDate":"2016-11-25T13:33:48.000Z",
"providerNote":"The quote is approved as per the request",
"profileType":null,
"profileId":"se-570031"
},
{
"profileType":null,
"profileId":"se-570031",
"requestDate":"2016-10-25T13:33:48.000Z",
"requesterNote":"provide 10 percent off on the total quantity"
}
],
"rejectionDate":null,
"requestDate":"2016-10-25T13:33:48.000Z",
"errorInfo":null,
"externalID":null,
"rejectionNote":null,
"quoteDate":"2016-10-25T13:35:32.000Z",
"expirationDate":"2026-04-28T18:53:48.000Z"
},
"trackingNumber":[
"http://localhost:9080/trackingNumber",
"http://localhost:9080/trackingNumber2"
]
}
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.|
|200196|Item {0} is a part of configuration and therefore cannot be returned separately. Please return the whole configuration package.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code