Create PayIn
To be able to successfully create a payment link you would need the following APIs in consideration:
- Step 1: Call the Get PayIn Methods API to retrieve available payment methods.
- Step 2: Call the Create PayIn with the selected method and sender details.
- Step 3: Redirect the customer to the generated
payment_linkto complete the checkout. - Step 4: In the sandbox environment, use the Simulate PayIn API to test payment outcomes.
curl --request POST \
--url https://api.cleverhub.co/api/v3/payin_links \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"amount": 100000,
"payin_method_code": "vn_vietqr_vnd",
"expires_in": null,
"description": "Top-up wallet",
"external_id": "123456",
"redirect_url": {
"success": "https://example.com/success",
"failure": "https://example.com/failure"
},
"webhook_notification": {
"endpoint_url": "https://example.com/webhook",
"authorization_header": "Header 123456789"
},
"sender_info": {
"email": "email@gmail.com",
"first_name": "John",
"last_name": "Doe",
"gender": "male",
"contact_type": "individual",
"dob": "1990-01-01",
"reg_no": "A1234567",
"state": "Ho Chi Minh",
"user_id": "user_12345",
"upi_id": "johndoe@upi",
"phone": "0123456789",
"country_code": "VN",
"address": "123 abc",
"city": "Ho Chi Minh City",
"postal_code": "700000",
"account_name": "John Doe",
"account_number": "233240000000",
"bank_code": "VCB",
"document_type": "passport",
"document_number": "P123456789"
},
"metadata": {
"custom_note": "Priority customer"
},
"create_payment_link_jpy_example": {
"amount": 100000,
"payin_method_code": "jp_bank_jpy",
"expires_in": null,
"description": "Top-up wallet",
"external_id": "123456",
"redirect_url": {
"success": "https://example.com/success",
"failure": "https://example.com/failure"
},
"webhook_notification": {
"endpoint_url": "https://example.com/webhook",
"authorization_header": "Header 123456789"
},
"sender_info": {
"first_name": "John",
"last_name": "Doe"
},
"metadata": {
"transliterate": true
}
}
}
'{
"uuid": "Z2Q3FWBW",
"payment_url": "https://example.com/ZSxw187",
"expires_at": "2025-07-24T16:00:00Z"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Email is missing in sender information"
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
Transaction amount.
Description of the payment transaction
Information about the customer.
Show child attributes
Show child attributes
Specific payin method code to be used for this payment. You will receive this from the Get payment methods API Optional — if not provided, user will choose from available methods.
Expiration time of transaction (seconds). Default: 1800 (30 min), Min: 900 (15 min).
Custom ID.
Show child attributes
Show child attributes
Webhook configuration for transaction status updates
Show child attributes
Show child attributes
Optional custom metadata to attach to the transaction.
Show child attributes
Show child attributes
Optional. Splits the payin across Payments Accounts with a platform fee (Clever Connect, Dedicated Balance only, and fund splitting must be enabled for the currency). See Platform Fees.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.cleverhub.co/api/v3/payin_links \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"amount": 100000,
"payin_method_code": "vn_vietqr_vnd",
"expires_in": null,
"description": "Top-up wallet",
"external_id": "123456",
"redirect_url": {
"success": "https://example.com/success",
"failure": "https://example.com/failure"
},
"webhook_notification": {
"endpoint_url": "https://example.com/webhook",
"authorization_header": "Header 123456789"
},
"sender_info": {
"email": "email@gmail.com",
"first_name": "John",
"last_name": "Doe",
"gender": "male",
"contact_type": "individual",
"dob": "1990-01-01",
"reg_no": "A1234567",
"state": "Ho Chi Minh",
"user_id": "user_12345",
"upi_id": "johndoe@upi",
"phone": "0123456789",
"country_code": "VN",
"address": "123 abc",
"city": "Ho Chi Minh City",
"postal_code": "700000",
"account_name": "John Doe",
"account_number": "233240000000",
"bank_code": "VCB",
"document_type": "passport",
"document_number": "P123456789"
},
"metadata": {
"custom_note": "Priority customer"
},
"create_payment_link_jpy_example": {
"amount": 100000,
"payin_method_code": "jp_bank_jpy",
"expires_in": null,
"description": "Top-up wallet",
"external_id": "123456",
"redirect_url": {
"success": "https://example.com/success",
"failure": "https://example.com/failure"
},
"webhook_notification": {
"endpoint_url": "https://example.com/webhook",
"authorization_header": "Header 123456789"
},
"sender_info": {
"first_name": "John",
"last_name": "Doe"
},
"metadata": {
"transliterate": true
}
}
}
'{
"uuid": "Z2Q3FWBW",
"payment_url": "https://example.com/ZSxw187",
"expires_at": "2025-07-24T16:00:00Z"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Email is missing in sender information"
}
}