n1coePayDocs API reference

Accept cards without touching card data

Your server calls the ePay API and your page shows the n1co.js form. The card number never passes through either of them.

Two integration surfaces#

ePay API, on your server#

Uses your secret key sk_…. Creates card sessions and payment intents, reads payments and refunds, and receives signed webhooks.

n1co.js, on your page#

Uses your publishable key pk_…. Shows the card element in an n1co iframe, saves cards and confirms payments with 3D Secure.

There is no customer resource: the customer travels inside each request, with your own id, their name, email and phone.

How a payment flows#

How a payment flows with n1co ePay Your server creates a payment intent with the secret key, with the amount, currency and customer, and hands the client secret to your page. The page calls confirmPayment from n1co.js. The n1co.js frame, on the n1co origin, sends the tokenized card to the API and handles 3D Secure if the bank asks for it. The API notifies your server with the payment_intent.succeeded webhook. n1co origin Your page publishable key pk_ n1co.js card iframe Your server secret key sk_ ePay API n1co 1 POST /v1/payment_intents amount · currency · customer 2 id + client_secret 3 client_secret 4 confirmPayment() 5 tokenized card · 3D Secure if the bank asks for it 6 payment_intent.succeeded signed webhook
The arrows follow a payment with a new card. With a saved card, your server attaches it in step 1.
  1. Your server creates a payment intent with the amount, currency and customer.
  2. The API responds with the intent and its client_secret.
  3. Your server hands the client_secret to your page.
  4. Your page calls confirmPayment() from n1co.js.
  5. n1co.js sends the tokenized card and shows 3D Secure if the bank asks for it.
  6. A webhook notifies your server, which fulfills the order.

Guides#