---
title: "Migrating from Customer Profile API v1 to v2"
slug: "migrating-from-customer-profile-api-v1-to-v2"
tags: ["customer", "customer profile", "consumer", "migration", "v1 to v2"]
updated: 2024-12-30T17:23:13Z
published: 2024-12-30T17:23:13Z
canonical: "docs.newstore.com/migrating-from-customer-profile-api-v1-to-v2"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newstore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from Customer Profile API v1 to v2

To read more about the two versions of the Customer Profile API, see the OpenAPI specifications provided here:

- [v1 documentation](https://docs.newstore.net/api/integration/customer/consumer_profile_api_v1)
- [v2 documentation](https://docs.p.newstore.partners/#/typescript/customers)

## Pre-requisites

Before you start the migration process, ensure that you have:

1. Checked current API calls to `customer_profile v1` from your integration
2. Found the impacted fields as listed in the sections below.

## List of changes

### Authentication

The authentication process for V2 is different then v1. Check the following links to get started with it:

- [Getting started](https://docs.p.newstore.partners/#/http/getting-started/newstore-rest-api/getting-started/authorization)
- [Authorization](https://docs.p.newstore.partners/#/http/getting-started/newstore-rest-api/authorization)

### Request customer profile deletion

To request a customer profile deletion in `v2` you'll use need to use this [POST method](https://docs.p.newstore.partners/#/typescript/customers/customer-profiles/create-profile-deletion-request) instead of this [POST method](https://docs.newstore.net/api/integration/customer/consumer_profile_api_v1/#tag/customerProfile/operation/updateProfile) in `v1`. with the following body:

```json
{
    "operation": "delete"
}
```

### Tokenize and Detokenize endpoints replaced by the Tokens method

Tokenize and detokenize methods have been replaced by the `v2` [tokens method](https://docs.p.newstore.partners/#/typescript/customers/tokens/create-tokens-operations).

#### Tokens method

The endpoint receives `operation` as query parameter. The possible operation values are:

**Tokenize**

Tokenizes PII data that is not related to a profile, tokens are only valid for 30 days. This is the operation you should use to replace the old tokenize endpoint.

**Detokenize**

Detokenizes a list of tokens for profiles, addresses, or data entries. This is the operation you should use to replace the old detokenize endpoint.

Some minor changes to the request body and response. It receives a `data` attribute for both operations and returns `data` and `errors` attributes for both operations.

The request body is:

```json
{
    "data": {
        "key1": "foo",
        "key2": "bar"
    }
}
```

The request response is:

```json
{
    "data": {
        "key1": "john.doe@example.org"
    },
    "errors": {
        "key2": "token_not_found_error"
    }
}
```

**Related topics**

- [Configuring customizations in NewStore Associate App](/v1/docs/configuring-customizations-in-newstore-associate-app#config-aa-customizations)
- [Consumer Profile API v1 documentation](https://docs.newstore.net/api/integration/customer/consumer_profile_api_v1)
- [Consumer Profile API v2 documentation](https://docs.p.newstore.partners/#/typescript/customers)
