Getting Started
This guide walks you through your first online payment with the Yeti ECOM API. You'll create a session, render the Adyen Drop-in, and receive a webhook — all in under 10 minutes.
Prerequisites
- A Basecamp account with access to API keys
- An ecommerce site configured in Basecamp
- A basic understanding of server-side and client-side web development
Step 1: Get your API key
- Log in to Basecamp.
- Go to API keys and create a new key for your merchant account.
- Store it securely — you'll use it only on your server, never in browser code.
If you don't see the API keys section, you may need account owner access. Contact your account administrator.
Step 2: Get your client token
From your server, call the config endpoint to fetch the client token. This is the only value from the API that's safe to use in browser-side code.
curl -X GET https://test.yeti.host/v1/ecom/config \
-H "Authorization: Bearer YOUR_API_KEY"
You'll get back a clientToken — pass this to the Adyen Drop-in as clientKey.
Step 3: Create a session
Create a checkout session with your site ID, amount, and return URL:
curl -X POST https://test.yeti.host/v1/ecom/YOUR_SITE_ID/sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": { "value": 2500, "currency": "GBP" },
"returnUrl": "https://your-site.com/checkout/result",
"reference": "test-order-001"
}'
The response includes id and sessionData. You'll pass both to the Drop-in.
Step 4: Render the Drop-in on your page
Add the Adyen Web Drop-in to your checkout page. Use the clientToken from Step 2 and the session from Step 3:
<div id="dropin-container"></div>
<script src="https://checkoutshopper-test.adyen.com/checkoutshopper/sdk/5.x/checkoutshopper.js"></script>
<script>
(async function () {
const clientToken = "YOUR_CLIENT_TOKEN"; // from GET /config
const session = { id: "SESSION_ID", sessionData: "SESSION_DATA" }; // from POST /sessions
const checkout = await AdyenCheckout({
environment: "test",
clientKey: clientToken,
session: session,
onPaymentCompleted: (result) => {
console.log("Payment completed:", result);
window.location.href = "/checkout/success";
},
onError: (error) => {
console.error("Payment error:", error);
},
});
checkout.create("dropin").mount("#dropin-container");
})();
</script>
In a real integration, your server would fetch the client token and create the session, then pass the values to your frontend template.
Step 5: Receive the webhook
When the customer completes (or abandons) the payment, Yeti sends a webhook to the URL you've configured in Basecamp.
- In Basecamp, go to Webhooks and add a subscription.
- Enter your HTTPS endpoint URL and save the HMAC secret.
- Implement signature verification — see Webhooks for how.
Your webhook handler should return 200 quickly. Use the event to update your order status, trigger fulfillment, or send a confirmation email.
Step 6: Test with Adyen test cards
Use Adyen's test cards — they only work in the test environment:
| Card | Number | Result |
|---|---|---|
| Visa (success) | 4111 1111 1111 1111 | Authorised |
| Mastercard | 5555 5555 5555 4444 | Authorised |
Expiry: any future date. CVC: any 3 digits.
For more scenarios (declines, 3D Secure, etc.), see Test Cards.
What's next?
- Authentication — Understand API keys and security
- Sessions — Full session API reference
- Webhooks — Event types, verification, and retries
- Payments — Capture, reverse, and amount updates