代运营授权
简介
补全商家信息
适用商家:仅间连商家
绑定商家支付宝账号(可选)
适用商家:仅间连商家
PC 端代绑定
1.

1.

接口代绑定
发起代绑定申请
直接申请
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenSpOperationApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenSpOperationApiApply {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenSpOperationApi api = new AlipayOpenSpOperationApi();
AlipayOpenSpOperationApplyModel data = new AlipayOpenSpOperationApplyModel();
data.setAccessProductCode("OPENAPI_BIND_DEFAULT");
data.setOutBizNo("2020124234523465636345634");
data.setMerchantNo("2088XXXX");
data.setIsvScenePermissions("SHOP_MANAGE:SHOP_MANAGE_BASE;MINI_APP_OPER:MINI_APP_OPER_BASE;PROMOTION_MANAGE:PROMOTION_MANAGE_BASE;OPERATION_POINTS:OPERATION_POINTS_BASE");
data.setOperateType("ACCOUNT_BIND");
data.setAlipayAccount("xxx@gmail.com");
try {
AlipayOpenSpOperationApplyResponseModel response = api.apply(data);
} catch (ApiException e) {
AlipayOpenSpOperationApplyDefaultResponse errorObject = (AlipayOpenSpOperationApplyDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
授权二维码
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenSpOperationQrcodeApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenSpOperationQrcodeApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenSpOperationQrcodeApi api = new AlipayOpenSpOperationQrcodeApi();
String outBizNo = "2020124234523465636345634";
String operateType = "OPERATION_AUTH";
String merchantNo = "2088XXXX";
String alipayAccount = "xxx@gmail.com";
String accessProductCode = "OPENAPI_AUTH_DEFAULT";
String isvScenePermissions = "SHOP_MANAGE:SHOP_MANAGE_BASE;PROMOTION_MANAGE:PROMOTION_MANAGE_BASE";
try {
AlipayOpenSpOperationQrcodeQueryResponseModel response = api.query(outBizNo, operateType, merchantNo, alipayAccount, accessProductCode, isvScenePermissions);
} catch (ApiException e) {
AlipayOpenSpOperationQrcodeQueryDefaultResponse errorObject = (AlipayOpenSpOperationQrcodeQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
查询绑定结果** **
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenSpOperationResultApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenSpOperationResultApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenSpOperationResultApi api = new AlipayOpenSpOperationResultApi();
String operateType = "ACCOUNT_BIND";
String batchNo = "2020222342342";
String accessProductCode = "OPENAPI_BIND_DEFAULT";
String merchantNo = "2088912341234123";
String alipayAccount = "testaccount@test.com";
String isvScenePermissions = "SHOP_MANAGE:SHOP_MANAGE_BASE;PROMOTION_MANAGE:PROMOTION_MANAGE_BASE";
try {
AlipayOpenSpOperationResultQueryResponseModel response = api.query(operateType, batchNo, accessProductCode, merchantNo, alipayAccount, isvScenePermissions);
} catch (ApiException e) {
AlipayOpenSpOperationResultQueryDefaultResponse errorObject = (AlipayOpenSpOperationResultQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
代运营授权
移动端发起授权
接口发起授权
发起代运营授权
直接申请

package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenSpOperationApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenSpOperationApiApply {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenSpOperationApi api = new AlipayOpenSpOperationApi();
AlipayOpenSpOperationApplyModel data = new AlipayOpenSpOperationApplyModel();
data.setAccessProductCode("OPENAPI_BIND_DEFAULT");
data.setOutBizNo("2020124234523465636345634");
data.setMerchantNo("2088XXXX");
data.setIsvScenePermissions("SHOP_MANAGE:SHOP_MANAGE_BASE;MINI_APP_OPER:MINI_APP_OPER_BASE;PROMOTION_MANAGE:PROMOTION_MANAGE_BASE;OPERATION_POINTS:OPERATION_POINTS_BASE");
data.setOperateType("ACCOUNT_BIND");
data.setAlipayAccount("xxx@gmail.com");
try {
AlipayOpenSpOperationApplyResponseModel response = api.apply(data);
} catch (ApiException e) {
AlipayOpenSpOperationApplyDefaultResponse errorObject = (AlipayOpenSpOperationApplyDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
授权二维码

package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenSpOperationQrcodeApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenSpOperationQrcodeApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenSpOperationQrcodeApi api = new AlipayOpenSpOperationQrcodeApi();
String outBizNo = "2020124234523465636345634";
String operateType = "OPERATION_AUTH";
String merchantNo = "2088XXXX";
String alipayAccount = "xxx@gmail.com";
String accessProductCode = "OPENAPI_AUTH_DEFAULT";
String isvScenePermissions = "SHOP_MANAGE:SHOP_MANAGE_BASE;PROMOTION_MANAGE:PROMOTION_MANAGE_BASE";
try {
AlipayOpenSpOperationQrcodeQueryResponseModel response = api.query(outBizNo, operateType, merchantNo, alipayAccount, accessProductCode, isvScenePermissions);
} catch (ApiException e) {
AlipayOpenSpOperationQrcodeQueryDefaultResponse errorObject = (AlipayOpenSpOperationQrcodeQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
查询授权结果
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenSpOperationResultApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenSpOperationResultApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenSpOperationResultApi api = new AlipayOpenSpOperationResultApi();
String operateType = "ACCOUNT_BIND";
String batchNo = "2020222342342";
String accessProductCode = "OPENAPI_BIND_DEFAULT";
String merchantNo = "2088912341234123";
String alipayAccount = "testaccount@test.com";
String isvScenePermissions = "SHOP_MANAGE:SHOP_MANAGE_BASE;PROMOTION_MANAGE:PROMOTION_MANAGE_BASE";
try {
AlipayOpenSpOperationResultQueryResponseModel response = api.query(operateType, batchNo, accessProductCode, merchantNo, alipayAccount, isvScenePermissions);
} catch (ApiException e) {
AlipayOpenSpOperationResultQueryDefaultResponse errorObject = (AlipayOpenSpOperationResultQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
{
"code":"unknow-error",
"message":"系统繁忙"
}
消息通知

消息触发条件
消息示例
ISV_GATEWAY_URL?charset=GBK&biz_content=
{
"operate_type":"ACCOUNT_BIND","batch_no":"20202314234243","out_biz_no":"2020124234523465636345634","handle_status":"SUCCESS","merchant_no":"2088XX","bind_user_id":"2088XX"
}
&msg_method=alipay.open.sp.operation.result.notify&utc_timestamp=1516797622752&version=1.1&sign_type=RSA2¬ify_id=d275fec564e62af6bedbcee73f3f05fi5x&app_id=2013121700999429&sign=I+Y/lvqYUEEc10EPdpntRhFIQ==
消息参数说明:
修改于 2023-11-23 08:30:54