calculateRefund
post
/ccstore/v1/returnRequests/calculateRefund
Calculates Refund Amounts. Gets list of items along with suggested refund amounts. 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 : calculateRefund_request
{
"returnItems":[
{
"quantityToReturn":1,
"commerceItemId":"ci8000005",
"productId":"prod10003",
"returnReason":"didNotLike",
"shippingGroupId":"sg80003",
"catRefId":"sku30019"
}
],
"orderId":"o80003"
}
- orderId
-
Type:
stringRequired:trueOrder ID for which refunds needs to be calculated. - returnItems
-
Type:
arrayreturnItemsRequired:trueAdditional Properties Allowed:List of returnable Items.
Nested Schema : returnItems
Nested Schema : items
Type:
object- catRefId
-
Type:
stringThe SKU ID - commerceItemId
-
Type:
stringID of the commerce item. - productId
-
Type:
stringThe Product ID - quantityToReturn
-
Type:
integerQuantity to be Returned - returnReason
-
Type:
stringReason to return an Item - shippingGroupId
-
Type:
stringShipping group ID of the returned item
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : calculateRefund_response
- orderId
-
Type:
stringThe Order Id - profileInfo
-
Type:
objectprofileInfoAdditional Properties Allowed:Profile Information for the order. - quoteInfo
-
Type:
objectquoteInfoAdditional Properties Allowed:The quote information of the order. - returnItems
-
Type:
arrayreturnItemsAdditional Properties Allowed:List of returnable Items.
Nested Schema : profileInfo
Type:
objectProfile Information for the order.
-
Type:
stringEmail address of the profile - firstName
-
Type:
stringFirst name of profile. - lastName
-
Type:
stringLast name of profile. - middleName
-
Type:
stringMiddle name of profile. - organization
-
Type:
objectorganizationAdditional Properties Allowed:The Organization associated with the B2B customer profile.
Nested Schema : quoteInfo
Type:
objectThe quote information of the order.
- errorInfo
-
Type:
arrayerrorInfoAdditional Properties Allowed:the array of errors, if any - expirationDate
-
Type:
stringthe expiration date of the quoted order, if any - externalId
-
Type:
stringthe external id for the quote - notes
-
Type:
arraynotesAdditional Properties Allowed:the notes (history) for the order - providerNote
-
Type:
stringthe provider note for the quoted order - quoteDate
-
Type:
numberthe date the order was quoted in milliseconds - rejectionDate
-
Type:
stringthe rejection date for an order whose quote has been rejected by user - rejectionNote
-
Type:
stringthe rejection note for an order whose quote has been rejected by user - requestDate
-
Type:
stringthe date when the quote was requested in ISO format
Nested Schema : returnItems
Nested Schema : organization
Type:
objectThe Organization associated with the B2B customer profile.
- id
-
Type:
stringThe id of the organization. - name
-
Type:
stringThe name of of the organization.
Nested Schema : errorInfo
Nested Schema : notes
Nested Schema : items
Type:
object- profileId
-
Type:
stringthe profile id of the user - profileType
-
Type:
stringthe profile type of the user that requested the quote - providerNote
-
Type:
stringthe provider note for the quoted order - quoteDate
-
Type:
numberthe date the order was quoted in milliseconds - rejectionDate
-
Type:
numberthe rejection date for an order whose quote has been rejected by user - rejectionNote
-
Type:
stringthe rejection note for an order whose quote has been rejected by user - requestDate
-
Type:
numberthe date when the quote was requested in ISO format - requesterNote
-
Type:
stringthe requester note
Nested Schema : items
Type:
object- actionCode
-
Type:
stringThe action code that has been set on the item by the configurator system. - activationDate
-
Type:
stringThe activation date in ISO format. - assetId
-
Type:
stringThe asset ID corresponding to the current item. - billingAccountId
-
Type:
stringThe billing account ID associated to the current item. - catRefId
-
Type:
stringCatalog Reference Id - childItems
-
Type:
arraychildItemsAdditional Properties Allowed:Returned Item child items - comments
-
Type:
stringComments at returnItem level - commerceItemId
-
Type:
stringCommerce Id of the returned item - configuratorId
-
Type:
stringConfigurator Id of the returned item - customerAccountId
-
Type:
stringThe customer account ID associated to the current item. - deactivationDate
-
Type:
stringThe deactivation date in ISO format. - displayName
-
Type:
stringDisplay Name of the Product - dynamicProperties
-
Type:
arraydynamicPropertiesAdditional Properties Allowed:Array of custom properties at order line item level. - externalData
-
Type:
arrayexternalDataAdditional Properties Allowed:External data to be associated with a commerce item, provided by a configurator system. - nonreturnable
-
Type:
booleanIndicates whether the item is returnable or not - price
-
Type:
numberTotal price of items - productId
-
Type:
stringId of the Product - quantityAvailableForReturn
-
Type:
numberQuantity Available - quantityReturned
-
Type:
numberQuantity Returned - quantityShipped
-
Type:
numberQuantity Shipped - serviceAccountId
-
Type:
stringThe service account ID associated to the current item. - serviceId
-
Type:
stringThe service ID associated to the current item. - shippingGroupId
-
Type:
stringShipping group Id of the returned item - skuOptionInfo
-
Type:
arrayskuOptionInfoAdditional Properties Allowed:Product Variant Information. - skuProperties
-
Type:
arrayskuPropertiesAdditional Properties Allowed:Sku properties Information - unitPrice
-
Type:
numberUnit price of the item
Nested Schema : childItems
Nested Schema : dynamicProperties
Nested Schema : externalData
Nested Schema : skuOptionInfo
Nested Schema : skuProperties
Nested Schema : items
Type:
object- actionCode
-
Type:
stringThe action code that has been set on the item by the configurator system. - activationDate
-
Type:
stringThe activation date in ISO format. - assetId
-
Type:
stringThe asset ID corresponding to the current item. - billingAccountId
-
Type:
stringThe billing account ID associated to the current item. - catRefId
-
Type:
stringCatalog Reference Id of the child Item - customerAccountId
-
Type:
stringThe customer account ID associated to the current item. - deactivationDate
-
Type:
stringThe deactivation date in ISO format. - displayName
-
Type:
stringProduct display name of the sub sku commerce item - externalData
-
Type:
arrayexternalDataAdditional Properties Allowed:External data to be associated with a commerce item, provided by a configurator system. - productId
-
Type:
stringProduct Id of teh - quantity
-
Type:
numberquantity of the child Item - route
-
Type:
stringProduct path - selectedOptions
-
Type:
arrayselectedOptionsAdditional Properties Allowed:Child Product Variant Information. - serviceAccountId
-
Type:
stringThe service account ID associated to the current item. - serviceId
-
Type:
stringThe service ID associated to the current item.
Nested Schema : externalData
Nested Schema : selectedOptions
Nested Schema : items
Type:
object- actionCode
-
Type:
stringThe action code that has been set on the externalData item by the configurator system. - name
-
Type:
stringThe name to be associated with the externalData item. - values
-
Type:
objectvaluesAdditional Properties Allowed:The array of values associated with an externalData item.
Nested Schema : values
Type:
objectThe array of values associated with an externalData item.
- dynamic_property_key
-
Type:
stringThis property's name and value will be retrieved from a configurator system, so will be dynamically set.
Nested Schema : items
Type:
object- optionName
-
Type:
stringName of the Dynamic attribute. - optionValue
-
Type:
stringValue of the Dynamic attribute.
Nested Schema : items
Type:
object- id
-
Type:
stringThe ID of the dynamic property. - label
-
Type:
stringThe label of the dynamic property. - value
-
Type:
stringThe value of the dynamic property.
Nested Schema : items
Type:
object- actionCode
-
Type:
stringThe action code that has been set on the externalData item by the configurator system. - name
-
Type:
stringThe name to be associated with the externalData item. - values
-
Type:
objectvaluesAdditional Properties Allowed:The array of values associated with an externalData item.
Nested Schema : values
Type:
objectThe array of values associated with an externalData item.
- dynamic_property_key
-
Type:
stringThis property's name and value will be retrieved from a configurator system, so will be dynamically set.
Nested Schema : items
Type:
object- optionName
-
Type:
stringName of the Dynamic attribute - optionValue
-
Type:
stringValue of the Dynamic attribute
Nested Schema : items
Type:
object- id
-
Type:
stringID of the Dynamic SKU Property. - name
-
Type:
stringName of the Dynamic SKU Property. - propertyType
-
Type:
stringType that indicates whether it is a base or a custom SKU property, - value
-
Type:
stringValue of the Dynamic SKU Property.
Example application/json
{
"returnItems":[
{
"quantityReturned":0,
"unitPrice":9.99,
"shippingGroup":{
"shippingMethod":{
"shippingMethod":"standardShippingMethod",
"shippingMethodDescription":"Standard"
},
"shippingGroupId":"sg40411",
"shippingAddress":{
"lastName":"Spencers",
"country":"US",
"address3":null,
"address2":null,
"city":"Montgomery",
"prefix":null,
"address1":"600 Dexter Avenue",
"postalCode":"36130",
"companyName":null,
"jobTitle":null,
"county":null,
"suffix":null,
"firstName":"Mark",
"phoneNumber":"973-974-1234",
"faxNumber":null,
"alias":null,
"middleName":null,
"state":"AL",
"email":"mspens@abc.com"
}
},
"comments":null,
"productId":"prod10035",
"detailedItemPriceInfo":[
{
"discounted":false,
"secondaryCurrencyTaxAmount":0,
"amount":12.99,
"quantity":1,
"tax":1.29,
"orderDiscountShare":0,
"detailedUnitPrice":12.99,
"currencyCode":"USD"
}
],
"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"
}
],
"externalData":[
],
"childItems":[
{
"serviceAccountId":"serviceAcc-123",
"deactivationDate":"2018-06-27T12:59:59Z",
"quantity":2,
"productId":"prod10040",
"displayName":"Super Smash Brothers Brawl",
"externalData":[
],
"billingAccountId":"billingAcc-123",
"catRefId":"sku10041",
"route":"product/prod10040",
"customerAccountId":"customerAcc-123",
"assetId":"asset10001",
"selectedOptions":[
],
"actionCode":"Add",
"activationDate":"2017-06-27T15:30:00Z",
"serviceId":"service-123"
},
{
"serviceAccountId":"serviceAcc-123",
"deactivationDate":"2018-06-27T12:59:59Z",
"quantity":1,
"productId":"prod10038",
"displayName":"Wii Music",
"externalData":[
],
"billingAccountId":"billingAcc-123",
"catRefId":"sku10042",
"route":"product/prod10038",
"customerAccountId":"customerAcc-123",
"assetId":"asset10001",
"selectedOptions":[
],
"actionCode":"Add",
"activationDate":"2017-06-27T15:30:00Z",
"serviceId":"service-123"
}
],
"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"
}
],
"profileInfo":{
"lastName":"Anderson",
"firstName":"Kim",
"organization":{
"name":"Oracle India Pvt Ltd",
"id":"oracle"
},
"middleName":null,
"email":"kim@example.com"
},
"orderId":"o10400",
"refundInfo":{
"shippingTaxRefund":2.51,
"suggestedOtherRefund":0,
"suggestedTaxRefund":3.8,
"suggestedTotalRefund":41.79,
"actualShippingRefund":25,
"actualTaxRefund":3.8,
"otherRefund":0,
"suggestedShippingRefund":25,
"refundDue":41.79,
"returnFee":0,
"suggestedShippingSurchargeRefund":0,
"suggestedOrderRefund":12.99,
"unAdjustedRefundSubtotal":12.99,
"actualShippingSurchargeRefund":0
},
"links":[
{
"rel":"self",
"href":"http://example.com/ccstoreui/v1/returnRequests/calculateRefund"
}
],
"promotionAdjustments":{
"promotionAdjustmentsCount":0,
"orderPromotionValueAdjustments":[
],
"totalOrderDiscountAdjustment":0,
"nonReturnItemCostAdjustment":[
],
"itemPromotionValueAdjustments":[
],
"manyToManyPromotionCouponAdjustment":{
}
},
"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"
},
"paymentReversalInfo":[
{
"paymentGroupId":"pg10042",
"refundType":"tokenizedCreditCard",
"amount":32.84,
"creditCardInfo":{
"cardNumber":"xxxxxxxxxxxx1111"
},
"creditCardType":null,
"reversalMethod":"Card Payment Reversal",
"maxRefundAmount":156.82
}
]
}
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:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe 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:
{
"returnItems": [{
"quantityReturned": 0,
"unitPrice": 9.99,
"shippingGroup": {
"shippingMethod": {
"shippingMethod": "standardShippingMethod",
"shippingMethodDescription": "Standard"
},
"shippingGroupId": "sg40411",
"shippingAddress": {
"lastName": "Spencers",
"country": "US",
"address3": null,
"address2": null,
"city": "Montgomery",
"prefix": null,
"address1": "600 Dexter Avenue",
"postalCode": "36130",
"companyName": null,
"jobTitle": null,
"county": null,
"suffix": null,
"firstName": "Mark",
"phoneNumber": "973-974-1234",
"faxNumber": null,
"alias": null,
"middleName": null,
"state": "AL",
"email": "mspens@abc.com"
}
},
"comments": null,
"productId": "prod10035",
"detailedItemPriceInfo": [{
"discounted": false,
"secondaryCurrencyTaxAmount": 0,
"amount": 12.99,
"quantity": 1,
"tax": 1.29,
"orderDiscountShare": 0,
"detailedUnitPrice": 12.99,
"currencyCode": "USD"
}],
"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"
}
],
"externalData": [],
"childItems": [
{
"serviceAccountId": "serviceAcc-123",
"deactivationDate": "2018-06-27T12:59:59Z",
"quantity": 2,
"productId": "prod10040",
"displayName": "Super Smash Brothers Brawl",
"externalData": [],
"billingAccountId": "billingAcc-123",
"catRefId": "sku10041",
"route": "product/prod10040",
"customerAccountId": "customerAcc-123",
"assetId": "asset10001",
"selectedOptions": [],
"actionCode": "Add",
"activationDate": "2017-06-27T15:30:00Z",
"serviceId": "service-123"
},
{
"serviceAccountId": "serviceAcc-123",
"deactivationDate": "2018-06-27T12:59:59Z",
"quantity": 1,
"productId": "prod10038",
"displayName": "Wii Music",
"externalData": [],
"billingAccountId": "billingAcc-123",
"catRefId": "sku10042",
"route": "product/prod10038",
"customerAccountId": "customerAcc-123",
"assetId": "asset10001",
"selectedOptions": [],
"actionCode": "Add",
"activationDate": "2017-06-27T15:30:00Z",
"serviceId": "service-123"
}
],
"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"
}],
"profileInfo": {
"lastName": "Anderson",
"firstName": "Kim",
"organization": {
"name": "Oracle India Pvt Ltd",
"id": "oracle"
},
"middleName": null,
"email": "kim@example.com"
},
"orderId": "o10400",
"refundInfo": {
"shippingTaxRefund": 2.51,
"suggestedOtherRefund": 0,
"suggestedTaxRefund": 3.8,
"suggestedTotalRefund": 41.79,
"actualShippingRefund": 25,
"actualTaxRefund": 3.8,
"otherRefund": 0,
"suggestedShippingRefund": 25,
"refundDue": 41.79,
"returnFee": 0,
"suggestedShippingSurchargeRefund": 0,
"suggestedOrderRefund": 12.99,
"unAdjustedRefundSubtotal": 12.99,
"actualShippingSurchargeRefund": 0
},
"links": [{
"rel": "self",
"href": "http://example.com/ccstoreui/v1/returnRequests/calculateRefund"
}],
"promotionAdjustments": {
"promotionAdjustmentsCount": 0,
"orderPromotionValueAdjustments": [],
"totalOrderDiscountAdjustment": 0,
"nonReturnItemCostAdjustment": [],
"itemPromotionValueAdjustments": [],
"manyToManyPromotionCouponAdjustment": {}
},
"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"
},
"paymentReversalInfo": [{
"paymentGroupId": "pg10042",
"refundType": "tokenizedCreditCard",
"amount": 32.84,
"creditCardInfo": {"cardNumber": "xxxxxxxxxxxx1111"},
"creditCardType": null,
"reversalMethod": "Card Payment Reversal",
"maxRefundAmount": 156.82
}]
}