Check If Order Is Paid Interface

Check the payment status of the specified order, confirm whether the order has been paid.

Precautions

  • This interface uses the GET method
  • Order ID parameter is required
  • Need user login verification (verify whether the order belongs to the current user)
  • Return the payment status information of the order
  • Can only query the orders of the current user

Request address

{域名地址}/api/payment/check

Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/payment/check

Request syntax

GET {域名地址}/api/payment/check

Request header

This interface also involves common request headers. For more information, please seeCommon Request Headers (Common Request Headers).

Request Parameters

Field Name Type Required Description
order_id string Yes Order ID

Response Headers

This interface only involves public response headers. More information, please refer toCommon Request Headers (Common Request Headers).

Return parameters

Field Name Type Description
code integer Error code
message string Error Description

Example Usage

Request Example

GET /api/payment/check?order_id=202211232209080046 HTTP/1.1
Host: www.anqicms.com

Response example (payment successful)

{
  "code": 0,
  "msg": "支付成功"
}

Response Example (Unpaid)

{
  "code": -1,
  "msg": "未支付"
}

Error Code

Error code Description
0 OK (Order Paid)
-1 Error, the error reason is indicated in the msg (such as unpaid)
1001 Not logged in
1002 Unauthorized (Order does not belong to the current user)
200 API request OK