Returns
Returns is the process of a customer taking previously purchased merchandise back, and in turn receiving a refund in the original form of payment, exchange for another item (identical or different). Returns of various types like Get order detail for new return request, Return Create and Return Update. handled by a set of endpoints, This page covers Returns endpoints that are created to manage Returns operations programmatically
Get order detail for new return request
This endpoint allows to Get order detail for new return request, you must provide order Id required parameter.
Developers - API Operations:
Operation | Endpoint | Response |
---|---|---|
Get order details | /api/v2/commerce/return/:orderid | Get order detail for new return request. |
Required attributes
- Name
orderid
- Type
- string
- Description
Unique order id for new return order details.
Response Properties
- Name
statusCode
- Type
- number
- Description
Status code of the response.
- Name
status
- Type
- string
- Description
Status of the response.
- Name
errors
- Type
- array
- Description
List of errors in the response.
- Name
success
- Type
- boolean
- Description
Success status of the response.
- Name
message
- Type
- string
- Description
Message of the response.
- Name
messageCode
- Type
- string
- Description
Message code of the response.
- Name
result
- Type
- object
- Description
Result of the response.
- Name
id
- Type
- string
- Description
Unique ID for the guest ceckout.
- Name
orderNumber
- Type
- number
- Description
The order number of the product.
- Name
orderNumber
- Type
- date
- Description
The order date of the product.
- Name
currencyCode
- Type
- string
- Description
Code for the currency of the region.
- Name
currencySymbol
- Type
- string
- Description
Symbol for the currency of the region
- Name
Email
- Type
- string
- Description
Email of the user.
- Name
grandTotal
- Type
- object
- Description
The result of the grand Total.
- Name
formatted
- Type
- string
- Description
Price format without tax.
- Name
withTax
- Type
- string
- Description
Price with tax.
- Name
withoutTax
- Type
- number
- Description
Minmum price without tax.
- Name
tax
- Type
- number
- Description
Minmum price without tax.
- Name
raw
- Type
- string
- Description
Price with tax.
- Name
subTotal
- Type
- object
- Description
The result of subTotal.
- Name
shippingCharge
- Type
- object
- Description
The result of shippingCharge.
- Name
shipmentDate
- Type
- date
- Description
Shipment Date of the product.
- Name
lineItems
- Type
- Array
- Description
The result of Line items.
- Name
recordId
- Type
- number
- Description
The recordId of the company.
- Name
productId
- Type
- object
- Description
The Result of Product ID.
- Name
productIid
- Type
- object
- Description
The result of product Iid.
- Name
stockCode
- Type
- object
- Description
The result of stockCode.
- Name
name
- Type
- object
- Description
The Result of Name.
- Name
manufacturer
- Type
- string
- Description
The details of manufacturer.
- Name
subManufacturer
- Type
- string
- Description
The details of subManufacturer.
- Name
qty
- Type
- object
- Description
The result of Quantity.
- Name
price
- Type
- object
- Description
The result of Price.
- Name
discountAmt
- Type
- object
- Description
The Result of discount Amt.
- Name
shippedQty
- Type
- number
- Description
Product shipped Quantity.
- Name
totalPrice
- Type
- object
- Description
The result of total Price.
- Name
returnQtyRequested
- Type
- number
- Description
Product return Quantity Requested.
- Name
returnQtyRecd
- Type
- number
- Description
Product return Quantity Received.
- Name
availableQty
- Type
- number
- Description
Product available Quantity.
- Name
slug
- Type
- string
- Description
Defines the type of slug
- Name
image
- Type
- object
- Description
The result of Image.
- Name
customInfo1
- Type
- object
- Description
The Result of custom Info1.
- Name
reasonForReturnId
- Type
- string
- Description
Product reason For ReturnId.
- Name
requiredActionId
- Type
- string
- Description
Product required Action Id.
- Name
comment
- Type
- string
- Description
Product comment.
- Name
statusLabel
- Type
- string
- Description
Product label status like
Approved
.
- Name
returnStatus
- Type
- number
- Description
Product return Status.
- Name
faultReason
- Type
- string
- Description
Product fault Reason.
- Name
uploadFileUrls
- Type
- string
- Description
Product upload File Urls.
- Name
reasonsForReturn
- Type
- Array
- Description
The result of reasons For Return.
- Name
itemValue
- Type
- string
- Description
The value of item.
- Name
itemText
- Type
- string
- Description
The text related to item.
- Name
displayOrder
- Type
- number
- Description
The result of display Order.
- Name
parentItemValue
- Type
- string
- Description
The result of parent Item Value.
- Name
isDefault
- Type
- boolean
- Description
Flag to check isDefault.
- Name
requiredActions
- Type
- array
- Description
The result of required Actions.
Request
curl --location 'https://api20.bettercommerce.io/api/v2/commerce/return/:orderid' \
--header 'Accept: application/json'
Response
{
"statusCode": 200,
"status": "OK",
"errors": [],
"success": true,
"message": null,
"messageCode": null,
"result": {
"id": "f0fff0bb-dda5-ec11-b1ba-000d3a211cf7",
"orderNumber": "SO93225",
"orderDate": "2022-03-17T10:33:51.11",
"currencyCode": "GBP",
"currencySymbol": "£",
"email": "abc@abc.com",
"grandTotal": {
"currencySymbol": "£",
"formatted": {
"withTax": "£169.98",
"withoutTax": "£143.32",
"tax": "£26.67"
},
"raw": {
"withTax": 169.98,
"withoutTax": 143.315,
"tax": 26.665
}
},
"subTotal": {
"currencySymbol": "£",
"formatted": {
"withTax": "£159.99",
"withoutTax": "£159.99",
"tax": "£0.00"
},
"raw": {
"withTax": 159.99,
"withoutTax": 159.99,
"tax": 0
}
},
"shippingCharge": {
"currencySymbol": "£",
"formatted": {
"withTax": "£9.99",
"withoutTax": "£9.99",
"tax": "£0.00"
},
"raw": {
"withTax": 9.99,
"withoutTax": 9.99,
"tax": 0
}
},
"tax": null,
"status": 0,
"shipmentDate": "0001-01-01T00:00:00",
"lineItems": [
{
"recordId": "f2fff0bb-dda5-ec11-b1ba-000d3a211cf7",
"productId": "0A22F16C-2F5C-45B4-A5A0-38AA3EB93951",
"productIid": "0",
"stockCode": "BS0010-DARK-ORANGE-S",
"name": "Cotton Racerback Spaghetti top for Women DARK ORANGE s Colour",
"manufacturer": "My Brand",
"subManufacturer": "",
"qty": 1,
"price": {
"currencySymbol": "£",
"formatted": {
"withTax": "£80.00",
"withoutTax": "£80.00",
"tax": "£0.00"
},
"raw": {
"withTax": 80,
"withoutTax": 80,
"tax": 0
}
},
"discountAmt": {
"currencySymbol": "£",
"formatted": {
"withTax": "£0.00",
"withoutTax": "£0.00",
"tax": "£0.00"
},
"raw": {
"withTax": 0,
"withoutTax": 0,
"tax": 0
}
},
"shippedQty": 0,
"totalPrice": {
"currencySymbol": "£",
"formatted": {
"withTax": "£80.00",
"withoutTax": "£80.00",
"tax": "£0.00"
},
"raw": {
"withTax": 80,
"withoutTax": 80,
"tax": 0
}
},
"returnQtyRequested": 0,
"returnQtyRecd": 0,
"availableQty": 0,
"slug": "products/my-brand-cotton-racerback-spaghetti-top-women-dark-orange-1-bs0010-dark-orange-s",
"image": "https://liveocxcdn.azureedge.net/betterstore/products/orange1.jpg?fm=webp",
"customInfo1": "",
"status": 3,
"statusCode": "APPROVED",
"reasonForReturnId": null,
"requiredActionId": null,
"comment": null
},
{
"recordId": "f1fff0bb-dda5-ec11-b1ba-000d3a211cf7",
"productId": "EE7BC92E-E2E7-472D-8670-AD5E0048CA5D",
"productIid": "0",
"stockCode": "BS212729-WHTFLRL-14",
"name": "White Floral Broderie Mini Dress with Tie Shoulder 14 Colour",
"manufacturer": "My Brand",
"subManufacturer": "",
"qty": 1,
"price": {
"currencySymbol": "£",
"formatted": {
"withTax": "£79.99",
"withoutTax": "£79.99",
"tax": "£0.00"
},
"raw": {
"withTax": 79.99,
"withoutTax": 79.99,
"tax": 0
}
},
"discountAmt": {
"currencySymbol": "£",
"formatted": {
"withTax": "£0.00",
"withoutTax": "£0.00",
"tax": "£0.00"
},
"raw": {
"withTax": 0,
"withoutTax": 0,
"tax": 0
}
},
"shippedQty": 0,
"totalPrice": {
"currencySymbol": "£",
"formatted": {
"withTax": "£79.99",
"withoutTax": "£79.99",
"tax": "£0.00"
},
"raw": {
"withTax": 79.99,
"withoutTax": 79.99,
"tax": 0
}
},
"returnQtyRequested": 0,
"returnQtyRecd": 0,
"availableQty": 0,
"slug": "products/my-brand-white-floral-broderie-mini-dress-with-tie-shoulder-bs212729-whtflrl-12",
"image": "https://liveocxcdn.azureedge.net/betterstore/fu_spring_0280.jpg?fm=webp",
"customInfo1": "",
"status": 3,
"statusCode": "APPROVED",
"reasonForReturnId": null,
"requiredActionId": null,
"comment": null
}
],
"statusLabel": "Approved",
"reasonForReturnId": null,
"requiredActionId": null,
"comment": null,
"returnStatus": 0,
"faultReason": null,
"uploadFileUrls": null,
"reasonsForReturn": [
{
"itemValue": "Automated RMA",
"itemText": "Automated RMA",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Ordered more than one size",
"itemText": "Ordered more than one size",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Looks different to image",
"itemText": "Looks different to image",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Style doesn?t suit me",
"itemText": "Style doesn?t suit me",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Arrived too late",
"itemText": "Arrived too late",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Delivery Issues",
"itemText": "Delivery Issues",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Incorrect Item",
"itemText": "Incorrect Item",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Faulty",
"itemText": "Faulty",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Poor Quality",
"itemText": "Poor Quality",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Too Big",
"itemText": "Too Big",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
},
{
"itemValue": "Too Small",
"itemText": "Too Small",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
}
],
"requiredActions": [
{
"itemValue": "Refund",
"itemText": "Refund request",
"displayOrder": 0,
"parentItemValue": "",
"isDefault": false
}
]
}
}
Return Create
This endpoint allows to Return Create.
Developers - API Operations:
Operation | Endpoint | Response |
---|---|---|
Create Return | /api/v2/commerce/return/create | Create Return of product. |
Optional attributes
- Name
orderid
- Type
- string
- Description
Unique order id to create return.
- Name
comment
- Type
- string
- Description
Return comment of product.
- Name
lineItems
- Type
- object
- Description
The Result of line Items.
- Name
productId
- Type
- string
- Description
Unique ID of the product.
- Name
stockCode
- Type
- string
- Description
Unique stock Code of the product.
- Name
returnQtyRequested
- Type
- number
- Description
Product return Quantity Requested.
- Name
returnQtyRecd
- Type
- number
- Description
Product return Quantity Received.
- Name
reasonForReturnId
- Type
- string
- Description
Product reason For Return Id.
- Name
requiredActionId
- Type
- string
- Description
Product required Action Id.
- Name
comment
- Type
- string
- Description
Product return Comment.
- Name
faultReason
- Type
- string
- Description
Product fault Reason.
- Name
uploadFileUrls
- Type
- array
- Description
The result of upload File Urls.
Response Properties
- Name
statusCode
- Type
- number
- Description
Status code of the response.
- Name
status
- Type
- string
- Description
Status of the response.
- Name
errors
- Type
- array
- Description
List of errors in the response.
- Name
success
- Type
- boolean
- Description
Success status of the response.
- Name
message
- Type
- string
- Description
Message of the response.
- Name
messageCode
- Type
- string
- Description
Message code of the response.
- Name
result
- Type
- object
- Description
Result of the response.
- Name
recordId
- Type
- string
- Description
The recordId of the company.
- Name
id
- Type
- number
- Description
Unique ID for the return.
- Name
isValid
- Type
- boolean
- Description
Flag to check isValid.
Request
curl --location 'https://api20.bettercommerce.io/api/v2/commerce/return/create' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"orderId": "",
"comment": "wrong size",
"lineItems": [
{
"productId": "",
"stockCode": "",
"returnQtyRequested": 1,
"returnQtyRecd": 0,
"reasonForReturnId": "",
"requiredActionId": "",
"comment": "returning the items"
}
],
"faultReason": "",
"uploadFileUrls": [
"string"
]
}'
Response
{
"statusCode": 200,
"status": "OK",
"errors": [],
"success": true,
"message": null,
"messageCode": null,
"result": {
"recordId": "4d00e51a-258c-4f65-a487-ae5c000bee7c",
"id": 0,
"isValid": true
}
}
Return Update
This endpoint allows to Return Update, you must provide id required parameter.
Developers - API Operations:
Operation | Endpoint | Response |
---|---|---|
Update Return | /api/v2/commerce/return/:id/update | Return Update of product. |
Required attributes
- Name
id
- Type
- string
- Description
Unique order id for update return.
Optional attributes
- Name
id
- Type
- string
- Description
Unique order id to update return.
- Name
rettunStatus
- Type
- string
- Description
Return Status of the product.
- Name
comment
- Type
- string
- Description
Comment to return Update.
Response Properties
- Name
statusCode
- Type
- number
- Description
Status code of the response.
- Name
status
- Type
- string
- Description
Status of the response.
- Name
errors
- Type
- array
- Description
List of errors in the response.
- Name
success
- Type
- boolean
- Description
Success status of the response.
- Name
message
- Type
- string
- Description
Message of the response.
- Name
messageCode
- Type
- string
- Description
Message code of the response.
- Name
result
- Type
- object
- Description
Result of the response.
- Name
recordId
- Type
- string
- Description
The recordId of the company.
- Name
id
- Type
- number
- Description
Unique ID for the return.
- Name
isValid
- Type
- boolean
- Description
Flag to check isValid.
Request
curl --location 'https://api20.bettercommerce.io/api/v2/commerce/return/dolore cillum sit/update' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--data-urlencode 'id=sed culpa aute' \
--data-urlencode 'rettunStatus=-34713550' \
--data-urlencode 'comment=officia Excepteur culpa dolor'
Response
{
"statusCode": null,
"status": "non exercitation nulla laborum",
"errors": [
"fugiat velit tempor",
"elit deserunt"
],
"success": true,
"message": "exercitation sit dolor",
"messageCode": "reprehenderit dolor",
"result": {
"recordId": "00000000-0000-0000-0000-000000000000",
"id": -98503520,
"isValid": false
}
}
Get membership plans
This endpoint allows to Get membership plans.
Developers - API Operations:
Operation | Endpoint | Response |
---|---|---|
Get plans | /api/v2/commerce/membership/plans | Get membership plans. |
Optional attributes
- Name
branchId
- Type
- string
- Description
Branch Id of the company that created the quote.
- Name
domainId
- Type
- string
- Description
Domain Id of the company that created the quote.
- Name
totalRecord
- Type
- number
- Description
Total number of records.
- Name
currentPage
- Type
- number
- Description
Current page number.
- Name
pageSize
- Type
- number
- Description
Size of the page.
- Name
externalStatus
- Type
- string
- Description
External status of the quote.
Response Properties
- Name
statusCode
- Type
- number
- Description
Status code of the response.
- Name
status
- Type
- string
- Description
Status of the response.
- Name
errors
- Type
- array
- Description
List of errors in the response.
- Name
success
- Type
- boolean
- Description
Success status of the response.
- Name
message
- Type
- string
- Description
Message of the response.
- Name
messageCode
- Type
- string
- Description
Message code of the response.
- Name
result
- Type
- object
- Description
Result of the response.
- Name
recordId
- Type
- string
- Description
The recordId of the company.
- Name
name
- Type
- string
- Description
Name of the company.
- Name
isActive
- Type
- boolean
- Description
Flag to check isActive.
- Name
stockCode
- Type
- string
- Description
The stockCode of the product.
- Name
stockCode
- Type
- string
- Description
The stockCode of the product.
- Name
productId
- Type
- string
- Description
Unique Product ID.
- Name
price
- Type
- object
- Description
The result of Price.
- Name
minPrice
- Type
- number
- Description
Minimum price for the company
- Name
minPriceWithoutTax
- Type
- number
- Description
Minimum price for the company without tax
- Name
maxPrice
- Type
- number
- Description
Maximum price for the company
- Name
maxPriceWithoutTax
- Type
- number
- Description
Maximum price for the company wihtout tax
- Name
currencyDecimalSeparator
- Type
- string
- Description
Currency decimal separator for the region
- Name
currencyDigitsAfterDecimal
- Type
- number
- Description
Digits after decimal for the currency
- Name
currencySymbol
- Type
- string
- Description
Symbol for the currency of the region
- Name
formatted
- Type
- string
- Description
Price format without tax.
- Name
withTax
- Type
- string
- Description
Price with tax.
- Name
withoutTax
- Type
- number
- Description
Minmum price without tax.
- Name
tax
- Type
- number
- Description
Minmum price without tax.
- Name
raw
- Type
- string
- Description
Price with tax.
- Name
isMembership
- Type
- boolean
- Description
Flag to check is Membership.
- Name
shippingMethodMappings
- Type
- array
- Description
The result of the shipping Method Mappings.
- Name
value
- Type
- string
- Description
Error message of shipping Method Mappings.
- Name
membershipBenefits
- Type
- array
- Description
The result of the membership Benefits.
- Name
intervalDurationType
- Type
- number
- Description
Membership interval Duration Type.
- Name
noOfVouchers
- Type
- number
- Description
Number of the Vouchers.
- Name
displayOrder
- Type
- number
- Description
Membership display order.
Request
curl --location 'https://api20.bettercommerce.io/api/v2/commerce/membership/plans' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'searchText=tempor officia commodo voluptate' \
--data-urlencode 'pricingType=2' \
--data-urlencode 'name=commodo magna' \
--data-urlencode 'termType=1' \
--data-urlencode 'isActive=18727009' \
--data-urlencode 'productId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'categoryId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'manufacturerId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'subManufacturerId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'planType=0' \
--data-urlencode 'isMembership=true' \
--data-urlencode 'currencyCode=amet consectetur cupidatat sit' \
--data-urlencode 'id=-99245049' \
--data-urlencode 'recordId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'localTextKey=ad sint nisi cupidatat deserunt' \
--data-urlencode 'created=1992-09-12T21:05:52.695Z' \
--data-urlencode 'lastUpdated=1953-01-16T19:24:07.143Z' \
--data-urlencode 'createdBy=consectetur voluptate cillum ipsum' \
--data-urlencode 'lastUpdatedBy=irure' \
--data-urlencode 'ipAddress=occaecat deserunt enim' \
--data-urlencode 'orgId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'branchId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'domainId=00000000-0000-0000-0000-000000000000' \
--data-urlencode 'totalRecord=93492822' \
--data-urlencode 'currentPage=-42046760' \
--data-urlencode 'pageSize=14464042' \
--data-urlencode 'externalStatus=proid'
Response
{
"statusCode": 504,
"status": "proident deserunt cupidatat consequat",
"errors": [
"Ut in laborum dolor",
"incididunt adipis"
],
"success": false,
"message": "eu in est esse laboris",
"messageCode": "aliquip dolor est",
"result": [
{
"recordId": "00000000-0000-0000-0000-000000000000",
"name": "cillum consequat ad",
"isActive": true,
"stockCode": "dolore",
"productId": "00000000-0000-0000-0000-000000000000",
"price": {
"minPrice": -68867922.99870792,
"minPriceWithoutTax": -14061219.385330051,
"maxPrice": 79736817.13958171,
"maxPriceWithoutTax": -97882317.25851735,
"currencyDecimalSeparator": "i",
"currencyDigitsAfterDecimal": -64986607,
"currencySymbol": "ex ad sit Lorem",
"formatted": {
"withTax": "ea in sunt",
"withoutTax": "reprehenderit dolore enim nostrud dolore",
"tax": "ad non"
},
"raw": {
"withTax": -73150893.0379968,
"withoutTax": -19791568.02046132,
"tax": -63998579.901232414
}
},
"isMembership": true,
"shippingMethodMappings": [
{
"value": "<Error: Too many levels of nesting to fake this schema>"
},
{
"value": "<Error: Too many levels of nesting to fake this schema>"
}
],
"membershipBenefits": [
{
"value": "<Error: Too many levels of nesting to fake this schema>"
},
{
"value": "<Error: Too many levels of nesting to fake this schema>"
}
],
"intervalDurationType": -28815314,
"noOfVouchers": -13186079,
"displayOrder": 10593699
},
{
"recordId": "00000000-0000-0000-0000-000000000000",
"name": "deserunt id",
"isActive": true,
"stockCode": "cillum velit pariatur",
"productId": "00000000-0000-0000-0000-000000000000",
"price": {
"minPrice": 76534082.69980115,
"minPriceWithoutTax": 48026405.96509358,
"maxPrice": 79840094.3117333,
"maxPriceWithoutTax": 90691695.97337678,
"currencyDecimalSeparator": "minim aute non",
"currencyDigitsAfterDecimal": 1664028,
"currencySymbol": "consequat aute consectetur",
"formatted": {
"withTax": "adipisicing ex eiusmod elit",
"withoutTax": "pariatur proident",
"tax": "nostrud"
},
"raw": {
"withTax": -95964180.67533796,
"withoutTax": -95453987.31773509,
"tax": 25160330.620945796
}
},
"isMembership": true,
"shippingMethodMappings": [
{
"value": "<Error: Too many levels of nesting to fake this schema>"
},
{
"value": "<Error: Too many levels of nesting to fake this schema>"
}
],
"membershipBenefits": [
{
"value": "<Error: Too many levels of nesting to fake this schema>"
},
{
"value": "<Error: Too many levels of nesting to fake this schema>"
}
],
"intervalDurationType": -39162948,
"noOfVouchers": -4809889,
"displayOrder": 53883618
}
]
}