---
title: "Update purchase information"
method: PATCH
path: "/api/storage/profile-system/profiles/{profileId}/purchase-info"
tags: ["Purchase information"]
---

# Update purchase information

`PATCH /api/storage/profile-system/profiles/{profileId}/purchase-info`

Updates one or more fields of existing purchase information for a given client profile.

Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.

>⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions.
>
> This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/).

## Permissions

Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:

| **Product** | **Category** | **Resource** |
| --------------- | ----------------- | ----------------- |
| Profile System | Documents | **Get Item** |
| Profile System | Documents | **Save and Update Item** |
| Profile System | Documents | **Delete Item** |

There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).

>❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.

## Path parameters

- `profileId` string, required

## Query parameters

- `alternativeKey` 'email' | 'document'

## Headers

- `Content-Type` string, required
- `Accept` string, required

## Request body

- PurchaseInfo — Purchase information object.
  - `paymentData` PaymentData — Payment data.
    - `availableAccounts` object[] — List of available payment accounts.
      - `accountId` string — Payment account ID.
      - `paymentSystem` string — Payment system code.
      - `paymentSystemName` string — Payment system name.
      - `cardNumber` string — Masked card number.
      - `bin` string — Card bin.
      - `availableAddresses` string[] — List of available addresses.
      - `expirationDate` string — Card expiration date, in `MM/YYYY` format.
      - `isExpired` boolean — Defines if the card is expired (`true`) or not (`false`).
      - `accountStatus` string, nullable — Account status.
    - `availableTokens` string[] — Available tokens.
    - `transactions` object[], nullable — List of transactions.
      - `isActive` boolean, required — Indicates whether the transaction is active (`true`) or not (`false`).
      - `transactionId` string, required — Transaction ID.
      - `merchantName` string, required — Merchant name.
      - `payments` Payment[], required — List of payments information.
        - `id` string, required — Payment ID.
        - `paymentSystem` string, required — Payment system.
        - `paymentSystemName` string, required — Payment system name.
        - `value` integer, required — Payment value in cents.
        - `installments` integer, required — Payment installments.
        - `referenceValue` integer, required — Reference value for interest calculation in cents.
        - `cardHolder` string, nullable, required — Card holder.
        - `cardNumber` string, nullable, required — Card number.
        - `firstDigits` string, nullable, required — Card first digits.
        - `lastDigits` string, nullable, required — Card last digits.
        - `cvv2` string, nullable, required — Card verification code.
        - `expireMonth` string, nullable, required — Card expiration month.
        - `expireYear` string, nullable, required — Card expiration year.
        - `url` string, required — Payment URL.
        - `giftCardId` string, nullable, required — Gift card ID.
        - `giftCardName` string, nullable, required — Gift card name.
        - `giftCardCaption` string, nullable, required — Gift card caption.
        - `redemptionCode` string, nullable, required — Redemption code.
        - `group` string, required — Payment group.
        - `tid` string, nullable, required — Payment TID.
        - `dueDate` string, required — Due date.
        - `connectorResponses` object, required — Connector responses.
    - `giftCards` string[] — Gift card IDs.
    - `giftCardMessages` string[] — Gift card messages.
    - `numberOfPaymentErrors` number — Amount of payment errors.
    - `numberOfDeniedTransactions` number — Amount of denied transactions.
    - `lastDeniedTransaction` string, nullable — Last denied transaction.
  - `clientPreferences` object — Client preferences.
  - `isToSavePersonalData` boolean — Defines if personal data will be saved (`true`) or not (`false`).
  - `lastUserPurchases` object[] — Array with latest purchases from the client.
    - `creationDate` string — Purchase date in the ISO 8601 format.
    - `orderId` string — Unique identifier of the order.
    - `orderGroup` string — Unique identifier of the order group.
    - `value` number — Purchase value.
  - `lastPurchasesAddressId` string — Unique identifier of the client address.

## Response `200`

OK

- MaskedPurchaseInfoResponse — Masked purchase information.
  - `id` string — ID of purchase information.
  - `document` PurchaseInfo — Purchase information object.
    - `paymentData` PaymentData — Payment data.
      - `availableAccounts` object[] — List of available payment accounts.
        - `accountId` string — Payment account ID.
        - `paymentSystem` string — Payment system code.
        - `paymentSystemName` string — Payment system name.
        - `cardNumber` string — Masked card number.
        - `bin` string — Card bin.
        - `availableAddresses` string[] — List of available addresses.
        - `expirationDate` string — Card expiration date, in `MM/YYYY` format.
        - `isExpired` boolean — Defines if the card is expired (`true`) or not (`false`).
        - `accountStatus` string, nullable — Account status.
      - `availableTokens` string[] — Available tokens.
      - `transactions` object[], nullable — List of transactions.
        - `isActive` boolean, required — Indicates whether the transaction is active (`true`) or not (`false`).
        - `transactionId` string, required — Transaction ID.
        - `merchantName` string, required — Merchant name.
        - `payments` Payment[], required — List of payments information.
          - `id` string, required — Payment ID.
          - `paymentSystem` string, required — Payment system.
          - `paymentSystemName` string, required — Payment system name.
          - `value` integer, required — Payment value in cents.
          - `installments` integer, required — Payment installments.
          - `referenceValue` integer, required — Reference value for interest calculation in cents.
          - `cardHolder` string, nullable, required — Card holder.
          - `cardNumber` string, nullable, required — Card number.
          - `firstDigits` string, nullable, required — Card first digits.
          - `lastDigits` string, nullable, required — Card last digits.
          - `cvv2` string, nullable, required — Card verification code.
          - `expireMonth` string, nullable, required — Card expiration month.
          - `expireYear` string, nullable, required — Card expiration year.
          - `url` string, required — Payment URL.
          - `giftCardId` string, nullable, required — Gift card ID.
          - `giftCardName` string, nullable, required — Gift card name.
          - `giftCardCaption` string, nullable, required — Gift card caption.
          - `redemptionCode` string, nullable, required — Redemption code.
          - `group` string, required — Payment group.
          - `tid` string, nullable, required — Payment TID.
          - `dueDate` string, required — Due date.
          - `connectorResponses` object, required — Connector responses.
      - `giftCards` string[] — Gift card IDs.
      - `giftCardMessages` string[] — Gift card messages.
      - `numberOfPaymentErrors` number — Amount of payment errors.
      - `numberOfDeniedTransactions` number — Amount of denied transactions.
      - `lastDeniedTransaction` string, nullable — Last denied transaction.
    - `clientPreferences` object — Client preferences.
    - `isToSavePersonalData` boolean — Defines if personal data will be saved (`true`) or not (`false`).
    - `lastUserPurchases` object[] — Array with latest purchases from the client.
      - `creationDate` string — Purchase date in the ISO 8601 format.
      - `orderId` string — Unique identifier of the order.
      - `orderGroup` string — Unique identifier of the order group.
      - `value` number — Purchase value.
    - `lastPurchasesAddressId` string — Unique identifier of the client address.
  - `meta` PurchaseInfoMeta — Purchase information metadata.
    - `version` string, required — Unique identifier of the purchase information version.
    - `author` string, required — Unique identifier of the user who created the purchase information.
    - `creationDate` string, required — Date when the purchase information was created in ISO 8601 format.
    - `lastUpdateDate` string, required — Date when the purchase information was last updated in ISO 8601 format.
    - `expirationDate` string, nullable — Date when the purchase information expires in ISO 8601 format.

---

[API](https://skmtc.net/vtex/apis/profile-system-pii-data-architecture.md) · [All operations](https://skmtc.net/vtex/apis/profile-system-pii-data-architecture/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vtex/profile-system-pii-data-architecture/revisions/23729fa2a727/schema)
