Custom Development / Puma UAE / OMSPro / OMSPro Create Reverse Return

OMSPro Create Reverse Return

Date Version Name Applied changes
30.05.2025 1.0 Milen Markov First Publish

The purpose of this document is to give good explanation on how we can send a reverse return to OMSpro.

The idea of this call is if we receive a return cancellation from Trendyol (when a buyer initially creates a return request but then cancels it), we need to push this return cancellation to OMSPro as well.

API Test Endpoint: PUT https://puma-test.openoms.net:8084/HEMI/ReverseReturnOrder

API Live Endpoint: PUT [https://pumame.omspro.com:8080/HEMI/ReverseReturnOrder](https://pumame.omspro.com:8080/HEMI/ReverseReturnOrder)

We want to introduce a new field in Channel OMS called Send Claim Cancellation - boolean field with default value “No”. We should send such cancellations only if field is selected as “Yes”

Then we are to trigger such an update to OMSPro when we have an Order Claim > Claim Status = Rejected and Order Claim > Rejected by = Buyer from the marketplace

We also want to track the connector status that it has been sent so we want to also include in the check that Claim Connector > Connector Status = Created . This way we will ensure that we send only the created claims 🙂 (For reference on Claim Connector table please see v1.6 explanation here)

We also want to check if Status field is “normal” or “pending”. Both should be a trigger for sending the Reverse Return if all other requirements are met.

As we want to track the sending if success or not we will need to track this somewhere - we suggest to create a general “Connector” table under the claim which is to be used for multiple connectors as and if needed - table should have a connector ID (to show which connector is communicating with this claim) and a status for the connection (standard MCP Status field with pending, sent, error, normal statuses.

IF this approach is taken then we should select for sending all claims that are “Cancelled” (as mentioned above) that don’t have a record or have a record on “pending” status

Example Request:

{
    "order_no": "TEST5436437",
    "ref_no1": "8709",
    "invoice_no": "1014026421",
    "reason_code": "R00",
    "reason_name": "R00-Marketplace Reverse Return",
    "return_comments": "",
    "return_date": "2025-05-30 08:12:09",
    "return_type": "",
    "application_id": "Trendyol",
    "created_by": "HEMI"
}

Request Mapping:

OMSPro field Hemi Field Required Notes
order_no Orders > Marketplace Order ID Yes
ref_no1 Order Claim > ID Yes
invoice_no Orders > ID Yes
reason_code Yes Hardcoded as “R00”
reason_name Yes Hardcoded as “R00-Marketplace Reverse Return”
return_comments Order Claim > Marketplace Reason No
return_date Order Claim > Marketplace Date Yes
Needs to be in format “YYYY-MM-DD HH:MM:SS”
return_type N/A No
application_id Channel OMS > Application ID No NEW FIELD

String to be picked and sent from the relevant set channel | | created_by | | N/A | No | Hardcoded as “HEMI” |

Example Response:

{
    "success": true,
    "message": "",
    "error_code": 0,
    "data": {
        "application_id": "HEMI",
        "b_address_1": "Trendyol Address",
        "b_city": "Abu Dhabi",
        "b_country": "AE",
        "b_email_address": "trendyolbuyer@trendyol.com",
        "b_first_name": "TrendyolUser",
        "b_last_name": "Customer",
        "b_phone": "4198274319284",
        "b_state": "",
        "b_zip_code": "",
        "capture_amount": 696,
        "capture_status": "CAPTURE_SUCCESS",
        "cod_fee": 0,
        "country_id": "AE",
        "created_by": "HEMI",
        "created_date": "2025-05-30T15:15:27.953",
        "currency_id": "AED",
        "custom_duty_fee": 0,
        "customer_name": "Trendyol Customer",
        "customer_type": "Registered",
        "delivery_date": "2025-05-29T07:12:09",
        "email": "Trendyoluser@Trendyol.com",
        "import_vat_fee": 0,
        "line_discount_amount": 0,
        "order_amount": 696,
        "order_date": "2025-05-29T07:12:09",
        "order_no": "TEST5436437",
        "order_quantity": 4,
        "order_status": "SHIPPED",
        "payment_amount": 696,
        "payment_date": "2025-05-29T07:12:09",
        "payment_method": "Trendyol",
        "payment_status": "CAPTURE_SUCCESS",
        "reason_code": "R99",
        "reason_name": "R99-Marketplace Return",
        "ref_no": "1014026421",
        "ref_no1": "8711",
        "refund_status": "CANCELLED",
        "return_amount": 169,
        "return_date": "2025-05-30T15:15:27.953",
        "return_order_comments": [
            {
                "_id": "0DDAD1A6-F800-439D-83A6-C746F961AD9A",
                "comment": "Return Order is created!",
                "created_by": "HEMI",
                "created_date": "2025-05-30T15:15:27.953",
                "id": "0DDAD1A6-F800-439D-83A6-C746F961AD9A",
                "rma_no": "TEST5436437R3",
                "user_name": "HEMI"
            },
            {
                "_id": "E84E07A1-2601-4628-BC2E-C04C08B6225E",
                "comment": "Return Order TEST5436437R3 is created by HEMI",
                "created_by": "HEMI",
                "created_date": "2025-05-30T15:37:08.433",
                "id": "E84E07A1-2601-4628-BC2E-C04C08B6225E",
                "rma_no": "TEST5436437R3",
                "user_name": "HEMI"
            }
        ],
        "return_order_details": [
            {
                "_id": "7CC4BF0F-4773-4A02-AB71-248C4644FDCF",
                "a_quantity": 0,
                "accepted_quantity": 0,
                "b_quantity": 0,
                "c_quantity": 0,
                "cancel_quantity": 0,
                "description": "Future Rider Play On Mens Low Top Trainer Shoes",
                "description_2": "جاكيت رياضي Iconic T7 للنساء",
                "id": "7CC4BF0F-4773-4A02-AB71-248C4644FDCF",
                "line_discount_amount": 0,
                "mark_down": 0,
                "order_line_no": "406369705475222222",
                "order_no": "TEST5436437",
                "order_quantity": 2,
                "original_price": "349.00",
                "price": 169,
                "product_color": "Puma Black",
                "product_id": "4063697054752",
                "product_ref1": "",
                "product_ref2": "530078_01",
                "product_ref3": "",
                "product_size": "S",
                "product_uom": "",
                "quantity": 1,
                "reason_code": "R99",
                "reason_name": "R99-Marketplace Return",
                "rejected_quantity": 0,
                "return_line_no": "406369705475222222",
                "return_line_status": "REVERSED",
                "rma_no": "TEST5436437R3",
                "shipping_fee": 0,
                "sub_total": 169
            }
        ],
        "return_order_payments": [
            {
                "capture_amount": 696,
                "id": "",
                "payment_amount": 696,
                "payment_date": "2025-05-29T07:12:09",
                "payment_method": "Trendyol",
                "payment_status": "CAPTURE_SUCCESS",
                "payment_type": "",
                "refund_status": "CANCELLED",
                "return_amount": 169,
                "rma_no": "TEST5436437R3"
            }
        ],
        "return_order_status_details": [
            {
                "_id": "3DFFF029-CC89-45BB-8AAA-6752FC6E3776",
                "date": "2025-05-30T15:15:27.953",
                "from_status": "",
                "id": "3DFFF029-CC89-45BB-8AAA-6752FC6E3776",
                "return_line_no": "",
                "rma_no": "TEST5436437R3",
                "to_status": "RETURNED"
            },
            {
                "_id": "BD9B4F1E-AE7C-42F6-9038-987C0A1A6BF7",
                "date": "2025-05-30T15:37:08.433",
                "from_status": "RETURNED",
                "id": "BD9B4F1E-AE7C-42F6-9038-987C0A1A6BF7",
                "return_line_no": "",
                "rma_no": "TEST5436437R3",
                "to_status": "REVERSED"
            }
        ],
        "return_quantity": 1,
        "return_status": "REVERSED",
        "return_tracking_no": "RETURNTEST5436437",
        "rma_no": "TEST5436437R3",
        "s_address_1": "Trendyol Address",
        "s_city": "Abu Dhabi",
        "s_country": "AE",
        "s_email_address": "Trendyoluser@Trendyol.com",
        "s_first_name": "Trendyol",
        "s_last_name": "Customer",
        "s_phone": "4198274319284",
        "s_state": "",
        "s_zip_code": "",
        "sales_channel_id": "Trendyol",
        "sales_channel_name": "Trendyol",
        "sap_export": false,
        "seq_no": 30254,
        "shipped_date": "2025-05-30T12:52:22.230",
        "shipping_carrier": "Trendyol",
        "shipping_fee": 0,
        "shipping_method": "Standard",
        "shipping_status": "SHIPPED",
        "shipping_tracking_no": "17051",
        "site_id": "UAE",
        "total_shipping_fee": 0,
        "updated_date": "2025-05-30T15:37:08.433"
    }
}

If Success - mark connector claim as “normal” and Connector Status = “Cancelled”

Sample error response:

{
    "success": false,
    "message": "RMA Not found",
    "error_code": -1,
    "data": null
}

If Error - mark connector claim as “error”. Also from the error response we want to store the message and create a record in Order Error with Type = “Connector”

Is this article helpful?
0 0 0