Hybrid Payment Link
Payin
Step 1. Initiate payment and get payment options.
POST /v2/payment-options
{
"country": "XX",
"currency": "XXX",
"amount": 130,
"redirectUrl": "https://merchant.io/where-to-go",
"language": "EN",
"customer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "+34666999666",
"userDevice": "MOBILE",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
"ip": "84.232.140.77",
"address": {
"street": "32 Windsor Gardens",
"streetNumber": "24",
"country": "GB",
"zipCode": "W9 3RG",
"city": "London",
"state": "Great London."
}
},
"paymentReference": "Invoice ABC123",
"userId": "Merch_User_123",
"extra1": "extraData001",
"extra2": "extraData002",
"extra3": "extraData003",
"tax": "21%",
"shippingAddress": {
"street": "32 Windsor Gardens",
"streetNumber": "24",
"country": "GB",
"zipCode": "W9 3RG",
"city": "London",
"state": "Great London."
},
}
Response: /v2/payment-options
{
"transactionId": "10d36963-fb34-4756-8d14-77c3fee72f78",
"sessionId": "b7f28d15-9cd8-4791-9312-101c6d66f6f0",
"paymentOptions": [
{
"paymentOptionId": "6f19d127-c08e-4898-90d5-9fae561082a4",
"name": "Cash",
"logo": "https://kasha-test.s3.eu-west-1.amazonaws.com/payment-options/cash-test.png",
"extraData": []
},
{
"paymentOptionId": "9ed89bb1-2073-4870-8182-61ecb1bcb4dd",
"name": "Mobile",
"logo": "https://kasha-dev.s3.eu-west-1.amazonaws.com/payment-options/mobile.jpg",
"extraData": []
}
]
}
Step 2. Get payment suboptions.
Request payment suboptions for the paymentOptionId returned in step 1.
Exampe of a response for Cash payment:
{
"statusCode": "085",
"resultType": "option_choice",
"result": {
"paymentOptionId": "6f19d127-c08e-4898-90d5-9fae561082a4",
"transactionId": "10d36963-fb34-4756-8d14-77c3fee72f78",
"sessionId": "b7f28d15-9cd8-4791-9312-101c6d66f6f0",
"options": [
{
"id": "6039",
"name": "Caja Paita",
"logo": null,
"uuid": "3a85e43d-6b97-4959-bd01-4c17fa1414cf",
"formInputs": [
{
"label": "Document type",
"name": "documentType",
"type": "select",
"values": [
{
"value": "DNI",
"name": "DNI"
},
{
"value": "CE",
"name": "CE"
},
{
"value": "RUC",
"name": "RUC"
},
{
"value": "PASS",
"name": "PASS"
}
],
"required": true,
"queryOptions": null,
"validations": null
},
{
"label": "Document ID",
"name": "documentId",
"type": "string",
"values": [],
"required": true,
"queryOptions": null,
"validations": null
}
]
}
]
}
}
Exampe of a response for Mobile payment:
{
"statusCode": "085",
"resultType": "option_choice",
"result": {
"paymentOptionId": "9ed89bb1-2073-4870-8182-61ecb1bcb4dd",
"transactionId": "68d85a15-0674-484a-8884-5a86527b3840",
"sessionId": "ff207b52-0f34-4c96-bf29-46d987a98204",
"options": [
{
"id": "245",
"name": "Orange Money",
"logo": "",
"uuid": "d384670c-642c-4dfc-89f6-c2795e1045db",
"formInputs": [
{
"label": "Voucher / OTP",
"name": "voucher",
"type": "string",
"values": [],
"required": true,
"queryOptions": null,
"validations": null
},
{
"label": "Phone Number",
"name": "phone",
"type": "string",
"values": [],
"required": true,
"queryOptions": null,
"validations": null
}
]
},
{
"id": "246",
"name": "MTN Mobile Money",
"logo": "",
"uuid": "ee8ea3d9-3cee-4223-b470-22b49abe4f29",
"formInputs": [
{
"label": "Phone Number",
"name": "phone",
"type": "string",
"values": [],
"required": true,
"queryOptions": null,
"validations": null
}
]
},
]
}
}
Response: /v2/payment-suboptions
{
"statusCode": "085",
"resultType": "option_choice",
"result": {
"paymentOptionId": "f34deaf0-a854-4d12-ae6a-b309c9feb409",
"transactionId": "ad679871-92df-42eb-bc8b-1e642b3ae9f4",
"sessionId": "21bc3a8f-dad5-4462-ad1c-f893e11c1d01",
"options": [
{
"id": "o_482",
"name": "Bank suboption example 1",
"logo": null,
"uuid": "272655df-d90e-4ffb-bf3f-f5153187e119",
"formInputs": []
},
{
"id": "o_767",
"name": "Bank option example 2",
"logo": null,
"uuid": "d89b915a-7d76-49ef-9388-13c5f7f25cf1",
"formInputs": []
},
{
"id": "o_768",
"name": "Bank option example 3",
"logo": null,
"uuid": "07c27905-bb4f-4189-a00e-dcf170c4be58",
"formInputs": []
}
]
}
}
Step 3. Request Hybrid Payment and get link to the Hosted Cashier
Select suboption(optionId) and add it to the payment request payload toghether with paymentOptionId and the sessionId.
POST /v2/hybrid-payment
{
"sessionId": "21bc3a8f-dad5-4462-ad1c-f893e11c1d01",
"paymentOptionId": "f34deaf0-a854-4d12-ae6a-b309c9feb409",
"optionId": "o_482"
}
Response: /v2/hybrid-payment
{
"statusCode": "300",
"resultType": "redirect",
"result": {
"redirectUrl": "https://cashier.test.kasha.tech/pay?sessionId=21bc3a8f-dad5-4462-ad1c-f893e11c1d01",
"transactionId": "ad679871-92df-42eb-bc8b-1e642b3ae9f4"
}
}
Step 4. User completes the payment
The redirectUrl in the response will redirect to the Hosted Cashier for the user to complete the payment. The additional information the user is asked to provide in this step will vary between payment options and countries. Testing data for these values can be found here.
Hosted Cashier for Mobile MoneyHosted Cashier for Cash payments