Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 3.06 KB

AlipayTradeSettleApi.md

File metadata and controls

80 lines (61 loc) · 3.06 KB

AlipayTradeSettleApi

All URIs are relative to https://openapi.alipay.com

Method HTTP request Description
confirm POST /v3/alipay/trade/settle/confirm 统一收单确认结算接口

confirm

AlipayTradeSettleConfirmResponseModel confirm(alipayTradeSettleConfirmModel)

统一收单确认结算接口

用户付款后,平台上的卖家发货,用户收到商品确认收货后,平台通过确认结算接口,将交易款结算给指定的卖家账户。 单笔结算到卖家余额的场景支持分账冻结。在确认结算时,传入冻结标识 royalty_freeze=true,资金结算到卖家支付宝余额后,会先冻结在不可用余额中,后续分账将自动从冻结余额划出,平台商可调用分账完结释放冻结资金,系统默认在冻结30天后自动解冻。解冻后,仍可以发起分账。为保证分账成功率,请尽可能在分账冻结期内分账。

Example

// Import classes:
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.Configuration;
import com.alipay.v3.util.*;
import com.alipay.v3.api.models.*;
import com.alipay.v3.api.AlipayTradeSettleApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://openapi.alipay.com");
    // 设置alipayConfig参数(全局设置一次)
    AlipayConfig config = new AlipayConfig();
    config.setAppId("app_id");
    config.setPrivateKey("private_key");
    config.setAlipayPublicKey("alipay_public_key");
    config.setEncryptKey("encrypt_key");
    defaultClient.setAlipayConfig(config);

    AlipayTradeSettleApi apiInstance = new AlipayTradeSettleApi(defaultClient);
    AlipayTradeSettleConfirmModel alipayTradeSettleConfirmModel = new AlipayTradeSettleConfirmModel(); // AlipayTradeSettleConfirmModel | 
    try {
      AlipayTradeSettleConfirmResponseModel result = apiInstance.confirm(alipayTradeSettleConfirmModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayTradeSettleApi#confirm");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
alipayTradeSettleConfirmModel AlipayTradeSettleConfirmModel [optional]

Return type

AlipayTradeSettleConfirmResponseModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 common response -
0 请求失败 -