Documentation / Merchant API
OpenAPI reference

Get started

Quickstart

01

Keep secret keys on your server, exchange card details for a PayBridge payment-method ID, then create payment sessions with a stable idempotency key.

  1. 1
    Select a credential

    Test and live keys use the same host. The key determines the processing mode.

  2. 2
    Create a payment method

    Persist only the returned pmt_ ID after the card boundary.

  3. 3
    Create a payment session

    Use one idempotency key per logical attempt and reuse it for safe retries.

POST /api/v1/payment-sessions
curl https://api.paybridge.cloud/api/v1/payment-sessions \
  --request POST \
  --header "x-api-key: $PAYBRIDGE_SECRET_KEY" \
  --header "Idempotency-Key: checkout-order_1042-v1" \
  --header "Content-Type: application/json" \
  --data '{
    "operation": "Deposit",
    "websiteCode": "store-cr",
    "variantCode": "card",
    "amount": "42.50",
    "currency": "USD",
    "merchantReference": "order_1042",
    "customer": { "externalCustomerId": "customer_88" },
    "paymentDetails": {
      "kind": "Card",
      "entryMode": "Token",
      "token": { "type": "PayBridge", "value": "'$PAYMENT_METHOD_ID'" }
    }
  }'

Core model

Payment lifecycle

02

The create response may already be final, require customer action, or wait for the processor. Webhooks and retrieval converge on the same session state.

  • PendingSession accepted and processing has not started.
  • ProcessingThe request is currently with the processor.
  • WaitingForCustomerRedirect or 3DS authentication is required.
  • WaitingForProviderThe processor will deliver an asynchronous result.
  • Completed · Failed · Cancelled · ExpiredThe session reached a final state.

Customer authentication

Redirects and 3DS

04

When nextAction is present, send the customer to its destination. After the customer returns, your server resumes the PayBridge session.

  1. MerchantRedirect using nextAction
  2. CustomerComplete or abandon processor authentication
  3. Merchant serverPOST /payment-sessions/{id}/resume
  4. PayBridgeReturn the reconciled status and emit the transition webhook
Do not infer success from the browser return.

The redirect carries navigation, not payment truth. Read the session status.

Money movement

Operations

05
Payment operations and required links
OperationUseRequired input
DepositSale or customer paymentpaymentDetails
AuthorizeReserve funds without capturepaymentDetails
CaptureSettle an authorizationoriginalSessionId
RefundReturn a completed paymentoriginalSessionId
VoidCancel an authorizationoriginalSessionId

Failure handling

Errors and retries

07
409

Conflict

Retrieve the original payment or correct the conflicting request. Do not invent a new key blindly.

422

Invalid request

Fix the indicated field or business rule. Repeating the same request cannot succeed.

429 / 503

Temporary failure

Retry with exponential backoff and the same idempotency key.

Complete contractOpenAPI schemas and error codes