Nhảy tới nội dung

Pay Order By Tokenizations

Use Case

This API will be used to pay a order by tokenizations

Request

POST /v2/tokenizations/pay

ParameterTypeRequiredDescription
merchantIdStringFundiin provides MID as a unique identifier to each merchant.
referenceIdStringUnique identifier generated by the merchant for this charge transaction
REGEX: ^[0-9a-zA-Z_:-]60$
requestTypeStringtoken
tokenizationStringTokenizations User
storeIdStringStore Id
langStringLanguage of returned message (vi or en), If not included, the default is en.
extraDataStringAdditional data, defined by Merchant
paymentMethodStringAPP, POS, WEB.
terminalTypeStringThe terminal type of which the merchant service applies to.
DESKTOP_BROWSER, MOBILE_BROWSER, MOBILE_APP
descriptionStringDescription for the order.
successRedirectUrlStringRedirect to this url after successful
unSuccessRedirectUrlStringRedirect to this url after unsuccessful
amount.valueIntegerThe amount of the transaction
amount.currencyStringVND
installmentJsonObjectInstallmentInfo
itemsJsonArrayMaximum: 200 items.
Items
customerJsonObjectUser information contains user details like email, phone number etc.
Customer Info
sellerJsonObjectSeller information contains seller details like email, phone number etc.
Seller Info
shippingJsonObjectThis contain the shipping info for an order.
Shipping Info

Data of installment

AttributeTypeRequiredDescription
packageIdString

Data of each items

AttributeTypeRequiredDescription
productIdStringThe Id of item.
productNameStringThe name of item.
descriptionStringThe description of item.
categoryStringThe type of item.
currencyStringVND
quantityIntegerQuantity number of each item. It must be greater than 0
priceIntegerPrice of single unit item
totalAmountIntegerprice x quantity
imageUrlStringLink image of product.

Data of customer

AttributeTypeRequiredDescription
phoneNumberStringMobile number of user. number must have size equals 10 or 11.
096, 0164
rankStringCustomer segmentation.
descriptionStringDescription of the customer.
emailStringValid email of the user.
firstNameStringThe first name.
lastNameStringThe last name.
genderStringThe following values are permitted: M : Male, F: Female, U: UNKNOWN.
dateOfBirthIntegerThe customer's date of birth.
Format ISO-8601: DD-MM-YYYY

Data of seller

AttributeTypeRequiredDescription
idStringSeller Id, Unique identifier generated by the merchant for this seller
emailStringValid email of the user.
nameStringSeller Name.
addressStringAddress of seller

Data of shipping

AttributeTypeRequiredDescription
cityStringThe city of address Shipping.
zipCodeStringThe zipCode of address Shipping.
districtStringThe district of address Shipping.
wardStringThe ward of address Shipping.
streetStringThe street of address Shipping.
streetNumberStringThe streetNumber of address Shipping.
houseNumberStringThe houseNumber of address Shipping.
houseExtensionStringThe houseExtension of address Shipping.
countryStringThe country of address Shipping.

Example Request

{
"merchantId": "Your merchant code",
"referenceId": "Your order number",
"tokenization": "Customer tokenization",
"requestType": "token",
"storeId": "Your store id",
"lang": "vi",
"extraData": "jsonstring",
"description": "description",
"successRedirectUrl": "domain.com",
"unSuccessRedirectUrl": "domain.com",
"paymentMethod": "WEB",
"installment": {
"packageCode": "packageCode"
},
"amount": {
"currency": "VND",
"value": 500000
},
"items": [
{
"productId": "170594",
"productName": "clothes",
"description": "Red",
"quantity": 1,
"category":"na",
"price": 500000,
"currency": "VND",
"totalAmount": 500000

}
],
"customer": {
"phoneNumber": "0912345678",
"email": "youremail@email.com",
"firstName": "Doe",
"lastName": "Test",
"gender": "F",
"dateOfBirth": "17-04-1999"
},
"shipping": {
"city": "Ho Chi Minh",
"zipCode": "00700",
"district": "5",
"ward": "",
"street": "Tran Nhan Ton",
"streetNumber": "Apt 214",
"houseNumber": null,
"houseExtension": null,
"country": "VN"
}
}

Response

ParameterTypeRequiredDescription
merchantIdStringIdentification of the merchant that was issued when registering with Fundiin.
referenceIdStringOrder number for the charge transaction.
responseTimeStringDate & Time of response:
Format: YYYY-MM-DD hh:mm:ss
resultStatusStringResult status
resultMsgStringThe result message which contains information about the result.

By default expiry time for the order created is 30 minutes from order creation time stamp. If this needs to be extended for more than 30 minutes please contact Fundiin.

{
"responseTime": "2024-04-23 17:05:32",
"resultStatus": "APPROVED",
"resultMsg": "The transaction was approved.",
"merchantId": "FundiinVN",
"referenceId": "Your order number",
"amount": 70000,
"paymentTransId": "Payment Transaction Id"
}

Result Status & Messages

Status codeDescriptionAction to take
APPROVEDThe transaction was successfully initial.
ACCESS_DENIEDAccess denied.Please check your settings in merchant portal, or contact Fundiin for configurations.
TOKEN_USER_INVALIDThe token is requiredPlease send Fundiin token user to purcharge order
PAYMENT_DECLINEDThe user is violate some rules.Please check your settings in merchant portal, or contact Fundiin for configurations.
USER_KYC_NOT_QUALIFIEDThe user's KYC status does not qualify for the payment.Please check your EKYC status.
USER_CANNOT_PURCHARGE_ORDERUser cannot purcharge OrderTry Again After Or Contact Fundiin
RISK_REJECTThe payment is rejected due to risk concerns.Ensure that the request parameters are correct and meet the API requirements.
INVALID_REFERENCE_IDThe referenceId is invalidPlease retry with a different referenceId.
DUPLICATE_REFERENCE_IDThe referenceId is duplicatedYou can inquiry this referenceId in transaction status, or retry with a different referenceId.
INVALID_CLIENT_IDThe cliendId is not registeredMake sure to use a valid and registered clientId for the request.
INVALID_SIGNATUREThe signature is invalid.Double-check the signature generation process to ensure its correctness.
INVALID_MERCHANT_IDThe merchant is not registered.Ensure that the merchant ID is correct and registered with Fundiin.
INVALID_HTTP_METHODThe server does not implement the requested HTTPS method.Use the correct HTTP method (e.g., GET, POST, etc.) when making the request.
INVALID_APIAPI is not defined.Check whether the request URL is correct. Ensure that the endpoint of the called API is correct.
INVALID_AMOUNTPayment amount is invalid.
AMOUNT_EXCEEDED_UPPER_LIMITThe payment amount exceeds the limit at merchant level or account level
AMOUNT_BELOW_MINIMUM_LIMITThe payment amount is below minimun limit.
REQUEST_PROCESSINGThe request already processed or in progress
DOWNSTREAM_ERRORPartner downstream timeout. (Retriable)Retry the request later as the error might be temporary due to partner-related issues.
ERROR_GENERALDeclined due to general reasons other than the specific decline error codes provided.Contact Fundiin support for assistance in identifying and resolving the general issue.