API Reference

The NfcPay API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Authentication

Authenticate your account when using the API by including your secret API key in the request. You can manage your API keys in the Merchant Dashboard. Your API keys carry many privileges, so be sure to keep them secure!

cURL
curl https://api.nfcpay.cloud/v1/bridge/session \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

Create a Bridge Session

Creates a new secure tunnel session. The client phone will use this session ID to transmit the encrypted card cryptogram.

POST /v1/bridge/session

Parameters

Name Description
amount *
integer
Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00).
currency *
string
Three-letter ISO currency code, in lowercase. Must be a supported currency.

Response Example

JSON
{
  "id": "sess_1MoZ2sLkdIwHu7ix",
  "object": "bridge_session",
  "amount": 1099,
  "currency": "usd",
  "status": "requires_client_tap",
  "created": 1679600000
}

Retrieve a Session

Retrieves the details of an existing bridge session. You need only supply the unique session identifier that was returned upon session creation.

GET /v1/bridge/session/{id}

Webhooks

NfcPay uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when a customer finally taps their card and the host emulation succeeds.

Webhook Payload (JSON)
{
  "id": "evt_1MoZ2s",
  "type": "session.emulation_successful",
  "data": {
    "object": {
      "id": "sess_1MoZ2sLkdIwHu7ix",
      "amount": 1099,
      "status": "completed"
    }
  }
}