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.nexetpay.com/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.
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"}}
Code
type
Meaning
400
invalid_request
Missing or invalid parameter.
401
authentication_error
API key missing, invalid or revoked.
402
card_declined
Payment declined by the card issuer.
404
not_found
The requested resource does not exist.
409
idempotency_conflict
Idempotency key reused with a different body.
429
rate_limit
Too many requests: retry with increasing backoff.
500
api_error
Incident 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/payments
Create a payment (immediate capture or authorisation).
GET
/v1/payments/{id}
Retrieve a payment and its status.
GET
/v1/payments
List payments, with status and date filters.
POST
/v1/payments/{id}/capture
Capture all or part of an authorisation.
POST
/v1/payments/{id}/refunds
Refund a payment, in full or in part.
Payment links
Create shareable payment links, with a fixed or open amount.
POST
/v1/payment_links
Create a payment link and its QR code.
GET
/v1/payment_links/{id}
Retrieve a link and its payment counter.
GET
/v1/payment_links
List payment links.
POST
/v1/payment_links/{id}/deactivate
Deactivate a link before its expiry date.
Subscriptions
Define plans and manage the subscription lifecycle.
POST
/v1/plans
Create a subscription plan (amount, frequency, trial).
POST
/v1/subscriptions
Subscribe a customer to a plan.
GET
/v1/subscriptions/{id}
Retrieve a subscription and its current cycle.
POST
/v1/subscriptions/{id}/cancel
Cancel a subscription, immediately or at period end.
Invoices
Issue invoices and track their payment.
POST
/v1/invoices
Create an invoice with its line items and VAT.
POST
/v1/invoices/{id}/send
Email the invoice with its payment button.
GET
/v1/invoices/{id}
Retrieve an invoice and its payment status.
GET
/v1/invoices
List invoices.
Customers
Store your customers and their tokenised payment methods.
POST
/v1/customers
Create a customer and store their payment methods.
GET
/v1/customers/{id}
Retrieve a customer.
GET
/v1/customers
List 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.