Skip to main content

How it works

Accept online payments on your website or app. The Yeti ECOM API works hand-in-hand with Adyen's Drop-in and Components -- you use Adyen's frontend libraries to show a payment form to your customers, and your server talks to Yeti to make the payment happen.

If you've used Adyen before, you'll feel right at home. The request and response shapes are the same ones you already know.

How it fits together

┌──────────────────┐       ┌──────────────────┐       ┌──────────────────┐
│ Your customer's │ │ Your server │ │ Yeti ECOM API │
│ browser │ │ │ │ │
│ │ │ │ │ │
│ Adyen Drop-in / │◄─────►│ Your backend │◄─────►│ api.yeti.host │
│ Components │ │ code │ │ /v1/ecom/... │
└──────────────────┘ └──────────────────┘ └──────────────────┘

Your server talks to Yeti using a Bearer token. On the frontend, Adyen's client-side libraries handle the payment form and any extra steps like 3D Secure. Yeti takes care of merchant routing, payment splits, and configuration behind the scenes -- you don't need to worry about any of that.

Base URLs

EnvironmentURL
Productionhttps://api.yeti.host/v1/ecom
Testhttps://test.yeti.host/v1/ecom

How to accept a payment

There are two ways to integrate, plus a handful of things you can do after a payment goes through.

Sessions (the easiest way)

This is what we'd recommend for most people. Your server creates a checkout session, hands it to the Adyen Drop-in, and the Drop-in takes it from there -- it shows the payment form, handles 3D Secure, and deals with redirects. You don't need to get involved.

Your server                          Yeti API
│ │
│── GET /v1/ecom/config ────────────►│
│◄── { clientToken } ───────────────│
│ │
│── POST /v1/ecom/{siteId}/sessions ►│
│◄── session (id, sessionData) ──────│
│ │
▼ │
Pass clientToken + session │
to Adyen Drop-in on your page │

The Drop-in handles the payment, │
3DS, and any redirects for you │

│◄── Webhook (async) ───────────────│

You'll use: GET /config and POST /sessions

Advanced (more control)

If you need to manage each step yourself -- choosing which payment methods to show, handling form submissions, dealing with 3D Secure -- this flow gives you that control. You use Adyen Components instead of the Drop-in and call the Yeti API at each stage.

Your server                          Yeti API
│ │
│── GET /v1/ecom/config ────────────►│
│◄── { clientToken } ───────────────│
│ │
│── POST /v1/ecom/{siteId}/ │
│ payment-methods ────────────────►│
│◄── available methods ──────────────│
│ │
▼ │
Show Adyen Components on your page │

Customer fills in their details │
│ │
│── POST /v1/ecom/{siteId}/payments ►│
│◄── PaymentResponse ───────────────│
│ │
│ (if 3DS is needed) │
│── POST /v1/ecom/{siteId}/ │
│ payments/details ───────────────►│
│◄── Final result ──────────────────│
│ │
│◄── Webhook (async) ───────────────│

You'll use: GET /config, POST /payment-methods, POST /payments, and POST /payments/details

After the payment

Once a payment's been authorised, you might need to capture it, reverse it, or change the amount. Here's what's available:

What you want to doEndpointWhen you'd use it
CapturePOST /{siteId}/payments/{pspReference}/capturesYou're using manual capture and want to take the money now (like when an order ships)
ReversePOST /{siteId}/payments/{pspReference}/reversalsYou need to cancel or refund -- the API works out which one for you
Update amountPOST /{siteId}/payments/{pspReference}/amount-updatesThe final amount has changed (like a hotel booking or order edit)

Getting started

Here's what you need to do:

  1. Get an API key from Basecamp. More on this in Authentication.
  2. Grab your client token by calling GET /v1/ecom/config from your server.
  3. Set up Adyen Drop-in on your frontend using that client token. Adyen's guide will walk you through this.
  4. Create a session with POST /v1/ecom/{siteId}/sessions and pass the result to the Drop-in.
  5. Listen for webhooks to know when payments are finalised. See Webhooks.
  6. Use Adyen test cards to exercise your flows end-to-end. See Test Cards for commonly used card numbers and scenarios.

All the endpoints

MethodEndpointWhat it does
GET/v1/ecom/configGets the client token for your frontend
POST/v1/ecom/{siteId}/sessionsCreates a checkout session
POST/v1/ecom/{siteId}/payment-methodsGets available payment methods for a site
POST/v1/ecom/{siteId}/paymentsStarts a payment
POST/v1/ecom/{siteId}/payments/detailsSends extra details (like 3DS results)
POST/v1/ecom/{siteId}/payments/{pspReference}/capturesCaptures an authorised payment
POST/v1/ecom/{siteId}/payments/{pspReference}/reversalsRefunds or cancels a payment
POST/v1/ecom/{siteId}/payments/{pspReference}/amount-updatesChanges the authorised amount

Adyen resources

Since you'll be using Adyen's frontend libraries, you'll probably find these handy: