Pre-auth API documentation

Overview

The Pre-Authorization API lets your systems create, capture, void and read card pre-authorizations in Paystand. All responses are synchronous, and Paystand never retries a failed capture or void on its own.

A pre-authorization can be created in any of these ways:

  • Customer checkout on a NetSuite Sales Order or Quote
  • Authorize only in Virtual Terminal or Pay with Paystand
  • AutoPay running against a Sales Order
  • The API, with POST /preAuths

It can be captured in two ways:

  • Automatically, when the linked Sales Order converts to an Invoice or Cash Sale in NetSuite (see Automatic capture below)
  • Manually, with POST /preAuths/:id/capture or from the Paystand Dashboard

While a pre-auth is active (pending, authorized or partially_captured), Paystand blocks every other payment attempt against the linked ERP documents. Only captures from that pre-auth are allowed until it is fully captured, voided or expired.

Pre-authorization is available for card payments only.

Authentication and base URLs

Every request needs an OAuth2 Bearer token and your Paystand customer ID in the X-CUSTOMER-ID header.

Authorization: Bearer <access_token>
X-CUSTOMER-ID: <paystand_customer_id>
  • Access token: your implementation manager can share your API credentials.
  • Customer ID: in the Paystand Dashboard, under Integrations > API Configuration Values.
EnvironmentBase URL
Productionhttps://api.paystand.com/v3
Sandboxhttps://api.paystand.co/v3

X-CUSTOMER-ID is required on every request; without it the API returns 400 validationError: Customer context is required. Records are scoped to that customer, so a pre-auth that belongs to another customer returns 404, the same as one that doesn't exist.

Create a pre-authorization

POST /preAuths places a hold on a card your customer has already saved in Paystand. Authorize the amount you expect to capture: a pre-auth should never be larger than what you will capture.

Request body

FieldTypeRequiredDescription
amountnumberYesAmount to authorize. Must be greater than 0.
currencystringYesCurrency code, for example USD.
cardIdstringYesPaystand saved card ID. Raw Stripe or Vantiv tokens are not accepted.
expiresAtstringNoISO 8601 expiry date. Defaults to 7 days after creation.
receivablesarrayNoPaystand receivable or invoice IDs to link to this pre-auth.
idempotencyKeystringNoYour own reference. A retry with the same key won't create a second pre-auth. Applies to this endpoint only.
{
  "amount": 1000.00,
  "currency": "USD",
  "cardId": "crd_abc123",
  "idempotencyKey": "my-system-ref-7890",
  "expiresAt": "2027-01-10T00:00:00Z"
}

Response: 200

{
  "id": "pa_987654",
  "amount": 1000.00,
  "currency": "USD",
  "status": "authorized",
  "amountCaptured": 0,
  "expiresAt": "2027-01-10T00:00:00Z",
  "authorizedAt": "2027-01-03T10:00:00Z",
  "receivables": "[{\"id\":\"inv_001\",\"amountToPay\":\"600.00\"},{\"id\":\"inv_002\",\"amountToPay\":\"400.00\"}]"
}

In this response, receivables is a JSON-encoded string, not an array. Call GET /preAuths/:id afterwards to get the full receivables array, with the amounts and invoice keys you need for captures.

Error: 409 duplicate pre-auth

Only one active pre-auth is allowed per receivable.

{
  "error": {
    "code": "validationError",
    "explanation": "A pre-authorization already exists for one or more of the selected receivables. Only one active pre-authorization is allowed per receivable."
  }
}

Capture a pre-authorization

POST /preAuths/:id/capture settles held funds. You can capture in full, or in several partial captures while the pre-auth is open and unexpired. The request body depends on whether the pre-auth is linked to receivables.

Option A: capture by receivable

Use this when the pre-auth is linked to Paystand receivables. Pass the receivable IDs; Paystand derives the amount from each receivable's amountToPay, as stored when the pre-auth was created, and recalculates fee splits proportionally. You can't pass an amount in this mode.

FieldTypeRequiredDescription
receivablesarrayYesReceivable IDs to capture, as plain strings or { "id": "..." } objects.

Capture all linked invoices:

{ "receivables": ["inv_001", "inv_002"] }

Capture one of two linked invoices:

{ "receivables": ["inv_001"] }

Option B: capture by amount

Use this when the pre-auth has no linked receivables, or to capture a specific amount.

FieldTypeRequiredDescription
amountnumberNoAmount to capture. Must be greater than 0 and no more than the remaining balance. Omit it to capture the full remaining balance.

Partial capture:

{ "amount": 500.00 }

Full capture of the remaining balance:

{}

Response: 200

{
  "preAuth": {
    "id": "pa_987654",
    "status": "partially_captured",
    "amount": 1000.00,
    "amountCaptured": 500.00,
    "currency": "USD",
    "expiresAt": "2027-01-10T00:00:00Z"
  },
  "payment": {
    "id": "pay_11223344"
  }
}

After a capture, status is partially_captured if less than the authorized amount has been captured in total, and captured once it all has. A capture always uses the pre-auth's own currency.

Errors

StatusConditionMessage
400amount is 0 or less, or above the remaining balancecapture_amount must be > 0 and ≤ remaining balance
400Status is not pending, authorized or partially_capturedPreAuth can only be captured when status is authorized, pending, or partially captured
400expiresAt has passed. The status also changes to expired.PreAuth has expired
400Nothing left to capturePreAuth has no remaining amount to capture
400X-CUSTOMER-ID header missingvalidationError: Customer context is required
404Pre-auth not found, or belongs to another customerNOT_FOUND

Processor errors (400)

ProcessorSituationWhat happens
StripeHold already released at Stripe, or amount mismatchPre-auth is marked expired. Message: Capture failed: the authorized amount at the payment provider does not match the expected capture amount.
StripeAny other failureGeneric providerFailureError. The processor's message is not shown.
VantivAny failureThe processor's error is returned as is.

When a capture fails at the processor, the pre-auth's status and amountCaptured don't change, no payment record is created and nothing posts to your ERP.

Retries and duplicate captures

The capture endpoint has no idempotency key. If you send the same partial capture twice while the pre-auth is partially_captured, both are processed. A repeated full capture is rejected because the status is already captured. Before retrying a capture that timed out, call GET /preAuths/:id and check amountCaptured. If you capture from NetSuite, use automatic capture instead of your own script: it is safe to retry.

Automatic capture on Sales Order conversion

For NetSuite merchants, Paystand captures a pre-auth automatically when its Sales Order converts to an Invoice or Cash Sale. You don't need to call the API.

SituationWhat Paystand captures
Invoice matches the remaining holdThe full Invoice amount
Invoice is more than the remaining holdWhat is left on the hold. The difference stays open on the Invoice.
Several Cash Sales from one Sales OrderEach Cash Sale is captured as it's created, until the hold is used up

Automatic capture supports customer-paid processing fees and Sales Orders linked to more than one receivable. It doesn't support credit memos: capture those orders manually. Automatic capture is on by default; your Paystand team can turn it off if you prefer to capture every pre-auth yourself.

Void a pre-authorization

POST /preAuths/:id/void cancels the authorization at the processor and releases whatever is still held on the card. No payment record is created and nothing hits your GL. Voiding costs less than refunding a captured payment.

No request body is needed.

Response: 200

{
  "id": "pa_987654",
  "status": "voided",
  "amount": 1000.00,
  "amountCaptured": 0,
  "currency": "USD"
}

Behavior by current status

Current statusWhat a void does
pending or authorizedCancels at the processor and sets status to voided
partially_capturedReleases the uncaptured remainder at the processor and sets status to voided. Amounts already captured stay captured.
voided or expiredNothing. Returns the record unchanged, so repeating a void is safe.
capturedRejected with 400: Cannot void an already fully captured pre-auth

A void returns 404 if the pre-auth doesn't exist or belongs to another customer.

List and get pre-authorizations

List

GET /preAuths returns an array of pre-auths for the customer in X-CUSTOMER-ID. Pass a LoopBack filter object in ?f= to use where, limit, offset and order.

Get one

GET /preAuths/:id returns the full pre-auth: linked receivables with their amounts and invoice keys, payer details, and every capture made so far. Use it after creating a pre-auth, and before retrying a capture.

{
  "id": "pa_987654",
  "amount": 1000.00,
  "currency": "USD",
  "status": "partially_captured",
  "amountCaptured": 600.00,
  "expiresAt": "2027-01-10T00:00:00Z",
  "authorizedAt": "2027-01-03T10:00:00Z",
  "hasLinkedReceivables": true,
  "payerId": "pyr_abc",
  "payerDisplayName": "Acme Corp",
  "payerEmail": "billing@acme.com",
  "receivables": [
    {
      "id": "inv_001",
      "amountToPay": "600.00",
      "amountRemaining": 0.00,
      "amountCaptured": 600.00,
      "invoiceKey": "INV-2027-001",
      "hasReceivableRecord": true,
      "status": "captured"
    },
    {
      "id": "inv_002",
      "amountToPay": "400.00",
      "amountRemaining": 400.00,
      "amountCaptured": 0,
      "invoiceKey": "INV-2027-002",
      "hasReceivableRecord": true,
      "status": "open"
    }
  ],
  "capturedPayments": [
    {
      "id": "pay_11223344",
      "amount": 600.00,
      "status": "posted",
      "datePaid": "2027-01-03T12:00:00Z",
      "currency": "USD"
    }
  ]
}

In receivables, amountToPay is a string and the other amounts are numbers.

Receivable statusMeaning
capturedFully captured: amountCaptured is at least amountToPay
releasedThe pre-auth was voided before this receivable was captured
Any other valueThe receivable's own Paystand status, for example open or paid

Returns 404 if the pre-auth doesn't exist or belongs to another customer.

PreAuth object

FieldTypeDescription
idstringPre-auth ID
amountnumberAmount originally authorized
currencystringCurrency code
statusstringSee status values below
amountCapturednumberTotal captured so far, across all partial captures
expiresAtstring (ISO 8601)When the authorization expires. Also shown in the Paystand Dashboard.
authorizedAtstring (ISO 8601)When the processor confirmed the hold
paymentIdstringID of the most recent capture payment
capturedPaymentIdsstringJSON-encoded array of every capture payment ID
cardIdstringPaystand saved card ID used for the hold
providerstringProcessor: stripe or vantiv
receivablesarrayLinked receivables, each with id, amountToPay, currency and invoiceKey. amountToPay is fixed at creation and sets the amount for captures by receivable.
hasLinkedReceivablesbooleanWhether any receivables are linked (returned by GET /preAuths/:id)
payerId, payerDisplayName, payerEmailstringPayer details (returned by GET /preAuths/:id)
capturedPaymentsarrayEvery capture payment with its amount, status and date (returned by GET /preAuths/:id)
idempotencyKeystringThe key sent when the pre-auth was created
metadataobjectAny extra data stored with the pre-auth

Status values

StatusMeaning
pendingCreated; the processor authorization is in progress
authorizedHold is active and nothing has been captured yet
partially_capturedPart of the hold has been captured; the rest is still available
capturedFully captured; the pre-auth is closed
voidedCancelled at the processor; the hold is released and no money moved
expiredThe expiry date passed or the processor released the hold. Create a new pre-auth to collect.

GL and ERP behavior

Only captures create payments and post to your ERP and GL.

EventPayment recordERP updateGL impact
Pre-auth createdNoNoNo
Partial captureYesYes (Partially Paid)Yes
Full captureYesYes (Paid)Yes
VoidNoNoNo
ExpiryNoNoNo
Was this article helpful?
0 out of 0 found this helpful