Direct API Integration

For robust integration directly into your platform

Direct API integration requires vertical SaaS software platform to submit transactions directly to Preczn using our REST API

2434

All transaction types are available through Direct API Integration, with the option to use either customer-supplied payment credentials, or existing tokens. (More info on tokenization available here)

As illustrated above, Direct API Payment Integration allows your merchant payment page to be hosted in your vertical SaaS platform software, which then securely submits payment data to Preczn API & routes through Preczn Core to specified Transaction Processors.

Authentication

Preczn API requires authentication using an API key generated by Preczn platform. An invalid API key will cause the request to be rejected. The API key is expected as an HTTP header in the x-api-key header field.

Transaction Body

Transaction is submitted as a JSON object inside the body of an HTTP POST request. There are 5 different transaction types:

  • Sale - A transaction that is immediately settled at the next batch cycle and funded thereafter
  • Auth - An authorization that must be captured prior to being settled and funded
  • Capture - A request to capture a previous authorization
  • Refund - A Refund request returns a specific amount back to a customer based on previous settled Sale or Capture transaction
  • Void - A void request cancels a previous unsettled Sale/Auth/Capture or Refund.

Transaction Idempotency

In order to prevent accidental duplicate processing of transactions in the event of network errors, timeouts, or other transient technical issues, our API supports idempotency, allowing you to retry requests without processing the same transaction multiple times.

The idempotency key is generated by the client making the API request and is expected in the idempotency-key HTTP request header. Our API then checks if the request is a duplicate; if a duplicate is found then the server returns the same response as it did for the previous request without processing a new transaction. If the request is determined not to be a duplicate then it is processed normally.

A duplicate request is determined by the matching the following values with a previous request received within the last 24 hours:

  1. idempotency-key
  2. type
  3. amount

If an idempotency-key is received and matches that of a previous transaction within the last 24 hours but the other values do not match, our API will respond with an HTTP 400 error response with the following body:

{
    "statusCode": 400,
    "message": "Idempotency Error",
    "error": "Bad Request"
}

For detailed API request info, please see What's Next below.