Manage customer
Proper customer management is not only a technical best practice but also essential for enhancing user experience, streamline operations, and driving business success.
This guide explains how and why to use registered customers with Voucherly.
Development Guide
1. Prepare your request
- First payment
- Next payment
When creating a Payment, include the customer details.
Example Request
{
"mode": "Payment",
[...]
"customerEmail": "mario.rossi@voucherly.it",
"customerFirstName": "Mario",
"customerLastName": "Rossi",
[...]
}
Before creating a Payment retrieve the Voucherly customerId. Then include it as part of the request payload to ensure proper processing
Example Request
{
"mode": "Payment",
[...]
"customerId": "my-customer-id-1",
[...]
}
You can also pass the customer details to update them.
Example Request
{
"mode": "Payment",
[...]
"customerId": "my-customer-id-1",
"customerEmail": "mario.rossi@voucherly.it",
"customerFirstName": "Mario Luigi",
"customerLastName": "Rossi",
[...]
}
2. Handle the response
Example response
{
"id": "my-payment-id-1",
"tenant": "live",
"mode": "Payment",
"customerId": "my-customer-id-1",
[...]
"checkoutUrl": "https://example.voucherly.it/checkout",
"status": "Requested",
[...]
}
- First payment
- Next payment
If you haven't provided a customerId in your initial request, you should:
- Extract the
customerIdfrom the response. - Save it to your database.
- Include it in subsequent requests for the same customer.
Since you've provided a customerId in your initial request, will automatically reference the corresponding existing Customer for the Payment.
No further action is required on your part.
Why? Benefits!
- Streamline Checkout.
- Prefill customer details like name and email, reducing manual input.
- Save customer preferences and payment methods for quicker future checkouts.
- Reduce friction. For example, Payment gateways like Edenred use Single Sign-On (SSO). Voucherly can maintain active sessions, improving the purchase flow.
- Simplified Reconciliation. Associating every payment with a customer enables clear transaction tracking. This is particularly useful for managing refunds, sales analysis and accounting audits.