Authentication
To interact with the Checkout API, you need to authenticate your requests using your API integration keys. These keys ensure that your payments are securely linked to your business.
How authentication works
You can find your secret key in the Yoco App after signing up. Open the Checkout API integration and tap How to connect.
The secret key should be included in the header of the API request using
bearer authentication
and the Authorization header.
To do this, prepend Bearer to the secret key and insert it into the Authorization header:
- Use your Test secret key, starting with
sk_test_..., for testing and development. - Use your Live secret key, starting with
sk_live_..., for real transactions in production.
Never expose your secret key in client-side code or public repositories. Keep it secure on your server.
Domain verification
Your Test public key and Test secret key are available when you open How to connect. Your Live public key and Live secret key stay locked until you verify at least one domain under Verified Domains.
Open the Checkout API integration in the Yoco App and tap How to connect.
Test keys are available immediately. You can build and test your integration before your domain is verified.
Live payments must originate from one of your verified domains. If you share checkout links with your customers away from your website, by email, SMS, or WhatsApp, see sharing checkout links.
Test mode
Test mode allows you to test your integration without the risk of affecting real transactions or moving actual money.
To enable test mode, use your Test secret key in the Authorization header.
In test mode, the processingMode field in the Checkout object is set to test. This field is
included in the response for
checkout creation.
To complete a test payment, use the Test card details page in the Yoco App.
- Test transactions don’t appear in your Sales History.
- Refunds aren’t supported for transactions made in test mode.