{"openapi":"3.0.0","info":{"title":"A+ MS API","description":"A+MS is standard API for Glocal merchant acquiring service,the merchant initiates a payment request to local wallet and processes different payment results based on the status and operation instructions returned in the wallet response.","version":"1.0.5"},"servers":[{"url":"https://alipayplus.alipay.com/mobile-payment/wallet"}],"paths":{"/header":{"post":{"summary":"the header of the request, each request and response should contains the header","description":"Request Header","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeaderRequest"}}}},"security":[{"apikey":[]}],"tags":["Header"],"responses":{"200":{"description":"Response Header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeaderResponse"}}}}}}},"/v1/payments/pay":{"post":{"summary":"Payment","description":"payment api support the acquiring scenarios below : Cashier payment,payment code payment,order code payment,agreement pay,payment evaluate, authorization payment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"Payment Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/capture":{"post":{"summary":"capture after authorization","description":"capture after authorization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"Payment Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/inquiryPayment":{"post":{"summary":"Inquiry Payment","description":"This API is used to inquire the payment result, usually when not able to receive the payment result after a long period of time. Suggest inquiry with round-robin interval, recommended 5s once, up to 1 minute.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryPaymentRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"Inquiry Payment Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryPaymentResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/inquiryCapture":{"post":{"summary":"Inquiry Capture","description":"This API is used to inquire the capture result, usually when client is not able to receive the capture result after a long period of time. Suggest inquiry with round-robin interval, recommended 5s once, up to 1 minute.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryCaptureRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"Inquiry Capture Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryCaptureResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/notifyPayment":{"post":{"summary":"Notify Payment","description":"This API is used to send notification to merchant after the order is finished(SUCCESS or FAIL)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyPaymentRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"Notify Payment Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyPaymentResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/cancelPayment":{"post":{"summary":"Cancel Payment","description":"This API is used by merchant to cancel a transaction when the payment API call did NOT return a clear result, for example, when the payment API call timeout or SYSTEM_ERROR is returned. Upon the success of cancel API call, merchant could safely assume as if the transaction never happened..","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPaymentRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"Cancel Payment Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPaymentResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/refund":{"post":{"summary":"Refund","description":"This API is used to initiate a refund of a successful payment,refund a transaction and return money back to payer, the transaction can be refunded partially or fully.The api will return SUCCESS when deduct money from merchant succes.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"An array of products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/inquiryRefund":{"post":{"summary":"Inquiry Refund","description":"This api is used to query the specified refund information by refundId. If refundId is provided , refundRequestId will be ignored","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryRefundRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"An array of products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryRefundResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/notifyRefund":{"post":{"summary":"Notify Refund","description":"The refund notice mainly has two functions, notifying the merchant of the refund processing result and notifying the merchant to the refund has been cleared with PSP, so that the merchant will show the refund progress to the user (This doesn't mean the payer receives the refunded funds right away ).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyRefundRequest"}}}},"security":[{"apikey":[]}],"tags":["Payment"],"responses":{"200":{"description":"An array of products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyRefundResponse"}}}},"default":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apikey":{"type":"apiKey","name":"server_token","in":"query"}},"schemas":{"PayRequest":{"type":"object","required":["productCode","paymentRequestId","paymentAmount"],"description":"Idempotent fields are paymentRequestId, when retry same payment request, client need to promise paymentRequestId and other infos are the same.\n","properties":{"appId":{"type":"string","maxLength":32,"description":"the mini program id"},"productCode":{"type":"string","maxLength":32,"description":"the product code"},"salesCode":{"type":"string","maxLength":32,"description":"defined by wallet, wallet will use salesCode to get the contract config which include fee,limit info"},"paymentRequestId":{"type":"string","description":"The unqiue ID of a payment generated by merchant.","maxLength":64},"paymentAmount":{"$ref":"#/components/schemas/Amount"},"order":{"$ref":"#/components/schemas/Order"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentToken":{"type":"string","description":"if productCode is AGREEMENT_PAYMENT,then it's the accessToken of wallet user, if productCode is IN_STORE_PAYMENT, then it's the authcode of wallet user","maxLength":128},"paymentFactor":{"$ref":"#/components/schemas/PaymentFactor"},"paymentExpiryTime":{"type":"string","format":"date-time","description":"the payment order close time defined by merchant"},"paymentRedirectUrl":{"type":"string","description":"the redirect url defined by merchant","maxLength":1024},"paymentNotifyUrl":{"type":"string","description":"the payment success notify url defined by merchant","maxLength":1024},"extendInfo":{"type":"string","description":"the extend information,wallet and merchant can put extend info here","maxLength":4096}}},"PayResponse":{"required":["result"],"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`REPEAT_REQ_INCONSISTENT`, `F`, Repeat submit, and requests are inconsistent.\n\n`ACCEPT`, `A`, need next action according to actionForm.\n\n`PROCESS_FAIL`, `F`, General business failure. No retry.\n\n`INVALID_API`, `F`, API is invalid (or not active).\n\n`ACCESS_DENIED`, `F`, access denied.\n\n`PAYMENT_IN_PROCESS`, `U`, the payment is still under process.\n\n`PAYMENT_AMOUNT_EXCEED_LIMIT`, `F`,payment amount exceeds limit.\n\n`USER_NOT_EXIST`, `F`,user not exist.\n\n`USER_STATUS_ABNORMAL`, `F`, the user status is abnormal.\n\n`USER_BALANCE_NOT_ENOUGH`, `F`, user balance is not enough for this payment.\n\n`PARTNER_NOT_EXIST`, `F`, partner not exist.\n\n`PARTNER_STATUS_ABNORMAL`, `F`, partner status abnormal.\n\n`RISK_REJECT`, `F`, risk reject.\n\n`CURRENCY_NOT_SUPPORT`, `F`, the currency is not supported.\n\n`ORDER_STATUS_INVALID`, `F`, order is in invaid status such closed.\n\n`INVALID_CODE`, `F`, auth code illegal.\n\n`AUTH_CODE_ALREADY_USED`, `F`, auth code already used.\n\n`INVALID_ACCESS_TOKEN`, `F`, invalid accesstoken.\n\n`USER_AMOUNT_EXCEED_LIMIT`, `F`, payment amount exceeds user's amount limit.\n\n`UNAVAILABLE_PAYMENT_METHOD`, `F`, The payment method is unavailable.\n\n`EXPIRED_CARD`, `F`, the card is expired\n\n`INVALID_CARD`, `F`, the card is invalid\n\n`INVALID_SECURITY_CODE`, `F`, the security code is invalid\n\n`ORDER_IS_CANCELLED`, `F`, Order is cancelled.\n","properties":{"result":{"$ref":"#/components/schemas/Result"},"paymentId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet.","maxLength":64},"paymentTime":{"type":"string","format":"date-time","description":"Success or failure time of the payment"},"actionForm":{"$ref":"#/components/schemas/ActionForm"},"extendInfo":{"type":"string","description":"the extend information return by wallet, now we support these key:originalResult(the original error info reurn by wallet core), displayCustomerId (userId of the wallet)","maxLength":4096}}},"CaptureRequest":{"type":"object","required":["authPaymentRequestId","captureRequestId","paymentRequestId"],"description":"Idempotent fields are paymentRequestId , when retry same payment request, client need to promise paymentRequestId and other infos are the same.\n","properties":{"authPaymentRequestId":{"type":"string","description":"The unqiue ID of authorization payment, generated by merchants or partners, authPaymentRequestId should be the same as in the auth payment request.","maxLength":64},"captureRequestId":{"type":"string","description":"The unqiue ID of a capture generated by merchant/partner, unique identifier this request.","maxLength":64},"captureAmount":{"description":"if captureAmount is null, will use authorization amount as capture amount.","$ref":"#/components/schemas/Amount"},"order":{"type":"object","description":"original order","$ref":"#/components/schemas/Order"},"extendInfo":{"type":"string","description":"the extend information,wallet and merchant can put extend info here","maxLength":4096}}},"CaptureResponse":{"required":["result"],"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`REPEAT_REQ_INCONSISTENT`, `F`, Repeat submit, and requests are inconsistent.\n\n`PROCESS_FAIL`, `F`, General business failure. No retry.\n\n`INVALID_API`, `F`, API is invalid (or not active).\n\n`ACCESS_DENIED`, `F`, Access denied.\n\n`CAPTURE_IN_PROCESS`, `U`, The capture is still under process.\n\n`AUTHORIZATION_PAYMENT_NOT_EXIST`, `F`, Authorization payment not exist.\n\n`EXPIRED_AUTHORIZATION_PAYMENT`, `F`, Authorization payment is expired\n\n`USER_STATUS_ABNORMAL`, `F`, The user status is abnormal.\n\n`USER_BALANCE_NOT_ENOUGH`, `F`, User balance is not enough for this payment.\n\n`PARTNER_STATUS_ABNORMAL`, `F`, Partner status abnormal.\n\n`RISK_REJECT`, `F`, Risk reject.\n\n`CURRENCY_NOT_SUPPORT`, `F`, The currency is not supported.\n\n`ORDER_STATUS_INVALID`, `F`, Order is in invaid status such FAIL.\n\n`CAPTURE_AMOUNT_EXCEED_LIMIT`, `F`, Capture amount exceed max capturable amount limit.\n\n`USER_AMOUNT_EXCEED_LIMIT`, `F`, Payment amount exceeds user's periodical(daily/monthly/yearly) amount limit.\n","properties":{"result":{"$ref":"#/components/schemas/Result"},"captureId":{"type":"string","description":"The unqiue ID of a capture generated by Wallet.","maxLength":64},"captureAmount":{"$ref":"#/components/schemas/Amount"},"captureTime":{"type":"string","format":"date-time","description":"Success time of the payment"},"extendInfo":{"type":"string","description":"the extend information return by wallet, now we support these key:originalResult(the original error info reurn by wallet core), displayCustomerId (userId of the wallet)","maxLength":4096}}},"NotifyPaymentRequest":{"required":["paymentId","paymentRequestId","paymentAmount","paymentStatus"],"description":"Idempotent fields are paymentRequestId , when retry same payment notification, client need to promise paymentRequestId and other infos are the same.\n","properties":{"paymentId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet.","maxLength":64},"paymentRequestId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet merchants.","maxLength":64},"paymentResult":{"$ref":"#/components/schemas/Result"},"paymentAmount":{"$ref":"#/components/schemas/Amount"},"paymentTime":{"type":"string","format":"date-time","description":"payment success time"},"paymentCreateTime":{"type":"string","format":"date-time","description":"payment create time"},"extendInfo":{"type":"string","description":"extend information","maxLength":4096}}},"NotifyPaymentResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`REPEAT_REQ_INCONSISTENT`, `F`, repeated submit, and requests are inconsistent.\n\n`PROCESS_FAIL`, `F`, General business failure. No retry.\n\n`INVALID_API`, `F`, API is invalid (or not active).\n","properties":{"result":{"$ref":"#/components/schemas/Result"}}},"InquiryPaymentRequest":{"description":"we support query by paymentId or paymentRequestId, paymentId has high prioprity than paymentRequestId, that means if both paymentId and paymentRequestId is provided, we will use paymentId and ignore paymentRequestId","properties":{"paymentId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet","maxLength":64},"paymentRequestId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet merchants.","maxLength":64},"extendInfo":{"type":"string","description":"the extend information,wallet and merchant can put extend info here","maxLength":4096}}},"InquiryPaymentResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`INVALID_API`, `F`, API is invalid (or not active)\n\n`ORDER_NOT_EXIST`, `F`, The order doesn't  exist.\n","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/Result"},"paymentId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet.","maxLength":64},"paymentRequestId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet merchants.","maxLength":64},"paymentAmount":{"$ref":"#/components/schemas/Amount"},"paymentTime":{"type":"string","format":"date-time","description":"Success time of the payment"},"paymentCreateTime":{"type":"string","format":"date-time","description":"payment create time"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"paymentResultCode":{"type":"string","description":"payment result code","maxLength":64},"paymentResultMessage":{"type":"string","description":"Payment result message","maxLength":256},"extendInfo":{"type":"string","description":"extend information","maxLength":4096}}},"InquiryCaptureRequest":{"description":"we support query by captureId or captureRequestId, captureId has a higher prioprity than captureRequestId, that means if both captureId and captureRequestId are provided, we will use captureId and ignore captureRequestId","properties":{"captureId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet","maxLength":64},"captureRequestId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet merchants.","maxLength":64},"extendInfo":{"type":"string","description":"the extend information,wallet and merchant can put extend info here","maxLength":4096}}},"InquiryCaptureResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`INVALID_API`, `F`, API is invalid (or not active)\n\n`CAPTURE_NOT_EXIST`, `F`, The capture doesn't exist.\n","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/Result"},"captureId":{"type":"string","description":"The unqiue ID of a capture generated by Wallet.","maxLength":64},"captureRequestId":{"type":"string","description":"The unqiue ID of a capture generated by merchants.","maxLength":64},"captureAmount":{"$ref":"#/components/schemas/Amount"},"captureTime":{"type":"string","format":"date-time","description":"Success time of the capture"},"captureStatus":{"$ref":"#/components/schemas/CaptureStatus"},"captureFailReason":{"type":"string","description":"the fail reason of payment order when captureStatus is FAIL","maxLength":256},"extendInfo":{"type":"string","description":"extend information","maxLength":4096}}},"CancelPaymentRequest":{"description":"we support cancel by paymentId or paymentRequestId, paymentId has high prioprity than paymentRequestId, that means if both paymentId and paymentRequestId is provided, we will use paymentId and ignore paymentRequestId","properties":{"paymentId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet .","maxLength":64},"paymentRequestId":{"type":"string","description":"The unqiue ID of a payment generated by Wallet  merchants.","maxLength":64},"extendInfo":{"type":"string","description":"extend information of cancel request, such as cancel reason etc.","maxLength":4096}}},"CancelPaymentResponse":{"required":["result"],"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`PROCESS_FAIL`, `F`, General business failure. No retry.\n\n`INVALID_API`, `F`, API is invalid (or not active)\n\n`ACCESS_DENIED`, `F`, Access denied.\n\n`CANCEL_IN_PROCESS`, `U`, Cancellation is under processing.\n\n`PARTNER_STATUS_ABNORMAL`, `F`, Partner status abnormal.\n\n`ORDER_NOT_EXIST`, `F`, The order doesn't exist.\n\n`ORDER_STATUS_INVALID`, `F`, Order is in invaid status such FAIL.\n\n`CANCEL_WINDOW_EXCEED`, `F`, Exceed Cancel window.\n\n`ORDER_HAS_BEEN_CAPTURED`, `F`, Cancel not support when order has been captured.\n\n`ORDER_HAS_BEEN_VOIDED`, `F`, Cancel not support when order has been voided.\n\n`ORDER_HAS_BEEN_REFUNDED`, `F`, Cancel not support when order has been refunded.\n\n`PARTNER_BALANCE_NOT_ENOUGH`, `F`, Need refund but partner balance is not enough.\n","properties":{"result":{"$ref":"#/components/schemas/Result"},"cancelTime":{"type":"string","format":"date-time","description":"The cancel time of the transaction"},"extendInfo":{"type":"string","description":"extend information","maxLength":4096}}},"RefundRequest":{"description":"we support refund by paymentId or paymentRequestId, paymentId has high prioprity than paymentRequestId, that means if both paymentId and paymentRequestId is provided, we will use paymentId and ignore paymentRequestId\n\nIdempotent fields are refundRequestId , when retry same refund request, client need to promise refundRequestId and other infos are the same.\n","required":["refundRequestId","refundAmount"],"properties":{"refundRequestId":{"type":"string","description":"The unqiueId of a refund generated by Merchant.","maxLength":64},"paymentId":{"type":"string","description":"The payment Id for the corresponding original payment","maxLength":64},"paymentRequestId":{"type":"string","description":"The paymentRequestId for the corresponding original payment","maxLength":64},"refundAmount":{"type":"object","description":"Refund amount.","required":true,"$ref":"#/components/schemas/Amount"},"refundReason":{"type":"string","description":"Refund reason.","maxLength":256},"extendInfo":{"type":"string","description":"Extend information.","maxLength":4096},"order":{"type":"object","description":"original order","$ref":"#/components/schemas/Order"}}},"RefundResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`REPEAT_REQ_INCONSISTENT`, `F`, repeated submit, and requests are inconsistent.\n\n`PROCESS_FAIL`, `F`, General business failure. No retry.\n\n`INVALID_API`, `F`, API is invalid (or not active).\n\n`ACCESS_DENIED`, `F`, access denied.\n\n`REFUND_IN_PROCESS`, `U`, Refund is under processing.\n\n`PARTNER_STATUS_ABNORMAL`, `F`, partner status abnormal.\n\n`ORDER_NOT_EXIST`, `F`, Order does not exist\n\n`ORDER_STATUS_INVALID`, `F`, Order status is invalid.\n\n`REFUND_WINDOW_EXCEED`, `F`, Exceed Refund window.\n\n`REFUND_AMOUNT_EXCEED`, `F`, The total refund amount has exceed the payment amount.\n\n`PARTNER_BALANCE_NOT_ENOUGH`, `F`, The partner balance is not enough.\n\n`CURRENCY_NOT_SUPPORT`, `F`, The currency is not supported.\n","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/Result"},"refundId":{"type":"string","description":"Unique refund order number.","maxLength":64},"refundTime":{"type":"string","format":"date-time","description":"deduct money from merchant success time, after then will start to refund money to user"},"extendInfo":{"type":"string","description":"the extend information return by wallet, now we support these key:originalResult(the original error info reurn by wallet core), displayCustomerId (userId of the wallet)","maxLength":4096}}},"InquiryRefundRequest":{"description":"we support query refund by refundId or refundRequestId, refundId has high prioprity than refundRequestId, that means if both refundId and refundRequestId is provided, we will use refundId and ignore refundRequestId","properties":{"refundId":{"type":"string","description":"refund id return by wallet","maxLength":64},"refundRequestId":{"type":"string","description":"The unqiueId of a refund generated by Merchant.","maxLength":64},"extendInfo":{"type":"string","description":"Extend information.","maxLength":4096}}},"InquiryRefundResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`INVALID_API`, `F`, API is invalid (or not active).\n\n`REFUND_NOT_EXIST`, `F`, Refund is not exist.\n","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/Result"},"refundId":{"type":"string","description":"refund id return by wallet.","maxLength":64},"refundRequestId":{"type":"string","description":"merchant refund request id.","maxLength":64},"refundAmount":{"$ref":"#/components/schemas/Amount"},"refundReason":{"type":"string","description":"refund reason.","maxLength":256},"refundTime":{"type":"string","format":"datetime","description":"refund process finish time, that means deduct from merchant success."},"refundStatus":{"type":"string","description":"\n`PROCESSING` - refund is processing.\n\n`SUCCESS` - refund success.\n\n`FAIL` - refund failed.\n","enum":["PROCESSING","SUCCESS","FAIL"]},"refundFailReason":{"type":"string","description":"the fail reason of refund order when refundStatus is FAIL","maxLength":256},"extendInfo":{"type":"string","description":"extend information","maxLength":4096}}},"NotifyRefundRequest":{"required":["paymentRequestId","paymentId","refundRequestId","refundId","refundAmount","refundStatus"],"description":"Idempotent fields are refundRequestId , when retry same refund notification, client need to promise refundRequestId and other infos are the same.\n","properties":{"paymentRequestId":{"type":"string","description":"The unqiue ID of a payment generated by merchant.","maxLength":64},"paymentId":{"type":"string","description":"The payment Id for the corresponding original payment","maxLength":64},"refundRequestId":{"type":"string","description":"merchant refund request id.","maxLength":64},"refundId":{"type":"string","description":"refund id return by wallet","maxLength":64},"refundAmount":{"$ref":"#/components/schemas/Amount"},"refundTime":{"type":"string","format":"date-time","description":"Refund time"},"refundStatus":{"type":"string","description":"\n`SUCCESS` - refund success.\n\n`FAIL` - refund failed.\n","enum":["SUCCESS","FAIL"]},"refundFailReason":{"type":"string","description":"the fail reason of refund order when refundStatus is FAIL","maxLength":256},"extendInfo":{"type":"string","description":"extend information","maxLength":4096}}},"NotifyRefundResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`SUCCESS`, `S`, success.\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`REPEAT_REQ_INCONSISTENT`, `F`, repeated submit, and requests are inconsistent.\n\n`PROCESS_FAIL`, `F`, General business failure. No retry.\n\n`INVALID_API`, `F`, API is invalid (or not active).\n","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/Result"}}},"HeaderRequest":{"required":["Client-Id","Request-Time","Signature","Content-Type"],"properties":{"Client-Id":{"type":"string","description":"Provided by Wallet, used to identify partner and application system","maxLength":32},"Request-Time":{"type":"string","format":"date-time","description":"DateTime with timezone"},"Content-Type":{"type":"string","description":"application/json; charset=UTF-8"},"Signature":{"type":"string","description":"the signature of the request,include http method, htp uri with query string, client-id, request-time and request body","maxLength":1024}}},"HeaderResponse":{"description":"result.(resultCode, resultStatus, resultMessage):\n\n`UNKNOWN_EXCEPTION`, `U`, API failed due to unknown reason.\n\n`PARAM_MISSING`, `F`, One or more mandatory parameters is/are not missing.\n\n`PARAM_ILLEGAL`, `F`, Illegal parameters. For example, non-numeric input, invalid date.\n\n`KEY_NOT_FOUND`, `F`, Key is not found.\n\n`NO_INTERFACE_DEF`, `F`, API is not defined.\n\n`INVALID_API`, `F`, API is invalid.\n\n`MSG_PARSE_ERROR`, `F`, Message parsed error.\n\n`OAUTH_FAILED`, `F`, oAuth authentication failed.\n\n`FUNCTION_NOT_MATCH`, `F`, Function parameter does not match API.\n\n`VERIFY_CLIENT_SECRET_FAIL`, `F`, ClientSecret verification failed.\n\n`ACCESS_DENIED`, `F`, Access denied.\n\n`INVALID_CLIENT`, `F`, Invalid client.\n\n`INVALID_SIGNATURE`, `F`, Signature is invalid.\n\n`INVALID_CLIENT_STATUS`, `F`, Invalid client status.\n\n`ACCESS_TOKEN_NOT_EXIST`, `F`, access token not exist.\n\n`ACCESS_TOKEN_EXPIRY`, `F`, access token expiry.\n\n`AUTHORIZATION_EXPIRY`, `F`, authorization expiry, will be reflected in refresh token expiry.\n\n`REQUEST_TRAFFIC_EXCEED_LIMIT`, `U`, Request traffic exceed limit.\n","required":["Client-Id","Response-Time","Content-Type","Signature"],"properties":{"Client-Id":{"type":"string","description":"Provided by Wallet, used to identify partner and application system","maxLength":32},"Response-Time":{"type":"string","format":"date-time","description":"DateTime with timezone"},"Content-Type":{"type":"string","description":"application/json; charset=UTF-8"},"Signature":{"type":"string","description":"the signature of the request,include http method, htp uri with query string, Client-id, Response-time and request body","maxLength":1024}}},"Error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"string"}}},"Result":{"properties":{"resultCode":{"type":"string","description":"result code.","maxLength":64},"resultStatus":{"type":"string","description":"ResultStatusType","enum":["S","F","U","A"]},"resultMessage":{"type":"string","description":"When the result is S, this field may be empty,When the result is F or U, description of error must be provided.","maxLength":256}}},"Order":{"required":["referenceOrderId","orderDescription","orderAmount","merchant"],"properties":{"referenceOrderId":{"type":"string","description":"The unique identification of the order on the merchant side. It is used for the display of user consumption records, and the subsequent payment operations such as customer complaints and disputes track.","maxLength":64},"orderDescription":{"type":"string","description":"description of the order used to display user consumption records, etc.","maxLength":256},"orderAmount":{"$ref":"#/components/schemas/Amount"},"orderCreateTime":{"type":"string","format":"date-time","description":"order create time from merchant"},"merchant":{"type":"object","description":"the original merchant information","$ref":"#/components/schemas/Merchant"},"goods":{"type":"array","description":"goods information","items":{"$ref":"#/components/schemas/Goods"}},"shipping":{"type":"object","description":"shipping information","$ref":"#/components/schemas/Shipping"},"buyer":{"type":"object","description":"Buyer information. This information will be used for risk control, So it is highly recommanded to be provided.","$ref":"#/components/schemas/Buyer"},"env":{"type":"object","description":"order environment, such as device information.","$ref":"#/components/schemas/Env"},"extendInfo":{"type":"string","description":"Extended infomation data,  this field includes information that are not common but needed for special use cases.  for example, for orders to Alipay CN, there are additional information required as captured in object","maxLength":2048}}},"Amount":{"required":["currency","value"],"description":"Order amount for display of user consumption records, payment results page.","properties":{"currency":{"type":"string","description":"3-letter currencyCode, follow ISO 4217","maxLength":3},"value":{"type":"string","description":"A positive integer representing how much to charge in the smallest currency unit(e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).","maxLength":16}}},"Address":{"required":["region"],"properties":{"region":{"type":"string","description":"2-letter courtry/region code�? refer to ISO 3166","maxLength":2},"state":{"type":"string","description":"State/County/Province.","maxLength":32},"city":{"type":"string","description":"City/District/Suburb/Town/Village","maxLength":64},"address1":{"type":"string","description":"Address line 1(Street address/PO Box/Company name).","maxLength":256},"address2":{"type":"string","description":"Address line 2(Apartment/Suite/Unit/Building).","maxLength":256},"zipCode":{"type":"string","description":"ZIP or postal code.","maxLength":32},"label":{"type":"string","description":"Label for address, e.g home, company","maxLength":64},"extendInfo":{"type":"string","description":"The extend information of goods","maxLength":4096}}},"Goods":{"required":["referenceGoodsId","goodsName"],"properties":{"referenceGoodsId":{"type":"string","description":"Unique ID of goods","maxLength":64},"goodsName":{"type":"string","description":"Name of goods","maxLength":256},"goodsCategory":{"type":"string","description":"Category of goods.","maxLength":256},"goodsBrand":{"type":"string","description":"Brand of goods.","maxLength":32},"goodsUnitAmount":{"type":"object","description":"Price of goods","$ref":"#/components/schemas/Amount"},"goodsQuantity":{"type":"string","description":"Quantity of goods","maxLength":32},"goodsSkuName":{"type":"string","description":"goods sku name","maxLength":64},"goodsUrl":{"type":"string","description":"Goods url","maxLength":2048},"extendInfo":{"type":"string","description":"The extend information of goods","maxLength":2048}}},"Merchant":{"required":["referenceMerchantId","merchantMCC"],"properties":{"referenceMerchantId":{"type":"string","description":"Merchant ID","maxLength":32},"merchantMCC":{"type":"string","description":"Merchant MCC","maxLength":32},"merchantName":{"type":"string","description":"Name of Merchant","maxLength":256},"merchantDisplayName":{"type":"string","description":"Display name of merchant","maxLength":64},"merchantAddress":{"type":"object","description":"Merchant address information","$ref":"#/components/schemas/Address"},"merchantRegisterDate":{"type":"string","format":"date-time","description":"A positive integer representing how much to charge in the smallest currency unit(e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).","maxLength":16},"store":{"type":"object","description":"Store information. Offline payment scenario must be provided for regulatory reporting.","$ref":"#/components/schemas/Store"}}},"Store":{"required":["referenceStoreId"],"properties":{"referenceStoreId":{"type":"string","description":"The store belongs to a merchant, and the ID assigned by the corresponding merchant to the store is unique under the merchant.","maxLength":64},"storeName":{"type":"string","description":"Name of store","maxLength":256},"storeMCC":{"type":"string","description":"Store business category code","maxLength":32},"storeDisplayName":{"type":"string","description":"Display name of store","maxLength":64},"storeTerminalId":{"type":"string","description":"Unique identifier of store's terminal.","maxLength":64},"storeOperatorId":{"type":"string","description":"Unique identifier of store's terminal operator.","maxLength":64},"storeAddress":{"type":"object","description":"Address line 2(Apartment/Suite/Unit/Building).","$ref":"#/components/schemas/Address"},"storePhoneNo":{"type":"string","description":"Phone number of Store.","maxLength":16}}},"Shipping":{"required":["shippingName","shippingAddress"],"properties":{"shippingName":{"type":"object","description":"Recipant name.","$ref":"#/components/schemas/UserName"},"shippingAddress":{"type":"object","description":"Shipping address.","$ref":"#/components/schemas/Address"},"shippingCarrier":{"type":"string","description":"The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.","maxLength":128},"shippingPhoneNo":{"type":"string","description":"Recipient PhoneNo(including extension).","maxLength":16},"shippingFee":{"$ref":"#/components/schemas/Amount"}}},"UserName":{"required":["firstName","lastName"],"properties":{"firstName":{"type":"string","description":"First name.","maxLength":32},"middleName":{"type":"string","description":"Middle name.","maxLength":32},"lastName":{"type":"string","description":"Last name.","maxLength":32},"fullName":{"type":"string","description":"Full name.","maxLength":128}}},"Buyer":{"properties":{"referenceBuyerId":{"type":"string","description":"Unique Identification of buyer","maxLength":64},"buyerName":{"type":"object","description":"Name of buyer","$ref":"#/components/schemas/UserName"},"buyerPhoneNo":{"type":"string","description":"Mobile phone number of buyer","maxLength":24},"buyerEmail":{"type":"string","description":"Mobile phone number of buyer","maxLength":128}}},"Env":{"properties":{"terminalType":{"type":"string","description":"The teminal type of this request","enum":["APP","WEB","WAP","MINI_APP","SYSTEM"]},"osType":{"type":"string","description":"OS type.","enum":["IOS","ANDROID"]},"userAgent":{"type":"string","description":"user agent","maxLength":1024},"deviceTokenId":{"type":"string","description":"Token identifier of device.","maxLength":128},"clientIp":{"type":"string","description":"IP of client","maxLength":64},"cookieId":{"type":"string","description":"user cookie id","maxLength":128},"storeTerminalId":{"type":"string","description":"Store terminal id","maxLength":64},"storeTerminalRequestTime":{"type":"string","format":"datetime","description":"Store terminal request time"},"extendInfo":{"type":"string","description":"Extended infomation","maxLength":2048}}},"PayMethod":{"required":["paymentMethodType"],"properties":{"paymentMethodType":{"type":"string","description":"Payment method type","maxLength":32},"paymentMethodId":{"type":"string","description":"The uniqueId of a customer belong to a paymentMethod.if the payMethod is BALANCE, it refers to a payer user account no,if the payMethod is CASH_COUPON, it refers to a coupon id,if the payMethod is PREPAID_CARD, it refers to a prepaidCardId,if the payMethod is BANK_EXPRESS, it refers to an express payment contract id,if bankcard pay,it is the token of the cached card detail, returned by the card cache service,if retail pay(B scan C), it is the payment code of this user,if it's agreement pay, it's user's accesstoken.","maxLength":128},"paymentMethodMetaData":{"type":"string","description":"extend information for this PaymentMethod","maxLength":2048},"extendInfo":{"type":"string","description":"Extended infomation","maxLength":2048}}},"PaymentVerificationData":{"properties":{"verifyRequestId":{"type":"string","description":"This is the requestId generated by payment site during the initAuthentication call which this request is associated with.","maxLength":64},"authenticationCode":{"type":"string","description":"verify code","maxLength":64},"securityId":{"description":"needed when verifyRequestId is null,a securityId is created by Alipay+ Risk system, which is used to correlate and chain the risk requests of consult, verify, check on the same transaction.the securityId could be empty for the first call of this API, and there is risk consultant during processing the first call, if the consultant returns that risk challenge is required, a securityId is returned, in this case, ask user to go through the risk challenge process first, then call this API again with the securityId.","type":"string","maxLength":64}}},"PaymentFactor":{"properties":{"isPaymentEvaluation":{"type":"boolean","description":"Whether it is a payment check, if isPaymentEvaluation = true is specified in the request, then this payment is only estimated to be successful, and it is not recorded. The default is false."},"isAuthorizationPayment":{"type":"boolean","description":"used in auth capture scenario, pre authorization"},"isOrderCode":{"type":"boolean","description":"if the payment senario is the user scan the code presented by merchant and identify the order, and make payment. Default is false"},"isPaymentCode":{"type":"boolean","description":"if the payment senario is the merchant scan the user paymentcode，default is false"},"isAuthorizationAndPay":{"type":"boolean","description":"An indicator of whether to do authorization for the agreement payment during the payment"}}},"ActionForm":{"properties":{"actionFormType":{"type":"string","description":"the action form type.","enum":["ORDER_CODE","REDIRECTION"]},"orderCode":{"type":"string","description":"the order code value.","maxLength":2048},"redirectionUrl":{"type":"string","description":"the url of redirect.","maxLength":4096}}},"TransactionStatusType":{"type":"string","description":"`SUCCESS` - Transction is successful.\n\n`FAIL` - Transaction is failed.\n\n`PROCESSING` - Transaction is under process.\n","enum":["SUCCESS","FAIL","PROCESSING"]},"GenderEnum":{"type":"string","description":"User's gender.\n","enum":["MALE","FEMALE"]},"PaymentStatus":{"type":"string","description":"`PROCESSING` - order is not paid or is paid but not finish.\n\n`SUCCESS` - order is succeeded.\n\n`FAIL` - order is failed.\n\n`CANCELLED` - order is cancelled.\n"},"CaptureStatus":{"type":"string","description":"`PROCESSING` - order is not paid or is paid but not finish.\n\n`SUCCESS` - order is succeeded.\n\n`FAIL` - order is failed.\n"},"RefundInfo":{"required":["refundId","requestId","refundAmount","refundAcceptedTime","refundStatus"],"properties":{"refundId":{"type":"string","description":"refund id return by wallet.","maxLength":64},"requestId":{"type":"string","description":"merchant refund request id.","maxLength":64},"refundAmount":{"$ref":"#/components/schemas/Amount"},"refundReason":{"type":"string","description":"refund reason.","maxLength":256},"refundAcceptedTime":{"type":"string","format":"datetime","description":"refund accepted time."},"refundedTime":{"type":"string","format":"datetime","description":"refund process finish time, that means deduct from merchant success."},"refundToUserTime":{"type":"string","format":"datetime","description":"refund to user success time."},"refundStatus":{"type":"string","description":"`ACCEPTED` - refund request has been accepted.\n\n`PROCESSING` - refund is processing.\n\n`FAILED` - refund failed.\n\n`SUCCESS` - refund success.\n","enum":["ACCEPTED","PROCESSING","FAILED","SUCCESS"]},"extraReturnInfo":{"type":"string","description":"extend info","maxLength":2048}}},"PaymentMethodType":{"type":"string","description":"payMethod type.\n","enum":["BALANCE","COUPON","CREDIT_CARD","DEBIT_CARD","EXTEND_TYPE"]},"PaymentMethod":{"required":["paymentMethodType"],"properties":{"paymentMethodType":{"type":"string","description":"payment method type, used to identifier a payment method, some reserved payment methods are in '#/components/schemas/PaymentMethodType'","maxLength":32},"paymentMethodId":{"type":"string","description":"The uniqueId of a customer belong to a paymentMethod.","maxLength":128},"extendMetaData":{"type":"string","description":"Extended information","maxLength":2048}}},"AuthClientInfo":{"required":["authClientId"],"properties":{"authClientId":{"type":"string","maxLength":32,"description":"The unique identifier allocated for client."},"referenceClientId":{"type":"string","description":"The referenceClientId represents the next-level clien id. When multiple auth codes need to be assigned to the same client, different referenceClientIds can be passed in to distinguish them.","maxLength":128}}}}}}