Skip to main content

API access documentation

info

All server-side interface calls need to be encoded and signed as required. For details, please refer to API Interface Signature Verification

Payment

Interface Description

Receipt is the entry point for merchants to initiate collection business scenarios. The merchant server initiates a payment request to Paynicorn. Paynicorn will encapsulate the list of payment methods according to the parameters, and return the link to the cashier or initiate payment directly.

interface address

https://api.paynicorn.com/trade/v3/transaction/pay

request parameters

Field filling requirements, M: mandatory, O: optional

Parameter NameTypeRequiredDescription
amountString(32)MThe smallest unit of local currency, with two decimal places, see Appendix Country Currency Comparison Table
countryCodeString(2)MCountry Code, see Appendix Country Currency Comparison Table
orderIdString(64)MMerchant order number
orderDescriptionString(1024)Morder description
currencyString(3)MCurrency Code (CurrencyCode), see Appendix Country Currency Comparison Table
payMethodString(64)OPayment method code, if specified, use the payment method, do not enter the paynicorn cashier, if not specify, enter the paynicorn cashier to select the payment method, see appendix [payment method list](/docs/appendix/ payment-method)
languageString(8)ODefault cashier language
cpFrontPageString(1024)OThe address of the payment result page accepted by the front-end, if provided, the page will be automatically redirected to this address after the payment is completed
palmAuthCodeString(8)OThrough PalmID authorization and authentication, it provides authorized payment function. (Required: 1. Integrate PalmID, 2. Contact Paynicorn operators to activate authorized payment permissions)
emailString(128)OUser mailbox, if provided, the channel that needs to use the user's mailbox will directly use the provided mailbox, skip the page where the user fills in the mailbox
phoneString(32)OUser's mobile phone number (excluding country code), if provided, the channel that needs to use the user's mobile phone number will directly use the provided mobile phone number, skip the page where the user fills in the mobile phone number
payByLocalCurrencyBooleanOWhether to pay in local currency, the default is false, when it is true and the currency is not the local currency of countryCode, it will try to convert non-local currency to local currency for payment
memoString(1024)OExtended information (stores JSON string)

Response parameters

parameter nametyperemarks
codeString(16)For status codes, see Status Code
messageString(256)Message see Status Code
txnIdString(64)Transaction number
statusString(2)Order status (1: successful; -1: processing; 0: failed)
webUrlString(64)H5 payment address
info

For the payment interface, you can specify the payment method used for this payment by passing in payMethod, skipping the payment method page at the Paynicorn checkout counter

If the payment method requires the user's mobile phone number, you can pass in the mobile phone number through the phone, skipping the mobile phone number input page at the Paynicorn checkout counter

By providing the corresponding parameters, you can skip the Web page of the Paynicorn cashier and initiate the corresponding payment directly. In this case, the webUrl in the Paynicorn response parameter is empty, and the merchant can implement the relevant front-end page by itself

For the specific supported payment methods and the parameters that need to be passed in related methods, please refer to List of Payment Methods

Refund

Interface Description

For a successful payment order, initiate a refund application, synchronously accept, asynchronously process, and call back the result

interface address

https://api.paynicorn.com/trade/v3/transaction/refund

interface parameters

Field filling requirements M:mandatory ,O:optional

Parameter NameTypeRequiredDescription
payTxnIdString(64)MOriginal transaction number
refundIdString(64)MMerchant refund order number

Response parameters

Parameter NameTypeRequiredRemarks
codeString(16)MStatus code see Status Code
messageString(256)MMessage see status-code
txnIdString(64)MTransaction ID
statusString(2)MOrder status (1: success; -1: processing; 0: failure)

Payout

Interface Description

The payment interface is not enabled by default. It needs to be enabled. Contact kailan.ruan@transsion.com

interface address

https://api.paynicorn.com/trade/v3/transaction/payout

interface parameters

Field filling requirements M: mandatory, O: optional

Parameter NameTypeRequiredDescription
orderIdString(64)MMerchant payment order number
currencyString(3)MCurrency Code (CurrencyCode), see Appendix Country and Currency Comparison Table
amountString(32)Mamount
countryCodeString(2)MCountry Code, see Appendix Country and Currency Comparison Table
payoutMethodString(64)MTransfer type (CARD,MTN,MPESA,PAYNICORNPAY,AIRTEL...)
nameString(64)MPayee name
accountString(64)MReceiving account
bankCodeString(64)OBank code (required when transfer type is bank card) see appendix Bank Code

Response parameters

Parameter NameTypeRequiredRemarks
codeString(16)MStatus code see Status Code
messageString(256)MMessage see status-code
statusString(2)MOrder status (-1: processing; 0: failed)
txnIdString(64)OTransaction ID

Payout2

Interface Description

The implementation will issue funds to the user, and the merchant can call this interface to implement, and transfer the funds from the merchant's own payout account to the paynicorn app user

interface address

https://api.paynicorn.com/trade/customer/oauth/transaction/payout

interface parameters

Field filling requirements M: mandatory, O: optional

Parameter NameTypeRequiredDescription
orderIdString(64)MMerchant payment order number
currencyString(3)MCurrency Code (CurrencyCode), see Appendix Country and Currency Comparison Table
amountString(32)Mamount
countryCodeString(2)MCountry Code, see Appendix Country and Currency Comparison Table
nameString(64)MPayee name
openIdString(64)​​ MOpenId

Response parameters

Parameter NameTypeRequiredRemarks
codeString(16)MStatus code see Status Code
messageString(256)MMessage see status-code
statusString(2)MOrder status (-1: processing; 0: failed)
txnIdString(64)OTransaction ID

Query transaction result interface (Query)

Interface Description

Used for query of asynchronous interface and synchronous interface timeout scenario

interface address

https://api.paynicorn.com/trade/v3/transaction/query

request parameters

Field filling requirements M:mandatory ,O:optional

Parameter NameTypeRequiredDescription
orderIdString(64)MMerchant order number
txnTypeString(8)MTransaction Type

Please refer to appendix transaction type for transaction type

Response parameters

Parameter NameTypeRequiredRemarks
codeString(16)MStatus code see Status Code
messageString(256)MMessage see status-code
txnIdString(64)MTransaction ID
statusString(4)MPayment result
completeTimeString(16)OTransaction processing completion time

Asynchronous notification interface (Postback)

Interface Description

Asynchronous transaction result notification, if the transaction result cannot be obtained immediately for payment collection and authorized payment, when the transaction status changes, paynicorn will call the asynchronous notification result set by the merchant to notify the merchant server of the latest order status.

interface address

Provided by the merchant, configured through the merchant platform, see Set callback address

request parameters

Parameter NameTypeRequiredRemarks
txnIdString(64)MPayment order number
orderIdString(64)MMerchant's order number
amountString(32)Mamount
currencyString(3)MCurrency
countryCodeString(2)Mcountry code
statusString(4)MPayment status
codeString(6)MStatus code
messageString(256)Mmessage
memoString(1024)ORemarks

Response parameters

caution

After the merchant receives the callback notification, it needs to respond according to the requirements of Paynicorn

HttpsStatus=200 means that the notification is received and the string success_{txnId} is returned, other means the notification failed

If success_{txnId} is not returned, it will continue to notify until it succeeds, up to 7 times. The notification interval is incremented by 10*2^(n-1) (unit: minute, n represents the number of notifications), and the frequency is: 10min, 20min, 40min, 80min, 160min,320min

Get the payment method (PayMethod)

Interface Description

Get available payment methods

interface address

https://api.paynicorn.com/trade/v3/transaction/method

request parameters

Field filling requirements M:mandatory ,O:optional

Parameter nameTypeFill in requirementsDescription
countryCodeString(2)MCountry Code, see Appendix Country and Currency Comparison Table
currencyString(3)MCurrency Code (CurrencyCode), see Appendix Country and Currency Comparison Table
txnTypeString(8)Mtransaction type, see appendix transaction-type

Response parameters

Parameter NameTypeRequiredRemarks
codeString(16)MStatus code see Status Code
messageString(256)MMessage see status-code
methodInfoArray<MethodInfo>OList of available payment methods

MethodInfo

Parameter NameTypeRequiredRemarks
codeString(32)MPayment method code
nameString(32)MPayment method name
iconString(128)MPayment method icon URL
methodTypeString(16)MPayment method type
supportAmountArray<Decimal>OSupport amount, discrete value, and minAmount\maxAmount will not appear at the same time
minAmountDecimalOSupport the minimum amount, will not appear at the same time as supportAmount
maxAmountDecimalOSupport the maximum amount, will not appear at the same time as supportAmount
discountDecimalODiscount