Developers

API reference

A predictable REST API: plural resources, JSON in and out, amounts in the currency's smallest unit and explicit errors.

Reference still being aligned with the implementation: confirm every signature with the technical team before relying on it in production. Remove this notice once the documentation is approved.

Base URL

All requests go over HTTPS to this base. Plain HTTP calls are rejected.

https://api.nexet.io/v1

The version is part of the path. A new major version is only released for a breaking change; new fields are added without changing the version.

Authentication

Authentication uses your secret key with HTTP basic auth: the key is the username, the password stays empty.

curl https://api.nexet.io/v1/payments \
  -u sk_test_4dLm…:
  • Each environment has its own key pair: sk_test_… in the sandbox, sk_live_… in production.
  • The secret key must never be exposed in the browser or committed to a repository. It can be revoked and rotated from the merchant space with no downtime.

Idempotency

Every creation endpoint accepts an Idempotency-Key header. Replaying the same key returns the original response instead of creating a second object: no double payment on a network retry.

-H "Idempotency-Key: ord-1042"

Errors

Errors use standard HTTP codes and return an error object describing the cause. Pass the request identifier on to support.

{
  "error": {
    "type": "card_declined",
    "code": "insufficient_funds",
    "message": "The card has insufficient funds.",
    "request_id": "req_8Kd92mLp"
  }
}
CodetypeMeaning
400invalid_requestMissing or invalid parameter.
401authentication_errorAPI key missing, invalid or revoked.
402card_declinedPayment declined by the card issuer.
404not_foundThe requested resource does not exist.
409idempotency_conflictIdempotency key reused with a different body.
429rate_limitToo many requests: retry with increasing backoff.
500api_errorIncident on the Nexet Pay side. The request can be replayed.

Pagination

Lists are cursor-paginated: limit sets the page size, starting_after resumes after the given identifier. The response indicates whether more items remain.

GET /v1/payments?limit=50&starting_after=pay_3jF8dK2m

Payments

Collect, retrieve, capture and refund a payment.

POST/v1/paymentsCreate a payment (immediate capture or authorisation).
GET/v1/payments/{id}Retrieve a payment and its status.
GET/v1/paymentsList payments, with status and date filters.
POST/v1/payments/{id}/captureCapture all or part of an authorisation.
POST/v1/payments/{id}/refundsRefund a payment, in full or in part.

Subscriptions

Define plans and manage the subscription lifecycle.

POST/v1/plansCreate a subscription plan (amount, frequency, trial).
POST/v1/subscriptionsSubscribe a customer to a plan.
GET/v1/subscriptions/{id}Retrieve a subscription and its current cycle.
POST/v1/subscriptions/{id}/cancelCancel a subscription, immediately or at period end.

Invoices

Issue invoices and track their payment.

POST/v1/invoicesCreate an invoice with its line items and VAT.
POST/v1/invoices/{id}/sendEmail the invoice with its payment button.
GET/v1/invoices/{id}Retrieve an invoice and its payment status.
GET/v1/invoicesList invoices.

Customers

Store your customers and their tokenised payment methods.

POST/v1/customersCreate a customer and store their payment methods.
GET/v1/customers/{id}Retrieve a customer.
GET/v1/customersList customers.

Webhooks

Declare an endpoint URL from your merchant space: every event is POSTed there, with exponential retries until acknowledged (2xx response).

Each request carries a Nexet-Signature header with the timestamp and an HMAC signature of the body. Verify it before processing the event, and reject timestamps that are too old.

Nexet-Signature: t=1786982400,v1=5f2c…

Events emitted

payment.succeededpayment.failedpayment.refundeddispute.openedsubscription.renewedsubscription.canceledinvoice.paidinvoice.payment_failedpayout.paid

Test environment

The sandbox is free and unlimited. Simulation cards let you trigger each scenario with no real movement of funds.

ScenarioExpected result
Payment acceptedsucceeded status, simulated settlement.
3-D Secure authentication requiredrequires_action status, then 3DS redirect.
Card declinedcard_declined error with the decline reason.

The full list of test cards and their decline codes is available in your merchant space, under Test environment.

A question about your integration?

Describe your use case: our technical team replies within one business day.

Contact the technical team