n1coePayDocs

Get started

Get your keys

Set up your store in n1co ePay and store your three keys.

≈ 3 minutes · curl

Before you start

  • An n1co store.
  • An n1co Integration API application with the "Store administrator" and "Payment gateway" permissions.
  • Your server: Node.js, .NET, PHP, Java or curl.

Step 1Set up your store

Set up your store with your application's client id and client secret. It is the only call without a secret_key.

curl

POST /v1/setup
# The first setup can take about a minute.
curl -s -X POST https://api-epay-sandbox.n1co.shophttps://api-epay.n1co.com/v1/setup \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": "<your application's client id>",
    "client_secret": "<your application's client secret>",
    "webhook_url": "https://hooks.example.com/n1co"
  }'
201Created
{
  "store_id": "0b9f8a52-2f0e-4d84-9a52-6c1f7e0d9a11",
  "store_name": "Example Store",
  "publishable_key": "pk_3x4mpl3pUbl1shabl3k3yAAAAAAAAAAA",
  "secret_key": "sk_3x4mpl3s3cr3tk3yAAAAAAAAAAAAAAAA",
  "webhook": {
    "url": "https://hooks.example.com/n1co",
    "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
  }
}
  • Your pagepublishable_keypk_ and 32 characters
  • Your serversecret_keysk_ and 32 characters
  • Your serverwebhook.secretwhsec_ and 32 characters

Step 2Rotate your keys

Repeat POST /v1/setup with the same client_id and client_secret. The rotated value replaces the old one as soon as the response arrives: deploy it right away. publishable_key is not rotated.

POST /v1/setup
# To rotate webhook.secret, send "rotate_webhook_secret": true.
curl -s -X POST https://api-epay-sandbox.n1co.shophttps://api-epay.n1co.com/v1/setup \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": "<your application's client id>",
    "client_secret": "<your application's client secret>",
    "webhook_url": "https://hooks.example.com/n1co",
    "rotate_secret_key": true
  }'
200OK
{
  "store_id": "0b9f8a52-2f0e-4d84-9a52-6c1f7e0d9a11",
  "store_name": "Example Store",
  "publishable_key": "pk_3x4mpl3pUbl1shabl3k3yAAAAAAAAAAA",
  "secret_key": "sk_3x4mpl3s3cr3tk3yAAAAAAAAAAAAAAAA",
  "webhook": { "url": "https://hooks.example.com/n1co" }
}
You send You receive
"rotate_secret_key": true 200 with a new secret_key
"rotate_webhook_secret": true 200 with a new webhook.secret
A different webhook_url 200 with a new webhook.secret
The same configuration 409 store_already_enabled, no secrets

Your store is ready.

With your keys, continue with your webhooks.

Type to search the documentation.