Querying Signing Status(By contract_id)

Update Time:2025.01.07

The signing relationship query interface provides the single transaction signing relationship query


1. API Intro

Applicable object: Common mode Institutional mode

Request Url: https://apihk.mch.weixin.qq.com/v3/global/papay/contracts/{contract_id}

Request method: GET

 

Path parameter is a path parameter.

Query parameter needs to be passed in the request URL.

Body parameter needs to be passed in the request JSON.


2. Request Parameters

Name

Variable Name

Type

Required

Description

App ID

appid

string[1,32]

Yes

Query Appid bound to the merchant ID
Note: Only for Common mode
Example: wxcbda96de0b165486

Sub-merchant ID

sub_mchid

string[1,32]

Yes

Query Sub-merchant ID allocated by WeChat Pay
Note: Only for Institutional mode
Example: 10000097

App ID of the service provider

sp_appid

string[1,32]

Yes

Query Appid bound to the service provider
Note: Only for Institutional mode
Example: wxcbda96de0b165486

App ID of the sub-merchant

sub_appid

string[1,32]

No

Query Appid bound to the sub-merchant ID for initiating signing
Note: Only for Institutional mode
Example: wxcbda96de0b165484

Auto-debit contract ID

contract_id

string[1,64]

Yes

Path Auto-debit contract ID returned by WeChat after successful Auto-debit signing; this parameter is required when contract_id is selected to perform query
Example: 100005698

Example:

Scenario 1:Common mode

1https://apihk.mch.weixin.qq.com/v3/global/papay/contracts/100005698?appid=wxcbda96de0b165486    

Scenario 2:Service Provide Mode/Institution Mode

1https://apihk.mch.weixin.qq.com/v3/global/papay/contracts/100005698?sub_mchid=10000097&sp_appid=wxcbda96de0b165486&sub_appid=wxcbda96de0b165484  

 

3. Response Parameters

Name

Variable Name

Type

Required

Description

Merchant ID

mchid

string[1,32]

Yes

Merchant ID allocated by WeChat Pay
Note: Only for Common mode
Example: 10000091

App ID

appid

string[1,32]

Yes

Appid bound to the merchant ID
Note: Only for Common mode
Example: wxcbda96de0b165486

Merchant ID of the service provider

sp_mchid

string[1,32]

Yes

The institution's merchant ID allocated by WeChat Pay
Note: Only for Institutional mode
Example: 10000098

Sub-merchant ID

sub_mchid

string[1,32]

Yes

Sub-merchant ID allocated by WeChat Pay
Note: Only for Institutional mode
Example: 10000097

App ID of the service provider

sp_appid

string[1,32]

Yes

Appid bound to the service provider’s Official Account
Note: Only for Institutional mode
Example: wxcbda96de0b165486

App ID of the sub-merchant

sub_appid

string[1,32]

No

Mini program appid of the sub-merchant who initiates the signing
Note: Only for Institutional mode
Example: wxcbda96de0b165484

Auto-debit contract ID

contract_id

string[1,32]

Yes

Auto-debit contract ID returned by WeChat after successful signing
Example: 100005698

Template ID

plan_id

Int

Yes

When a merchant applies for deduction permission to WeChat Pay, WeChat Pay will allocate a unique deduction template ID to the merchant
Example: 123

Signed contract No.

out_contract_code

string[1,32]

Yes

Signed contract No. passed in when the merchant requests signing, which must be unique at the merchant side
Example: 1023658866

Displayed user account name

user_display_name

string[1,32]

Yes

The name of the signing user, displayed on the page
Example: Zhang San

Agreement state

state

string[1,32]

Yes

NOTSIGN: Not signed
SIGNING: Signing
SIGNED: Signed
TERMINATING: Terminating the contract
TERMINATED: Contract terminated
DELETE: Deleted
SIGNFAIL: Signing is failed
Example: SIGNED

Signing time of the contract

signed_time

string[1,32]

Yes

Signing time of the contract
Example: 2015-07-01T10:00:00+08:00

Terminating time of the contract

terminated_time

string[1,32]

No

When state is TERMINATED, the value indicates the terminating time of the contract
Example: 2015-09-01T10:00:00+08:00

Termination mode of the contract

termination_mode

int

No

When state is TERMINATED, the value indicates the termination mode of the contract  
USER-Terminated by the user
MERCHANT-Terminated by the merchant API 
PLATFORM-Terminated by the merchant platform 
Example: USER

Termination note

termination_note

string

No

When state is TERMINATED, the value indicates the termination note
Example: Cause of termination

User ID under the merchant’s appid

openid

string[1,128]

Yes

Openid of the user under the merchant’s appid
Note: Only for Common mode
Example: ouFhd5X9s9WteC3eWRjXV3lea123

Example:

Scenario 1:Common mode

1{
2	"mchid": "10000100",
3	"appid": " wx426b3015555b46be ",
4	"contract_id": "203",
5	"plan_id": 66,
6	"openid": " oHZx6uMbIG46UXQ3SKxVYEgw1LZs ",
7	"out_contract_code": " 1005 ",
8	"user_display_name": " test ",
9	"state": "TERMINATED",
10	"signed_time": "2015-07-01T10:00:00+08:00",
11	"terminated_time": "2015-09-01T10:00:00+08:00",
12	"termination_mode": "USER",
13	"termination_note": " delete ....",
14}    

Scenario 2:Service Provide Mode/Institution Mode

1{	"sp_mchid": "10000100",
2	"sub_mchid": " 1900000109",
3	"sp_appid": " wx426b3015555b46be ",
4	"contract_id": "203",
5	"plan_id": 66,
6	"openid": " oHZx6uMbIG46UXQ3SKxVYEgw1LZs ",
7	"out_contract_code": " 1005 ",
8	"user_display_name": " test ",
9	"state": "TERMINATED",
10	"signed_time": "2015-07-01T10:00:00+08:00",
11	"terminated_time": "2015-09-01T10:00:00+08:00",
12	"termination_mode": "EXPIRED",
13	"termination_note": " delete .... "
14}  


4. Error Codes

Error Codes

Error Message

Description

Solution

403

CONTRACT_NOT_EXIST

The contract cannot be found

Please check whether the request contract is correct or whether it is terminated.

400

PARAM_ERROR

Parameter error

Please check the request parameter format.

500

SYSTEMERROR

System error

Please try the request again

 

 

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2025 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global

Contact Us

Customer Service Tel

+86 571 95017

9:00-18:00 Monday-Friday GMT+8

Business Development

wxpayglobal@tencent.com

Developer Support

wepayTS@tencent.com

Wechat Pay Global

About Tenpay
Powered By Tencent & Tenpay Copyright© 2005-2025 Tenpay All Rights Reserved.