Pay By Link
Send your customers a unique link via email, WhatsApp or SMS to pay online in one click!
Before you begin
This page explains how to create payment links programmatically using MONEI Payments API. You can also create payment links in your MONEI Dashboard.
To test your integration:
- Use your test mode Account ID and API Key.
- Make sure you have all payment methods configured. Check the Payment Methods section for more details about each payment method.
- You can check the status of a test payment in your MONEI Dashboard → Payments (in test mode).
Integration
1. Create a Payment Server-side
Create a Payment on your server with an amount and currency.
- cURL
- Node.js
- PHP
curl --request POST 'https://api.monei.com/v1/payments' \
--header 'Authorization: pk_test_3c140607778e1217f56ccb8b50540e00' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 110,
"currency": "EUR",
"orderId": "14379133960355",
"description": "Test Shop - #14379133960355",
"customer": {
"email": "john.doe@microapps.com"
}
}'
const {Monei} = require('@monei-js/node-sdk');
const monei = new Monei('pk_test_36cf3e8a15eff3f5be983562ea6b13ec');
monei.payments.create({
amount: 110,
currency: 'EUR',
orderId: '14379133960355',
description: 'Test Shop - #14379133960355',
customer: {
email: 'john.doe@microapps.com'
}
});
$monei = new Monei\MoneiClient('pk_test_36cf3e8a15eff3f5be983562ea6b13ec');
$monei->payments->create([
'amount' => 110,
'currency' => 'EUR',
'orderId' => '14379133960355',
'description' => 'Test Shop - #14379133960355',
'customer' => [
'email' => 'john.doe@microapps.com'
]
]);
The following parameters are required:
- amount
positive integer
- Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD) - currency
string
- Three-letter ISO currency code, in uppercase. Must be a supported currency. - orderId
string
- An order ID from your system. A unique identifier that can be used to reconcile the payment with your internal system.
Check all available request parameters.
2. Send a payment link to your customer
In the response from the first request you'll get the payment id
:
{
"id": "af6029f80f5fc73a8ad2753eea0b1be0",
"amount": 110,
"currency": "EUR",
"orderId": "84370745531439",
...
}
Use payment id
to send a payment link to your customer. If you provided customer email
in the first request, MONEI will send the payment link to your customer via email. If you only provided customer phone
, MONEI will try to send the payment link via WhatsApp, if the phone number is not registered in WhatsApp, MONEI will send the payment link via SMS.
You can also specify the delivery channel
manually in the request body.
- cURL
- Node.js
- PHP
curl --request POST 'https://api.monei.com/v1/payment/af6029f80f5fc73a8ad2753eea0b1be0/link' \
--header 'Authorization: pk_test_3c140607778e1217f56ccb8b50540e00' \
--header 'Content-Type: application/json' \
--data-raw '{
"language": "es",
}'
const {Monei} = require('@monei-js/node-sdk');
const monei = new Monei('pk_test_36cf3e8a15eff3f5be983562ea6b13ec');
monei.payments.sendLink({
language: 'es'
});
$monei = new Monei\MoneiClient('pk_test_36cf3e8a15eff3f5be983562ea6b13ec');
$monei->payments->sendLink([
'language' => 'es'
]);
See the full list of request parameters.