Open API V2 Upgrade Guide
- v2 introduces a unified order placement process, a payment method details interface, field renaming, and unified response formatting.
1) Interface Changes
- New
/openapi/v2/order/payment-method: Retrieves details (URL, QR code, variants) of the payment method associated with an order.
- Merged/Restructured
- The v1 endpoints
/preOrder/createand/order/createare merged in v2, primarily using the single/order/createendpoint. The request body is unified intoPreOrderCreateRequestV2.
- The v1 endpoints
- Retained with Behavior/Model Changes
/refund/create,/refund/detail,/order/detail,/order/list,/merchant/asset/query,/merchant/asset/log/list,/country/list.
2) Request Parameter Changes
- Order Creation
/openapi/v2/order/create- New Required Fields:
outerOrderSn,outerUid,orderAmount,goods,orderCurrency,orderDesc,env. - Renamed/Deprecated:
outerOrder(v1) →outerOrderSn(v2).outerOrderis marked as deprecated in v2. - New Fields:
buyer(country),redirectUrl,deeplink(required whenenvis H5 or APP). - Removed or No Longer Required:
country,language,discountAmount;paymentSuccessRedirectUrl/paymentFailRedirectUrlare replaced byredirectUrl/deeplink.
- New Required Fields:
- Payment Method Details
/openapi/v2/order/payment-method- New request body
GetPaymentMethodRequest:methodIdis required; choose betweenorderSnandouterOrderSn(oneOf).
- New request body
- Order Details
/openapi/v2/order/detail- Request body remains
OrderDetailRequest, but v2 recommends usingpreSnorouterOrder(outerOrderis deprecated in the response, transitioning toouterOrderSn/orderSnis advised).
- Request body remains
- Order List
/openapi/v2/order/list- The
outerOrderListand time-window query logic are retained; the meaning and default values of pagination fields are described more clearly.
- The
- Refunds
RefundOrderCreateRequest:merchantRefundSn,outerOrderSn,reasonare required (format descriptions are consistent with v1 or stricter).
3) Response Parameter Changes
- Order Placement Response
- v1:
CreateRedotPayOrderResponse(sn,qrcodeId). - v2:
CreatePayOrderResponse(orderSn,outerOrderSn,h5Url,webUrl,appUrl,paymentMethods);preSndeprecated; newpaymentMethodslist for custom checkout pages.
- v1:
- Order Details
OrderDetailResponse- Field Renaming/Deprecation:
outerOrder→outerOrderSn(former deprecated)coin→cryptoCurrencybillCoin→billCurrencypaymentDeadline→timeExpirewalletName→paymentMethodsigner→txAddressdigitalAmountdeprecated, usecryptoAmount
refundSnis an array in v2.
- Field Renaming/Deprecation:
- Payment Method Details
GetPaymentMethodResponse(New in v2)- Provides
webUrl/h5Url/appUrl, corresponding*QrCode, andpaymentVariants(CAMERA_SCAN,REDIRECT,APP_LINK, etc.).
- Provides
- Unified Response Wrapper
- v2 responses are uniformly formatted as
code/msg/requestId/data. Thedatatype varies by interface (object, array, or paginated object).
- v2 responses are uniformly formatted as
4) Migration Guide (Simplified)
- Order Placement Logic Update
- Change
outerOrdertoouterOrderSn. Add the requiredenvfield (H5/WEB/APP). - Add handling for
buyer,redirectUrl,deeplink(required for H5/APP). - Update the frontend to use the returned
h5Url/webUrl/appUrlfor redirection or build a custom checkout page based onpaymentMethods.
- Change
- Add Payment Method Detail Call (Optional)
- In a custom checkout page, call
/order/payment-methodto get the URL/QR code/deep link andpaymentVariantsfor a specifiedmethodId.
- In a custom checkout page, call
- Response Parsing Update
- Update parsing mappings: use
orderSn/outerOrderSnas primary keys, and new fields likecryptoCurrency,billCurrency,timeExpire,paymentMethod,txAddress. - Handle the
refundSnarray; maintain compatibility for reading deprecated fields during transition.
- Update parsing mappings: use
- Order Query and List
- Keep the request structure, but adjust parsing for v2's unified wrapper; distinguish between single objects and arrays/paginated results.
- Account Asset and Country List
- Interface paths remain the same, but authentication headers need updating; follow v2 documentation for pagination and field meanings.
- Testing and Deployment
- Perform end-to-end regression testing on
tenv-acquirer.rp-2023app.com: order placement, payment method details, queries, refunds. - Incremental deployment and compatibility: temporarily keep reading of old fields, log usage of old fields, and phase them out gradually.
- Perform end-to-end regression testing on
- Key Breaking Changes
- Restructured order placement request and response.
- Field renaming and deprecation cleanup.
Updated 3 minutes ago
Did this page help you?
Updated 2 months ago
