Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

alipay.intl.acquiring.offline.pay_2.0.2

The merchant can use this interface to initiate a barcode payment request.

Request

Service address

Request head

ParameterNameTypeLengthRequiredDescriptionSample
versionAPI versionString8YThe API version2.0.2
functionAPI nameString128YThe API namealipay.intl.acquiring.offline.pay
clientIdClient IDString32YThe unique ID assigned by Alipay to identify a client that makes API calls211xxxxxxxxxxxxxxx044
reqTimeRequest timeDatet ime/YDate time with timezone, see RFC 3339 Section 5.6 for details.2001-07-04T12:08:56+05:30
reqMsgIdRequest message IDString64YThe unique ID assigned by client to identify a request message1234567asdfasdf1123fda
reserveReserved parameterString256NKey/Value formatted parameter for future use{key/value}
signTypeSign typeString64NThe signature typeRSA2

Request body

ParameterNameTypeLengthRequiredDescriptionSample
partnerIdPartner IDString32YThe unique partner ID assigned by Alipay. This parameter identifies the settlement target that Alipay settles to.211xxxxxxxxxxxxxxxx512
productCodeProduct codeString64YThe payment product code can be:
  • AUTO_DEBIT: Multi-use agreement for auto-debit product. The agreement stays valid until it is explicitly cancelled.
  • AUTH_CAPTURE: Multi-use agreement for auth-capture product. The agreement stays valid until it is explicitly cancelled.
  • OFFLINE_PAY: offline payment.
  • OFFLINE_PAY
    merchantTransIdMerchant transaction IDString64YThe unique ID assigned by the merchant to identify a transaction.510xxxxxxxxxxxxxx002
    codeTypeCode typeString32YThe code type can be:
  • BARCODE
  • BARCODE
    identityCodeIdentity codeString64YThe barcode code value287xxxxxxxxxxx394
    orderOrder parametersOrder/Y

    See order for details.

    {
       "orderAmount":{
           "currency":"THB",
           "value":"239"
       },
       "orderTitle":"Women Summer Dress",
       "orderDetail":"New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10",
       "seller":{
           "secondaryMerchantId":"2188205006167080",
           "secondaryMerchantIndustry":"5691",
           "secondaryMerchantName":"Zara",
           "storeId":"S94908",
           "storeName":"Zara-Store #30",
           "terminalId": "Z98745DE89745"
       }
    }
    settleContractIdThe settlement contract ID.String64NThe value is defined in the settlement contract. For example, a merchant can have one contract for USD settlement and another one for CAD settlement. If not provided, the default value specified in the settlement contract is used.USD-1

    Response

    Response head

    ParameterNameTypeLengthRequiredDescriptionSample
    versionAPI versionString8YThe API version2.0.2
    functionAPI nameString128YThe API namealipay.intl.acquiring.offline.pay
    clientIdClient IDString32YThe unique ID assigned by Alipay to identify a client that makes API calls211xxxxxxxxxxxxxxx044
    respTimeResponse timeDatet ime/YDate time with timezone, see RFC 3339 Section 5.6 for details.2001-07-04T12:08:56+05:30
    reqMsgIdRequest message IDString64YThe unique ID assigned by client to identify a request message1234567asdfasdf1123fda
    reserveReserved parameterString256NKey/Value formatted parameter for future use{key/value}

    Response body

    ParameterNameTypeLengthRequiredDescriptionSample
    resultInfoResult infoResultInfo/Y

    See resultInfo for details.

    {
        "resultStatus": "S",
        "resultCodeId": "00000000",
        "resultCode":"SUCCESS",
        "resultMsg": "result message"
    }
    acquirementIdAlipay transaction IDString64CThe unique Alipay transaction ID.
    This parameter is required when resultCode is SUCCESS.
    2015xxxxxxxxxxxxxxxxxxxxx747
    merchantTransIdMerchant transaction IDString64CThe unique ID assigned by the merchant to identify a transaction.
    Note: This parameter is required when reultCode is SUCCESS.
    510xxxxxxxxxxxxxx002
    orderAmountOrder amountMoney/CThis value must be the same as that of orderAmount passed in the request.
    This parameter is required when reultCode is SUCCESS.

    See Money for details.

    {"currency":"USD", "value":"239"}
    payAmountThe actual amount the buyer paid.Money/CNote: This parameter is required when reultCode is SUCCESS, or refundActualCurrencyDifferentWithRefundCurrency is true.

    See Money for details.

    {"currency":"CNY", "value":"1481"}
    conversionRateConversion rateconversionRate/CThe exchage rate between orderAmount and payAmount.
    This parameter is required when reultCode is SUCCESS, or refundActualCurrencyDifferentWithRefundCurrency is true.

    See conversionRate for details.

    {
    "baseCurrency":"USD",
    "exchangeCurrency":"CNY",
    "rate":"6.9123"
    }
    createTimeCreate timeDate time/CThe time when the transaction is created. Date time with timezone, see RFC 3339 Section 5.6 for details.
    This parameter is required when reultCode is SUCCESS.
    2001-07-04T12:08:56+05:30
    userSiteUser siteString64YThe user site shows where the buyer's wallet app belongs:
  • ALIPAY_CN: Alipay China site
  • ALIPAY_CN
    userIdUser IDString64NThe user ID that identifies a user in the user site208xxxxxxxxxx012
    userLoginIdUser login IDString64NThe ID that the user uses to login to the wallet app. The ID is masked to protect the customer privacy.c***@gmail.com

    Sub-parameters

    order

    ParameterNameTypeLengthRequiredDescriptionSample
    orderAmountOrder amountMoney/YThe order amount.  See Money for details.{ "value" : "293", "currency" : "CNY" }
    orderTitleOrder titleString256YThe order titleWomen Summer Dress
    orderDetailOrder detailString400YThe detailed description of the orderNew White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10.
    sellerSellerSeller/CThe seller information.
    This parameter is required when siteNeeds is true.  See seller for details.
    {
        "secondaryMerchantId":"2188205006167080",
        "secondaryMerchantIndustry":"5691",
        "secondaryMerchantName":"Zara"
    }
    buyerIdBuyer IDString32NThe buyer ID.
    This parameter is required when function is alipay.intl.acquiring.offline.create
    208xxxxxxxxxx234

    seller

    ParameterNameTypeLengthRequiredDescriptionSample
    secondaryMerchantIdSecondary merchant IDString64YThe unique secondary merchant ID distinguishes each specific sub merchants.123456123456123456
    secondaryMerchantIndustryMCC(Merchant Category Code)String64YThe secondary merchant industry.  See Merchant category code for details.5691
    secondaryMerchantNameSecondary merchant nameString512YThe secondary merchant nameZara
    storeIdStore IDString64YThe store IDsid-123
    storeNameStore nameString256YThe store nameZara Main Store
    terminalIdPOS terminal IDString64NThe POS terminal IDtid-3489439085
    operatorIdOperator ID.String64NThe operator IDJuliet-001

    Money

    ParameterNameTypeLengthRequiredDescriptionSample
    currencyCurrencyString3Y

    The 3-letter currency code. See supported currencies for details.

    USD
    valuevalueNumber16YThe amount. This value must be provided in the smallest common currency unit. For example, to create a charge for $1.00, you can set orderAmount: value=100 (100 cents).239

    resultInfo

    ParameterNameTypeLengthRequiredDescriptionSample
    resultStatusResult statusString2YThe request status can be:
  • S: success
  • F: failure
  • U: unknown
  • S
    resultCodeIdResult IDString8YAn 8-digit code that is used to identify a result. When resultStatus is S, the value must be 00000000. When resultStatus is F or U, the value can be other result ID specified by the interface.00000000
    resultCodeResult codeString64YThe result codeSUCCESS
    resultMsgResult messageString256NWhen resultCode is S, this value can be empty. When resultCode is F or U, the error description is required.success

    conversionRate

    ParameterNameTypeLengthRequiredDescriptionSample
    baseCurrencyBase currencyString3YThe base currencyUSD
    exchangeCurrencyExchange currencyString3YThe exchange currencyCNY
    rateRateString16YThe exchange rate of baseCurrency against exchangeCurrency6.9123

    Result code

    Functional logic result code

    ResultIDResultCodeResultStatusRemarks
    00000025REPEAT_REQ_INCONSISTENTFRepeated or inconsistent requests
    00000011RISK_REJECTFThe payment is declined because of risk control reasons.
    12002005USER_NOT_EXISTFThe user does not exist.
    12002006USER_STATUS_ABNORMALFAbnormal user status
    12005001CURRENCY_NOT_SUPPORTF

    The transaction currency is not supported. See supported currencies for details.

    12005104AMOUNT_EXCEED_LIMITFThe amount exceeds the limit.
    12005128COUNT_EXCEED_LIMITFThe count exceeds the limit.
    12006004USER_BALANCE_NOT_ENOUGHFInsufficient user balance
    12005131IDENTITY_CODE_INVALIDFThe identityCode is invalid.
    12005132IDENTITY_CODE_NOT_SUPPORTFThe format of the identity code is NOT supported. For example, the identity code is from an unsupported wallet.
    12005124PAYMENT_IN_PROCESSUThe payment is still in process.
    12005100ORDER_IS_CLOSEDFThe transaction status is closed.
    12005003ORDER_STATUS_INVALIDFThe transaction status is invalid.
    12002046USER_AMOUNT_EXCEED_LIMITFThe user amount exceeds the limit.
    12002004USER_REALNAME_STATUS_INVALIDFThe user needs to complete the real name authentication.
    12002010USER_NO_PAYMENT_INSTRUMENTFNo payment instrument is applicable.
    12002003USER_BALANCE_PAY_OFFFThe balance payment is turned off.
    12005134SIGN_TYPE_INVALIDFThe signature type is invalid.
    12005135SIGN_TYPE_NOT_SUPPORTFThe signature type is not supported.

    Basic result code

    ResultIDResultCodeResultStatusRemarks
    00000000SUCCESSSSuccess
    00000019PROCESS_FAILFGeneral business failure
    00000901UNKNOWN_EXCEPTIONUAPI failed because of unknown reasons
    00000004PARAM_ILLEGALFThe parameter is incorrect.
    00000007INVALID_SIGNATUREFThe signature is invalid.
    00000008KEY_NO_FOUNDFThe key is not found.
    00000013NO_INTERFACE_DEFFThe API is undefined.
    00000014API_IS_INVALIDFThe API is invalid or nonactivated.
    00000016OAUTH_FAILEDFThe oAuth authentication failed.
    00000021ACCESS_DENIEDFAccess denied
    12014152CLIENT_FORBIDDEN_ACCESS_APIFThe Client is not authorized to use this API.
    12014155UNKNOWN_CLIENTFUnknown client
    12014156INVALID_CLIENT_STATUSFInvalid client status
    00000024REQUEST_TRAFFIC_EXCEED_LIMITFThe request traffic exceeds the limit.

    Sample

    Sample request

    copy
    {
        "request": {
            "body": {
                "codeType": "BARCODE",
                "createTime": "2001-07-04T12:08:56+05:30",
                "identityCode": "285045665857162726",
                "merchantTransId": "gemxxxxxxxqge",
                "order": {
                    "orderAmount": {
                        "currency": "JPY",
                        "value": "1"
                    },
                    "orderDetail": "New123",
                    "orderTitle": "men",
                    "seller": {
                        "operatorId": "test_operator_id",
                        "secondaryMerchantIndustry": "5812",
                        "secondaryMerchantName": "buzhimerchantname",
                        "sellerId": "211xxxxxxxxxxxxxxx413",
                        "storeId": "211xxxxxxxxxxxxxxx413",
                        "storeName": "buzhistorename",
                        "terminalId": "testterminalId"
                    }
                },
                "partnerId": "211xxxxxxxxxxxxxxx413",
                "productCode": "OFFLINE_PAY",
                "settleContractId": "JPY"
            },
            "head": {
                "clientId": "385xxxxxxxxxx708",
                "function": "alipay.intl.acquiring.offline.pay",
                "reqMsgId": "1234567asdfasdf1123fda",
                "reqTime": "2001-07-04T12:08:56+05:30",
                "reserve": {},
                "signType": "SHA256",
                "version": "2.0.2"
            }
        },
        "signature": "2c18e55211fd03aec046d4ac52c9c96de04fb277232c7adfd8a3018398a54d46"
    }

    Sample response

    copy
    { 
        "response":{ 
            "head":{ 
                "version":"2.0.2", 
                "function":"alipay.intl.acquiring.offline.pay", 
                "clientId":"211xxxxxxxxxxxxxxx044", 
                "respTime":"2001-07-04T12:08:56+05:30", 
                "reqMsgId":"1234567asdfasdf1123fda", 
                "reserve":"{}" 
            }, 
            "body":{ 
                "resultInfo":{ 
                    "resultStatus":"S", 
                    "resultCodeId":"00000000", 
                    "resultCode":"SUCCESS", 
                    "resultMsg":"success" 
                }, 
                "acquirementId":"2015032412007101547201351234", 
                "merchantTransId":"510xxxxxxxxxxxxxx002", 
                "orderAmount":{ 
                    "currency":"USD", 
                    "value":"239" 
                }, 
                "createTime":"2001-07-04T12:08:56+05:30", 
                "userSite":"ALIPAY_CN", 
                "userId":"208xxxxxxxxxx012", 
                "userLoginId":"c***@gmail.com" 
            } 
        }, 
        "signature":"signature string" 
    }