Order Guard API Documentation

Welcome to the Order Guard API documentation. Our API allows you to seamlessly integrate delivery protection into your system, providing your customers with peace of mind when placing orders.

This documentation covers everything you need to get started, including authentication, available endpoints, request and response formats, and example use cases.

Quick Start Guide

The following diagram outlines the standard integration lifecycle from the initial cart load to an active policy.

graph TD Start([Cart - On Load/Edit]) --> Estimate(Get Estimate API) Estimate -.->|Repeat Request on cart changes| Start Estimate --> Action{User Action?} Action -->|Removes Coverage| DeclinedAPI(Decline Coverage API) DeclinedAPI --> EndDeclined([Coverage Declined - End]) Action -->|Continues to Checkout| Initiate(Initiate Policy API) subgraph Parallel [Parallel Processing] direction LR Payment(Process Payment) Vault(PCI Vault) end Initiate --> Payment Initiate --> Vault Payment --> Issued(Policy Issued to Customer) Vault --> Issued Issued --> EndActive([Process Complete - Policy Active]) style Start fill:#D1E1F7,stroke:#3B82F6 style Action fill:#D1F7F1,stroke:#10B981 style EndActive fill:#FFF3D1,stroke:#F59E0B

Your Integration Journey

Follow these logical stages to move from initial authentication to a live production environment.

1. Authentication

Secure your API Credentials from your account representative to authorize requests.

2. Interface Setup (UI)

Implement the Order Guard opt-in toggle within your checkout flow to capture customer intent.

3. Coverage Calculation

Use the Get Estimate API to calculate the protection fee.

4. Policy Activation

Call the Initiate Policy API once the order is finalized to activate coverage.

Available Routes

Authentication

Requests made to our API must include an API key to be considered authorized. You'll include your API key in the request headers like this:

x-api-key: YOUR_API_KEY

Please ask your account representative for your API Key, or you can log in and request access in the partner dashboard.

Secret Key - For Vault Integrations

If you integrate using our Tokenization Vault method, you will be provided an additional secret key that you'll include in the headers for your Initiate Policy requests.

x-pcivault-capture-secret: YOUR_VAULT_SECRET

Metrics & Analytics

The Metrics APIs allow partners to pull data directly into internal dashboards to monitor integration performance and business outcomes.

  • Conversion Rates: Percentage of shoppers opting for protection.
  • Revenue Data: Track total fees collected and net settlements.
  • Volume Analysis: Monitor active policies over specific periods.

Full technical details are available on the Get Metrics page.

Payment Collection Methods

You can integrate with Order Guard's API and allow your customers to purchase delivery protection in one of three ways. All 3 methods are PCI-compliant.

Tokenization Vault (Recommended)

sequenceDiagram participant C as Customer participant P as Partner Backend participant V as PCI Vault (Intermediary) participant OG as Order Guard C->>P: Submit Payment Data Note over P: Charge customer for main service P->>V: POST PAN details & protection amount V-->>OG: Send callback with Token Note over OG: Charge customer fee via Token OG-->>P: Policy Initiated

Send shopper's credit card details, and amount they are to be charged, to our intermediary - PCI Vault. We'll then receive a token that we can use to charge the customer.

Steps
  1. Collect the shopper's payment data via your existing form, and charge them for your service.
  2. POST the amount we should charge them for order protection, and their PAN details (e.g. card_holder, card_number, card_expiry), to our PCI intermediary's "capture" endpoint:
    https://api.pcivault.io/v1/capture/YOUR_ENDPOINT_ID
  3. Order Guard receives a callback from the intermediary that contains a token. We use this to charge the customer our fee by passing the token to our payment provider, via the intermediary.

Details about the request and response format for this endpoint can be explored on the Initiate Policy page.

Stripe Connect

Collect payment via Stripe integration, and pass these details to Order Guard via Stripe Connect so we can charge the shopper our fee

Steps
  1. Connect with us on Stripe
    • You'll need a Stripe account to use this method.
    • Connect your Stripe account to Order Guard's, via Stripe Connect. This is a one-time setup step.
  2. Collect Payment
    • Use Stripe Elements (e.g., CardElement) in checkout flow.
    • Customer enters their card once.
  3. Stripe creates a card token (PaymentMethod)
    • Token is created on the platform account (Order Guard's Stripe platform account).
    • This token can then be attached to:
      • Your Stripe account, to charge for the order.
      • Order Guard's Stripe account, to charge for the protection fee.
  4. Two separate charges are made:
    • Partner charges the main order via their Stripe account.
    • Order Guard charges the protection fee as its own merchant of record, using the same tokenized payment method.

Partner Revenue Settlement

You charge the shopper for your product as well as our fee and we settle up later. This process gives you the most total control over the customer relationship.

Steps
  1. Collect full payment, including the Order Guard fee, upfront.
  2. We then streamline your accounting by sending a periodic statement that automatically deducts your revenue share from the total fees collected, displaying balance due/owed.
  3. This can be reconciled using the Get Billable Amount route

Demo Site

To see Order Guard in action, you can view our demo restaurant site that showcases the integration:

Demo URL: demo.orderguard.com

What you'll see:

  • Delivery Menu: Browse a sample restaurant menu with Order Guard coverage options
  • Checkout Process: Experience how Order Guard integrates seamlessly into the checkout flow
  • Coverage Options: See how customers can opt-in to Order Guard protection for their orders
  • Thank You Page: View confirmation of coverage activation after order completion