In-depth Guide to JD.com APIs: After-Sales Services and Consumer Rights Protection

Introduction

In e-commerce systems, the after-sales service module plays a crucial role in ensuring customer satisfaction and reinforcing platform trust. When consumers encounter product issues such as defects, incorrect deliveries, or other anomalies, timely and efficient resolution is essential. JD.com offers a comprehensive set of APIs that developers can integrate into their self-hosted systems to streamline the after-sales process.

This guide focuses on five core APIs related to after-sales services:

  • jingdong.afsservice.apply.create: Submit an after-sales request

  • jingdong.afsservice.order.get: Query order's after-sales information

  • jingdong.afsservice.service.detail.get: Retrieve after-sales service details

  • jingdong.afsservice.service.schedule.get: Track the processing progress of an after-sales request

  • jingdong.afsservice.service.cancel: Cancel an after-sales application

1. After-Sales Request Submission API: jingdong.afsservice.apply.create

1. Purpose

When users initiate requests for returns, exchanges, repairs, or refunds, this API is used to submit an after-sales service order to JD's backend for review and processing.

2. Request Parameters (Key Fields)

Parameter Name

Example Value

Description

afsApplyType

10

Application type (10=Return; 20=Exchange; 30=Repair)

orderId

1234567890

JD order ID

customerExpect

10

Customer request (10=Refund; 20=Exchange, etc.)

questionDesc

Product issue

Detailed description of the problem

isNeedDetectionReport

0

Whether a detection report is needed (0=No, 1=Yes)

images

Image URLs

URLs of issue images, uploaded via JD's CDN

Example JSON:

{

"afsApplyType": 10,

"orderId": 1234567890,

"customerExpect": 10,

"questionDesc": "The phone won't power on or respond to charging",

"isNeedDetectionReport": 0,

"images": ["https://img.jd.com/abc.jpg"]

}

3. Response Example

{

"jingdong_afsservice_apply_create_responce": {

"resultCode": 100,

"resultComment": "Success",

"afsServiceId": 987654321

}

}

A successful request returns an afsServiceId, which is used in follow-up queries.

2. After-Sales Order Query API: jingdong.afsservice.order.get

1. Purpose

Used to check whether a specific order already has an existing after-sales application. This is helpful for avoiding duplicate submissions.

2. Request Parameters

{

"orderId": 1234567890

}

3. Response Example

{

"jingdong_afsservice_order_get_responce": {

"afsServiceList": [

{

"afsServiceId": 987654321,

"orderId": 1234567890,

"serviceStatus": 2

}

]

}

}

The serviceStatus reflects the current status of the after-sales request (e.g., 1=Pending, 2=In Progress, 3=Completed).

3. After-Sales Detail API: jingdong.afsservice.service.detail.get

1. Purpose

Used to retrieve comprehensive information about a specific after-sales request, including user contact, issue description, handling result, and current status.

2. Request Parameters

{

"afsServiceId": 987654321

}

3. Response Example

{

"jingdong_afsservice_service_detail_get_responce": {

"customerInfo": {

"linkMan": "Zhang San",

"phone": "13800000000"

},

"serviceDetailInfo": {

"questionDesc": "Cracked screen and unresponsive touch",

"processResult": "Return and refund",

"status": "In progress"

}

}

}

This data is ideal for display in customer service dashboards or end-user portals to enhance transparency and communication.

4. After-Sales Progress API: jingdong.afsservice.service.schedule.get

1. Purpose

Provides a step-by-step history of the service process, similar to logistics tracking. Useful for showing progress updates to users.

2. Response Example

{

"jingdong_afsservice_service_schedule_get_responce": {

"scheduleList": [

{

"step": "Review Approved",

"date": "2025-05-05 14:00:00"

},

{

"step": "User Sent Back Product",

"date": "2025-05-06 09:30:00"

},

{

"step": "Product Under Inspection",

"date": "2025-05-07 11:00:00"

}

]

}

}

Each step represents a milestone in the service handling process.

5. Cancel After-Sales Application API: jingdong.afsservice.service.cancel

1. Purpose

If the user made a request by mistake or the issue was resolved privately, this API allows the cancellation of the request.

2. Request Parameters

{

"afsServiceId": 987654321

}

This functionality can be exposed in the frontend to allow users to revoke their requests if necessary.

6. Recommended After-Sales Workflow

  1. ✅ User submits an after-sales request via apply.create

  2. ✅ System checks for existing applications using order.get

  3. ✅ Retrieve details and status using service.detail.get and service.schedule.get

  4. ✅ Customer service reviews and handles the case manually

  5. ✅ If needed, user can cancel the request using service.cancel

A clear workflow ensures efficient processing, reduces dispute time, and enhances the user experience.

7. Practical Tips and Considerations

  • Match application type and customer request: For example, afsApplyType=10 (Return) should align with customerExpect=10 (Refund).

  • Sync status in real-time: Use order.get and schedule.get to push current status to frontend UIs.

  • Image uploads: Ensure issue images are uploaded via JD’s file upload API to obtain valid CDN URLs.

  • Encapsulate logic as a module: Consider building a reusable after-sales module to simplify integration across systems.

8. Common Error Codes and Solutions

Error Code

Description

Suggested Solution

3001

Parameter format error

Check required fields and data types

403

No permission to call API

Ensure after-sales API access is enabled

500

System exception

Retry later or contact JD technical support

9. Conclusion

JD.com's after-sales APIs empower developers and merchants to manage complex customer service scenarios with ease. From request submission to status tracking and cancellation, these interfaces provide full lifecycle control over after-sales operations. By designing a robust integration and optimizing the user flow, businesses can significantly enhance customer satisfaction and operational efficiency.

Articles related to APIs :

For seamless and efficient access to the Jingdong API, please contact our team : support@luckdata.com