Quick Start

First hosted checkout payment on Fin staging in under 5 minutes.

This guide walks you through a complete hosted checkout payment on the Fin staging environment — from creating a payment link to checking status and issuing a refund.

📘

Prerequisites: Merchant API key (x-api-key), Fin staging access, and a tool to send JSON requests (Postman, ReadMe Try It, or your backend HTTP client). For a full PHP walkthrough, see the Hosted Checkout Guide.


Before you begin

RequirementDetail
API keyIssued during DigetPay merchant onboarding — see API Key Management documentation
EnvironmentFin staging only for this guide
AmountUse a small test amount (e.g. 0.20 SAR)
PhonecustomerPhone is required — needed for Apple Pay and gateway processing
🚧

Important: Never use production API keys on Fin staging. Keep keys server-side only.


Step 1 — Create a payment link

Endpoint: POST https://fin-api.digetpay.com/v1/payment/checkout/intiate

🚧

Legacy path: The path is spelled intiate. Do not use /payment/checkout/session on Fin.

Request payload

{
  "merchantOrderId": "PAY-20260619-001",
  "amount": 0.20,
  "currency": "SAR",
  "customerName": "Ahmed Ali",
  "customerEmail": "[email protected]",
  "customerPhone": "501223324",
  "successUrl": "https://fin-admin.digetpay.com/pay/checkout/success",
  "failureUrl": "https://fin-admin.digetpay.com/pay/checkout/failure"
}

Responses

{
  "success": {
    "status": 201,
    "body": {
      "id": "70471003-64ee-4ae7-a639-e607b45e890b",
      "redirectUrl": "https://fin-admin.digetpay.com/pay/checkout?sessionId=70471003-64ee-4ae7-a639-e607b45e890b"
    }
  }
}
FieldWhat to do with it
idCheckout session UUID — store for reconciliation
redirectUrlSend the customer here to pay

Success: If you receive redirectUrl, open it in a browser to continue to Step 2.

Reference: See Create Payment Link documentation for additional parameters and error codes.


Step 2 — Complete payment on checkout

  1. Open redirectUrl in a browser.
  2. Pay with test card or Apple Pay (Safari / iOS).
  3. After payment, you are redirected to successUrl or failureUrl.
❗️

Critical — Apple Pay: customerPhone must be sent in Step 1. It is not collected on the checkout UI. Missing phone breaks Apple Pay.

🚧

Important: A redirect to successUrl does not confirm payment. Always verify with Step 3 or webhooks.

Reference: See Hosted Checkout Page documentation for UI customization and payment method options.


Step 3 — Check transaction status

After payment, use the gateway transaction ID (UUID format) — not the checkout session ID.

Endpoint: GET https://fin-api.digetpay.com/v1/payment/checkout/status?id={gatewayTransactionId}

Request payload

{
  "headers": {
    "x-api-key": "YOUR_API_KEY"
  },
  "query": {
    "id": "2232e99b-0257-47d5-bbfd-022c8951767f"
  }
}

Responses

{
  "success": {
    "status": 200,
    "body": {
      "code": 200,
      "message": "Success",
      "errorCode": null,
      "data": {
        "content": [
          {
            "transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
            "amount": "0.20",
            "transactionStatus": "SUCCESS",
            "paymentStatus": "APPROVED",
            "refundStatus": "NONE"
          }
        ],
        "totalElements": 1
      }
    }
  }
}
❗️

Critical: Using the checkout session ID instead of the gateway transaction ID is the #1 integration mistake. Understand the difference between session IDs and transaction IDs before going live.

Look for transactionStatus: SUCCESS and refundStatus: NONE before fulfilling the order.

Reference: See Query Transaction Status documentation for all possible status values and reconciliation workflows.


Step 4 — Refund (optional)

Endpoint: POST https://fin-api.digetpay.com/v1/payment/refund

Request payload

{
  "transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
  "amount": 0.20
}

Responses

{
  "success": {
    "status": 200,
    "body": {
      "code": 200,
      "message": "Success",
      "errorCode": null,
      "data": {
        "result": "accepted",
        "referenceId": "2026001124",
        "paymentId": "0808779145497567115585",
        "message": "Refund Created Successfully!",
        "amount": "0.20",
        "refundId": "1046772"
      }
    }
  }
}
📘

Expected success indicator: result: accepted in the response body.

Reference: See Process Refund documentation for partial refunds, refund status tracking, and webhook notifications.


Quick reference — Fin staging

ItemValue
API basehttps://fin-api.digetpay.com/v1
Checkouthttps://fin-admin.digetpay.com/pay/checkout
Auth headerx-api-key: YOUR_API_KEY
Recommended success URLhttps://fin-admin.digetpay.com/pay/checkout/success
Recommended failure URLhttps://fin-admin.digetpay.com/pay/checkout/failure

What to do next

  • Hosted Checkout Integration Guide — Full sequence diagram and production considerations.
  • PHP Integration — Step-by-step PHP code for hosted checkout implementation.
  • Testing Guide — Checklist, Postman collection, and troubleshooting common issues.
  • API Reference — Complete endpoint documentation with schemas and examples.

Common integration patterns

Webhook verification

Set up webhook listeners to receive real-time payment status updates instead of polling. Configure webhook endpoints in your merchant dashboard and validate signatures using your API key.

Error handling

Implement retry logic for transient failures (5xx errors). For client errors (4xx), validate request payloads against the API schema. Log all transaction IDs for debugging.

Production checklist

  • Replace all Fin staging URLs with production endpoints
  • Use production API keys (never staging keys in production)
  • Implement webhook handlers for payment confirmations
  • Test refund workflows with real transactions
  • Set up monitoring and alerting for failed payments

Need help?

Contact the DigetPay integration team at [email protected] for API keys, production access, or merchant sync issues (401 merchant not found).



Did this page help you?