alipay.dut.customer.agreement.unsign

This interface can be used by merchant to cancel/unbind the three-party payment agreement signed by the merchant, Alipay and the user.

Request

Service address

Environment

HTTPS request URL

Production environment

https://intlmapi.alipay.com/gateway.do

Test environment

https://mapi.alipaydev.com/gateway.do

Request parameters

ParameterDescription
Basic parameter

service

String Required

Service name

Example:alipay.dut.customer.agreement.unsign

partner

String(16) Required

The partner ID that is assigned by Alipay to identify an Alipay account. The partner ID is composed of 16 digits and begins with 2088.

Example:2088001159940003

_input_charset

String

The charset with which the request data are encoded. UTF-8 is supported.

Example:UTF-8

sign_type

String Required

Sign type. DSA, RSA, and MD5 are supported. Use uppercase.

Example:RSA

sign

String Required

Sign value

Example:e5815a4556db338ed237f7d3fd222184

notify_url

String(200)

The URL for receiving asynchronous notifications after the payment is completed.

Example:https://www.merchant.com/notify_address

Business parameter

product_code

String(64) Required

The code that identifies a payment solution signed between Alipay and the merchant partner

Example:GENERAL_WITHHOLDING_P

alipay_user_id

String(32)

The unique ID in Alipay for the user, which is composed of 16 digits and begins with 2088. Fields alipay_user_id and alipay_logon_id cannot be null at the same time. If both are provided, alipay_user_id is used.

Example:2088101122675263

alipay_logon_id

String(100)

User's login ID, which is an email address or a cell phone number. Fields alipay_user_id and alipay_logon_id cannot be null at the same time. If both are provided, alipay_user_id is used.

Example:abx@alitest.com

third_party_type

String(32)

Type of the third party who signs the agreement with Alipay and Alipay user. The default value is PARTNER.

Example:MERCHANT

scene

String(100) Required

The code for specific scenario, identifying a business case which is agreed between Alipay and the merchant.

Example:INDUSTRY|MEDICAL

app_id

String

The app ID of the merchant on Alipay global open platform

Example:2014071600176280

external_sign_no

String(32) Required

The unique three-party payment agreement number

Example:e8qdwl9casxor13

Response

Synchronous response

ParameterDescription

is_success

String Required

Indicate whether the request succeeds at gateway level.

Example:T

error

String

Error code. This field is required when the value of is_success is F.

Example:ILLEGAL_SIGN

Asynchronous response

ParameterDescription
Basic Parameter

notify_time

String Required

The time in GMT+8 when the notification is sent. The time format is yyyy-MM-dd HH:mm:ss. 

Example:2014-09-16 16:36:59

notify_type

String Required

Notification type

Example:dut_user_unsign

notify_id

String Required

Notification ID, used by the partner system to verify the notification

Example:af23ec9978084df827d552369be76a5leg

sign_type

String Required

Sign type. DSA and RSA are supported. Use uppercase.

Example:RSA

sign

String Required

Sign value

Example:b1af584504b8e845ebe40b8e0e753729

Business Parameter

agreement_no 

String Required

The unique identifier for the agreement

Example:20141020000353099885

product_code

String Required

The code that identifies a payment solution signed between Alipay and the user

Example:GENERAL_WITHHOLDING_P  

scene

String

The code for specific scenario, identifying a business case which is agreed between Alipay and the merchant. 

Example:INDUSTRY|MEDICAL

status

String Required

The current status of the agreement, with a value of UNSIGN for this interface.

Example:UNSIGN

alipay_user_id

String Required

The unique ID in Alipay for the user, which is composed of 16 digits and begins with 2088. Fields alipay_user_id and alipay_logon_id cannot be null at the same time. If both are provided, alipay_user_id is used.  

Example:2088002008073305

unsign_time

String Required

Actual time in GMT +8 when the Alipay payment agreement is unsigned. The time format is yyyy-MM-dd HH:mm:ss.

Example:2014-10-20 11:49:19

sign_modify_time

String Required

The last time in GMT +8 when the Alipay payment agreement is modified. The time format is yyyy-MM-dd HH:mm:ss.

Example:2014-10-20 11:49:19

external_sign_no

String

The unique number of the three-party payment agreement provided by the partner

Example:e8qdwl9casxor13

Error codes

Access errors

Error codeDescription
SYSTEM_ERRORSystem error.
SESSION_TIMEOUTSession timeout.
ILLEGAL_TARGET_SERVICEThe signature fails the verification.
ILLEGAL_ACCESS_SWITCH_SYSTEMThe signature method is unsupported.
ILLEGAL_SWITCH_SYSTEMTarget service is illegal.
EXTERFACE_IS_CLOSEDThe interface name is invalid.

Business errors

Error codeDescription
AGREEMENT_NOT_EXISTThe agreement is not exist
USER_NOT_EXIST_ERRORThe user is not exist
ILLGALE_ARGUMENTIllegal argument.
ILLEGAL_SIGNIllegal sign.
ILLEGAL_DYN_MD5_KEYDynamic MD5 key is illegal.
ILLEGAL_ENCRYPTIllegal encrypt.
ILLEGAL_SERVICEWrong service.
ILLEGAL_USERWrong user id.
ILLEGAL_PARTNERWrong partner id.
ILLEGAL_EXTERFACEIllegal external interface config.
ILLEGAL_PARTNER_EXTERFACEIllegal partner external interface config.
ILLEGAL_SECURITY_PROFILEIllegal security profile.
ILLEGAL_SIGN_TYPEIllegal sign type.
ILLEGAL_CHARSETIllegal charset.
ILLEGAL_CLIENT_IPClient IP has no access permission.
HAS_NO_PRIVILEGEHas no privilege.
ILLEGAL_DIGEST_TYPEIllegal digest type.
ILLEGAL_ENCODINGIllegal encoding.
ILLEGAL_SYSTEMIllegal system.
ILLEGAL_REQUEST_REFERERIllegal request referrer. Used for phising attack prevention.

Samples

Request sample

https://mapi.alipay.com/gateway.do?sign=ba77c7f7a1fd0324cc906f1aa9a7ffb3&product_code=ONE_KEY_BUY&sign_type=RSA&service=alipay.dut.customer.agreement.unsign&partner=2088001159940003&alipay_user_id=2088101122675263

Response sample

Synchronous response sample

The agreement is unsigned successfully:

copy
<?xml version="1.0" encoding="utf-8"?>
<alipay>
    <is_success>T</is_success>
    <request>
        <param name="sign">ba77c7f7a1fd0324cc906f1aa9a7ffb3</param>
        <param name="product_code">ONE_KEY_BUY</param>
        <param name="sign_type">RSA</param>
        <param name="service">alipay.dut.customer.agreement.unsign</param>
        <param name="alipay_user_id">2088101122675263</param>
        <param name="partner">2088001159940003</param>
    </request>
    <response>
        <result/>
    </response>
</alipay>

The agreement is failed to be unsigned:

copy
<?xml version="1.0" encoding="utf-8"?>
<alipay>
    <is_success>F</is_success>
    <error>ILLEGAL_SIGN</error>
</alipay>

Asynchronous response sample

http://merchant.com/alipay/notify_url.php?notify_time=2014-10-20+11%3A33%3A36&notify_type=dut_user_unsign&notify_id=df35c47ed9df1fe4157a555e5c1f4a39&sign_type=MD5&sign=b1af584504b8e845ebe40b8e0e733729&agreement_no=20141020000353099885&product_code=GENERAL_WITHHOLDING_P&scene=INDUSTRY|MEDIA&status=UNSIGN&alipay_user_id=2088002008073305&unsign_time=2014-10-20+11%3A49%3A19&sign_modify_time=2014-10-20+11%3A49%3A19

copy
http://merchant.com/alipay/notify_url.php
notify_time=2014-10-20 11:33:36
notify_type=dut_user_unsign
notify_id=df35c47ed9df1fe4157a555e5c1f4a39
sign_type=MD5
sign=b1af584504b8e845ebe40b8e0e733729
agreement_no=20141020000353099885
product_code=GENERAL_WITHHOLDING_P
scene=INDUSTRY|MEDIA
status=UNSIGN
alipay_user_id=2088002008073305
unsign_time=2014-10-20 11:49:19
sign_modify_time=2014-10-20 11:49:19