Lookup Policy

Find a policy by quote_id or payment_reference. At least one query parameter is required.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Lookup Paths

flowchart LR
    A["GET /policies"] --> B{"Query parameter?"}
    B -->|"?quote_id=uuid"| C["Direct policy table<br/>lookup by quote_id"]
    B -->|"?payment_reference=ref"| D["Transactions table →<br/>Policy table join"]
    B -->|"Neither"| E["400 MISSING_PARAMETER"]
    C --> F{"Found?"}
    D --> F
    F -->|"Yes"| G["200 + policy summary"]
    F -->|"No"| H["200 + policy: null"]

    style A fill:#e3f2fd
    style G fill:#e8f5e9
    style H fill:#fff3e0
    style E fill:#fce4ec

What This Endpoint Does

  1. Searches for Policy: Finds a policy using quote_id or payment_reference
  2. Returns Summary: Provides basic policy info if found
  3. Handles Not Found: Returns null policy if no match (not an error)

When to Use This Endpoint

  • Post-Purchase Lookup: Find policy_id after purchase using payment_reference
  • Quote Conversion Check: Verify if a quote was converted to a policy
  • Reconciliation: Match payments to policies

Query Parameters

ParameterRequiredDescription
quote_idOne requiredUUID of the quote used to create the policy
payment_referenceOne requiredPayment reference used during purchase

Provide exactly one parameter. The quote_id parameter does a direct policy lookup, while payment_reference searches via the transactions table. If both are provided, quote_id takes precedence.

Understanding the Response

policy object (null if not found):

FieldDescription
policy_idUUID for policy operations
quote_idOriginal quote that was purchased
policy_numberHuman-readable reference
statusPolicy status (active, cancelled, completed)
created_atWhen policy was created

Response Behaviour

  • Policy found: Returns policy summary with 200 status
  • Policy not found: Returns "policy": null with 200 status (not an error)
  • Missing parameters: Returns 400 error

Error Handling

ErrorCodeDescription
MISSING_PARAMETER400Neither quote_id nor payment_reference provided
VALIDATION_ERROR400Invalid parameter format

Best Practices

  1. Use for lookup only: For full policy details, use GET /policies/{policyId}
  2. Check for null: Policy being null is a valid response, not an error
  3. Prefer quote_id: More reliable than payment_reference for exact matches
Query Params
uuid

UUID of the quote used to create the policy

string

The payment.transactionId supplied when the quote was purchased. Only payment transactions match (refund references are ignored). If the same reference paid for more than one policy the lookup returns 409 — look up by quote_id instead.

Responses

Language
Credentials
Bearer
API Key
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json