> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/integration-guides/upgrade-to-codapay-api-v2-and-unlock-saved-card-support.md).

# Upgrade to Codapay API v2 and Unlock Saved Card Support

Codapay API v2 makes your integration simpler and more powerful — and it’s the only version that supports **saved card functionality** for returning users.

Here’s how to **upgrade to v2 + enable saved cards** in just a few easy steps.

### Why Upgrade?

* **One Global API Key** per merchant — no more country-title key management
* **Project ID** support for easier transaction tracking across games or services
* **Card Saving Support** for faster checkout and higher conversion
* Fully compatible with your existing v1 setup

📘 [See API v2 Overview](/codapay/integration-guides/codapay-api-versions.md) | 💳 [See Saved Card Integration Guide](/codapay/hosted-payment-page-integration/saving-card-details.md)

### Migration + Enablement Steps

#### 1. **Request v2 Access**

Contact your Codapay integration support or account manager to:

* Get your **v2.0 API key** and **project ID**
* Ask to **enable saved card functionality** (optional, but recommended)

#### 2. **Update Your Integration**

* Change the base endpoint from `/v1.0/Payment` to `/v2.0/Payment`
* Add `projectId` in the `initRequest` payload\
  Example:

  ```json
  "projectId": "YOUR_PROJECT_ID"
  ```
* Keep everything else the same: `country`, `payType`, `items`, `profile`, etc.

#### 3. **Enable Saved Cards**

If you opted to enable saved card functionality:

* Pass these extra fields in your request:

  ```json
  "enableSavePaymentMethod": true,
  "displaySavedPaymentMethodList": true,
  "userInitiated": true
  ```
* Include a unique `partnerShopperId` in the `shopper` object to link cards to users.

📘 [Full Field List + Shopper Mapping](/codapay/hosted-payment-page-integration/saving-card-details.md#integration-overview)

#### 4. **Test in Sandbox**

Use your v2 key and projectId in the sandbox URL:

```url
https://sandbox.codapayments.com/airtime/api/restful/v2.0/Payment
```

Try:

* A first-time card payment with saving enabled
* A returning user selecting a saved card

[📘 View Request + Response Examples](/codapay/hosted-payment-page-integration/saving-card-details.md#scenarios-and-examples)

#### 5. **Go Live**

Once confirmed, update your production integration using the v2.0 key and projectId:

```url
https://airtime.codapayments.com/airtime/api/restful/v2.0/Payment
```

You're now live on v2 — with saved cards enabled 🎉


---

# 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://docs.coda.co/codapay/integration-guides/upgrade-to-codapay-api-v2-and-unlock-saved-card-support.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.
