Accepting a payment
Integrate with the Yoco Checkout API to securely accept payments on your website.
Always call the Yoco Checkout API from your server, not directly from the browser or client-side code. This protects your secret API keys and ensures you can securely track and verify payment status on your server.
Steps to accept a payment
Register webhook
Register a webhook endpoint to receive payment success events.
For more information on registering the webhook, see the webhooks guide.
Create a checkout
Make an authenticated POST request from your server to
https://payments.yoco.com/api/checkouts
with the required details.
For more information on the request body, see the create a checkout API reference.
For more information on authentication, see the authentication guide.
Do not use successUrl
from the response to verify payment success. Always use webhooks for confirmation.
Redirect the customer
Use the redirectUrl
from the response to send your customer
to the Yoco Checkout page.
Verify payment success
Listen for the webhook event on your server to confirm the payment was successful before fulfilling the order.
For more information on payment notification webhook, see the API reference.
For more information on errors, see the errors documentation.