> For the complete documentation index, see [llms.txt](https://partner-docs.covergenius.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner-docs.covergenius.com/offers/guides/payment-process/payment.md).

# Dual Payment using XPay Token

Partners that are at a minimum of **PCI DSS SAQ A compliant** are able to utilize the XPay API to process the insurance transaction. This will make Cover Genius the Merchant of Record (MoR) for the insurance portion of the transaction.

<figure><picture><source srcset="/files/V6TJCPWPMXN4DVqGSqTn" media="(prefers-color-scheme: dark)"><img src="/files/VO22qXNsfAJ7y9ZEP3Pk" alt=""></picture><figcaption></figcaption></figure>

### Overview

In a dual payment integration:

1. Partner collects payment for the main product/service
2. XCover (via XPay) collects payment for the insurance separately
3. Customer experiences two transactions in quick succession
4. Partner remains MoR for product, XCover is MoR for insurance

### Workflow

#### Step 1: Create Offers

Request insurance product offerings using the **Create Offers** endpoint. Display the insurance products and pricing to the customer during the shopping experience.

#### Step 2: Collect Payment Details

After a customer selects the insurance product and proceeds to the checkout stage, the payment information (credit card details) must be collected and transmitted through the **XPay Customer Tokens** endpoint.

**Sending Payment Details:**

```
POST  /xpay/customer_tokens
```

The XPay API uses a long-lived JSON Web Token (JWT) which will be provided to you by the assigned Client Solutions Engineer (CSE).

#### Step 3: Process Main Product Payment

Process the payment for the main product/service through your own payment provider.

#### Step 4: Confirm Offer with XPay Details

Call the **Confirm Offer** endpoint with the XPay payment details:

```json
{
  "quotes": [
    {
      "id": "quote-uuid-from-offer"
    }
  ],
  "policyholder": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe[example.com",](cci:4://file://example.com",:0:0-0:0)
    "phone": "+1234567890",
    "country": "US"
  },
  "payment_details": {
    "provider": "xpay",
    "xpay_customer_id": "customer_token_from_step_2",
    "customer_token_id": "customer_token_from_step_2"
  }
}
```

#### Step 5: XPay Processes Insurance Payment

XPay will automatically process the insurance payment using the provided customer token. The insurance transaction will appear as a separate charge on the customer's payment method.

### Authentication

The XPay API requires authentication using a JWT token:

```
Authorization: Bearer <your_xpay_jwt_token>
```

Your assigned CSE will provide you with the long-lived JWT token for XPay API access.

### Important Notes

> **PCI Compliance:** Partners must be at minimum PCI DSS SAQ A compliant to use XPay token-based payments.

> **Customer Experience:** Inform customers that they will see two separate charges on their payment method - one for the main product and one for insurance.

> **Merchant of Record:** Cover Genius is the merchant of record for the insurance transaction when using XPay.

> **Token Security:** Store XPay JWT tokens securely and never expose them in client-side code.

### Error Handling

If the XPay payment fails during the Confirm Offer request:

* The response will include error details in the `errors` object
* The booking will not be confirmed
* You may need to retry with a different payment method or customer token
* Inform the customer that the insurance payment failed and offer to retry

### Testing

Use the XPay sandbox environment for testing:

* Test JWT tokens will be provided by your CSE
* Use test credit card numbers provided in the XPay documentation
* Sandbox transactions will not result in actual charges


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://partner-docs.covergenius.com/offers/guides/payment-process/payment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
