Skip to content
On this page

Reconciliation API Integration Document

Background: This document defines the technical specification for the reconciliation interface developed by the RMS to support data pulling by 99. The interface enables 99 to retrieve full transaction data, verify unilateral accounting, and ensure financial reconciliation accuracy.

99 will query the transaction data of RMS at regular intervals every day. RMS needs to provide some API for transaction data query. The query process is as follows: Reconciliation V2_Part 1

1.What does RMS need to provide

1.1 Domain name

https://www.YourDomainName.com/order/v1/queryByDate

https://www.YourDomainName.com/order/v1 This is an example of the request prefix that needs to be provided by RMS to 99

/queryByDate This is the fixed request path

1.2 API interface

1.2.1 /queryByDate

An API interface for querying order data based on a time range, for example: https://www.YourDomainName.com/order/v1/queryByDate

https://www.YourDomainName.com/order/v1 This is an example of the request prefix that needs to be provided by RMS to 99

/queryByDate This is the fixed request path

1.2.2 /queryByIds

Query the order data API interface by the orderId collection, for example: https://www.YourDomainName.com/order/v1/queryByIds

https://www.YourDomainName.com/order/v1 This is an example of the request prefix that needs to be provided by RMS to 99

/queryByIds This is the fixed request path

2.Authentication Method

99 will use the "Authentication Method" in the RMS Open API to generate signatures(see link: Authentication Method)

99 shall use the api_key and api_secret to access the reconciliation interface developed by RMS. The authentication process strictly follows the DIDI-AUTH-SHA256 standard.

99 will use the same api_key and api_secret as the RMS Open API.

2.1 Authorization Header Example

Authorization: DIDI-AUTH-SHA256|{"api_key":"xxx","nonce_string":"xxx","timestamp":"xxx","signature":"xxx"}

Note: RMS need reject requests with expired timestamps, invalid signatures, or missing authorization headers.

3. Integration process

Reconciliation V2_Part 1

4. API Code Description

4.1 Http Code Description

http_codedescription
200Network request is success
400If there are any validation issues, RMS need always return code 400
401Unauthorized
403Permission deny
404Url not found
500There is an server error that was not treated in the system

For all APIs, if an error occurs, 99 will attempt to request three times, with an interval of no more than 3 seconds between each request.

4.2 Http Response Field Description

Field nameDescriptionExample
errnoError code, when http code is 200, the errno is 0, otherwise it is an error code10004
errmsgError message, when http code is 200, the message is empty or "success" , otherwise it is an error's descriptionsign param error
trace_idtrace_id is the id of the 99 internal request log record. When troubleshooting system issues, trace_id is used for log search. RMS needs to include trace_id when the API request returns the result0a0f120f637304feb06e4cabb166e702
datathe http response body

4.3 Errno description

When the request is successful, errno must be 0. When an exception is requested, it is recommended to use the following errno (optional).

errnoDescription
0Success
40001Unauthorized
40002Request params check failed(e.g., invalid parameters, expired timestamp)
40003GS CNPJ not found in RMS database
40004The time query is out of range
40005The frequency of requests is too high
50000There is an server error that was not treated in the system

4.4 Example Response (Request params check failed)

json
{
  "errno": 40002,
  "errmsg": "cnpj is empty",
  "trace_id": "0a0f120f637304feb06e4cabb166e702"
}

5. API interface parameter description

5.1 /queryByDate

Description

Query the order data API interface based on the time range.

99 will regularly check the order data of the previous day from RMS every day to reconcile the order data

Domain: https://www.YourDomainName.com/order/v1

URL: /queryByDate

Request Method: POST

Content-Type: application/json

Request Traffic Limit: <= 5 QPS (request per second)

5.1.1 Request Parameters

The header of the request must contain a valid signature, and the request body should include the following JSON data:

Parameter NameParameter TypeRequiredParameter ExplanationExample
trace_idstringYestrace_id is the id of the 99 internal request log record. When troubleshooting system issues, trace_id is used for log search. RMS needs to include trace_id when the API request returns the result0a0f120f637304feb06e4cabb166e702
startTimeint64YesQuery the start timestamp of the order data (in seconds).1770692400
endTimeint64YesQuery the end timestamp of the order data (in seconds).1770778799
pageNointYesThe page number1
pageSizeintYesThe size of items per page100
cnpjstringYesThe CNPJ of the gas station147835135

5.1.2 Example Request

curl
curl --location --request POST 'https://www.YourDomainName.com/order/v1/queryByDate' \
--header 'Authorization: DIDI-AUTH-SHA256|{"api_key":"de2b29daf0cb69bde91a2622779b43b1","nonce_string":"g3oB6qC7ep4CpgzziReyvW68HlQtGfvp","timestamp":"1760684986","signature":"F269FFEDA4DEE2FE9B7593AD79C29D75450CAF3C23A927A3606C007B7C0F83D9"}' \
--header 'Content-Type: application/json' \
--data '{
    "trace_id": "0a0f120f637304feb06e4cabb166e702",
    "cnpj": "1478351357824",
    "startTime": 1770692400,
    "endTime": 1770778799,
    "pageNo": 1,
    "pageSize": 20
}'

5.1.3 Pagination

  • Pagination Parameters: pageNo (default: 1) and pageSize (default: 100)
  • Pagination Logic: The RMS shall return data in pages sorted by orderTime (Order completion time descending); if pageSize exceeds the maximum, it shall be truncated to 1000.

Note: The time range between startTime and endTime shall not exceed 30 days. If exceeded, RMS shall return an error.

5.1.4 Response Parameters

Parameter NameParameter TypeRequiredParameter ExplanationExample
errmsgstringYesError prompt. When the HTTP code is 200, this field is empty or "success"; otherwise, it is an error promptsuccess
errnointYesError code definition:
- 0: Request successful
- 4000x: Client-side error (e.g., invalid parameters, expired timestamp)
- 50000: Server-side error (e.g., RMS internal error)
40001
trace_idstringYesReturn the trace_id in the 99 request parameter0a0f120f637304feb06e4cabb166e702
dataobjectYesAPI specific response content

5.1.5 Data Object Parameters

Parameter NameParameter TypeRequiredParameter Explanation
totalNumintYesThe total size of transaction data
orderListarrayYes99 order list

5.1.6 Order List Parameters (Order Dimension)

Parameter NameParameter TypeRequiredParameter Explanation
discountCodestringYesDiscount code
cnpjstringYesCNPJ of gas station
orderIdstringYes99 order id, returned by 99 API as order_id
orderTimeintYesOrder (completion) time, Standard timestamp format(in seconds).
orderStatusstringYes1. completed
2. refunded (after payment)
3. others
orderItemListarrayYes99 order item list

5.1.7 Order Item Response Parameters (Sub Order Dimension)

Parameter NameParameter TypeRequiredParameter Explanation
orderItemIdstringYes99 sub-order id, returned by 99 API as order_id
productCodestringNoExternal product identifier
originalAmountfloatYesOriginal price of the line
totalDiscountfloatYesTotal discount amount of the line
stationDiscountfloatYesDiscount amount provided by gas station for the line item
platformDiscountfloatYesDiscount amount provided by 99 for the line item
paymentAmountfloatYesUser payment amount (after discount) of the line
quantityfloatYesFuel Product quantity
partnershipFeefloatYesAmount taken by 99(This parameter is returned in the /open/rms/validateCode interface)

5.1.8 Example Response

json
{
  "errno": 0,
  "errmsg": "success",
  "trace_id": "0a0f120f637304feb06e4cabb166e702",
  "data": {
    "totalNum": 1,
    "orderList": [
      {
        "discountCode": "3MHSG",
        "cnpj": "1341351235",
        "orderId": "cbef3eed-b4d6-4be5-a2ac-71f1576a3148",
        "orderTime": 1743649061,
        "orderStatus": 1,
        "orderItemList": [
          {
            "orderItemId": "a3e7ae73-c1a3-460f-a606-45d9541bba8e",
            "productCode": "1001",
            "originalAmount": 5.00,
            "totalDiscount": 0.33,
            "stationDiscount": 0.26,
            "platformDiscount": 0.07,
            "paymentAmount": 4.67,
            "quantity": 1.32,
            "partnershipFee": 0
          },
          {
            "orderItemId": "c549965d-c484-4bc1-b606-9f847adc7193",
            "productCode": "123",
            "originalAmount": 5.00,
            "totalDiscount": 0.23,
            "stationDiscount": 0.18,
            "platformDiscount": 0.05,
            "paymentAmount": 4.77,
            "quantity": 0.911,
            "partnershipFee": 0
          }
        ]
      }
    ]
  }
}

5.1.9 Example Response (No Matching Data)

If no matching data exists: Return totalNum=0 and empty orderList.

json
{
  "errno": 0,
  "errmsg": "success",
  "trace_id": "0a0f120f637304feb06e4cabb166e702",
  "data": {
    "totalNum": 0,
    "orderList": []
  }
}

5.2 /queryByIds

Description

Query the order data API interface by the orderId collection.

When the order data returned by RMS is missing, 99 will use orderIds to query the order data of RMS.

For example: When 99 had 100 orders on the previous day but the RMS returned less than 100, 99 will use the set of orderIds that the RMS did not return to query again

Domain: https://www.YourDomainName.com/order/v1

URL: /queryByIds

Request Method: POST

Content-Type: application/json

Request Traffic Limit: <= 5 QPS (request per second)

5.2.1 Request Parameters

The header of the request must contain a valid signature, and the request body should include the following JSON data:

Parameter NameParameter TypeRequiredParameter ExplanationExample
trace_idstringYestrace_id is the id of the 99 internal request log record. When troubleshooting system issues, trace_id is used for log search. RMS needs to include trace_id when the API request returns the result0a0f120f637304feb06e4cabb166e702
orderIdListarrayYesA list of order_id values3b146f42-180e-4bc1-960f-8efe907e00001
cnpjstringYesThe CNPJ of the gas station147835135

5.2.2 Example Request

curl
curl --location --request POST 'https://www.YourDomainName.com/order/v1/queryByIds' \
--header 'Authorization: DIDI-AUTH-SHA256|{"api_key":"de2b29daf0cb69bde91a2622779b43b1","nonce_string":"g3oB6qC7ep4CpgzziReyvW68HlQtGfvp","timestamp":"1760684986","signature":"F269FFEDA4DEE2FE9B7593AD79C29D75450CAF3C23A927A3606C007B7C0F83D9"}' \
--header 'Content-Type: application/json' \
--data '{
    "trace_id": "0a0f120f637304feb06e4cabb166e702",
    "cnpj": "1478351357824",
    "orderIdList": [
      "3b146f42-180e-4bc1-960f-8efe907e00001",
      "d290f1ee-6c54-4b01-90e6-d701748f00002"
  ]
}'

5.2.3 Response Parameters

Parameter NameParameter TypeRequiredParameter ExplanationExample
errmsgstringYesError prompt. When the HTTP code is 200, this field is empty or "success"; otherwise, it is an error promptsuccess
errnointYesError code definition:
- 0: Request successful
- 400x: Client-side error (e.g., invalid parameters, expired timestamp)
- 50000: Server-side error (e.g., RMS internal error)
40001
trace_idstringYesReturn the trace_id in the 99 request parameter0a0f120f637304feb06e4cabb166e702
dataarrayYesOrder data collection

5.2.4 Data Response Parameters (Order Dimension)

Parameter NameParameter TypeRequiredParameter Explanation
discountCodestringYesDiscount code
cnpjstringYesCNPJ of gas station
orderIdstringYes99 order id, returned by 99 API as order_id
orderTimeintYesOrder (completion) time, Standard timestamp format(in seconds).
orderStatusstringYes1. completed
2. refunded (after payment)
3. others
orderItemListarrayYes99 order item list

5.2.5 Order Item Response Parameters (Sub Order Dimension)

Parameter NameParameter TypeRequiredParameter Explanation
orderItemIdstringYes99 sub-order id, returned by 99 API as order_id
productCodestringNoExternal product identifier
originalAmountfloatYesOriginal price of the line
totalDiscountfloatYesTotal discount amount of the line
stationDiscountfloatYesDiscount amount provided by gas station for the line item
platformDiscountfloatYesDiscount amount provided by 99 for the line item
paymentAmountfloatYesUser payment amount (after discount) of the line
quantityfloatYesFuel Product quantity
partnershipFeefloatYesAmount taken by 99

5.2.6 Example Response

json
{
  "errno": 0,
  "errmsg": "success",
  "trace_id": "0a0f120f637304feb06e4cabb166e702",
  "data": [
    {
      "discountCode": "3MHSG",
      "cnpj": "1341351235",
      "orderId": "cbef3eed-b4d6-4be5-a2ac-71f1576a3148",
      "orderTime": 1743649061,
      "orderStatus": 1,
      "orderItemList": [
        {
          "orderItemId": "a3e7ae73-c1a3-460f-a606-45d9541bba8e",
          "productCode": "1001",
          "originalAmount": 5.00,
          "totalDiscount": 0.33,
          "stationDiscount": 0.26,
          "platformDiscount": 0.07,
          "paymentAmount": 4.67,
          "quantity": 1.32,
          "partnershipFee": 0
        },
        {
          "orderItemId": "c549965d-c484-4bc1-b606-9f847adc7193",
          "productCode": "123",
          "originalAmount": 5.00,
          "totalDiscount": 0.23,
          "stationDiscount": 0.18,
          "platformDiscount": 0.05,
          "paymentAmount": 4.77,
          "quantity": 0.911,
          "partnershipFee": 0
        }
      ]
    }
  ]
}

5.2.7 Example Response (No Matching Data)

If no matching data exists: Return empty data

json
{
  "errno": 0,
  "errmsg": "success",
  "trace_id": "0a0f120f637304feb06e4cabb166e702",
  "data": []
}

Reconciliation API Document Update Log

Description

This log records all update histories of the API document, including new APIs, field adjustments, function optimizations, bug fixes, etc. It helps external integrators track changes and adapt to the integration work. Update records are sorted in descending order of version numbers, with the latest updates displayed first.

Update Records

V1.0.0 - 2026-02-10

  1. Released the initial version,Clarified API calling specifications, signature rules, error code definitions, and data format descriptions.
  • API interface:/queryByDate
  • API interface:/queryByIds