@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Profile System - PII data architecture
@base https://apiexamples.vtexcommercestable.com.br
@version 1.0
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@common_fields {Content-Type: str # Type of the content being sent., Accept: str # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.}
@endpoints 31
@hint download_for_search
@toc api(31)

@endpoint POST /api/storage/profile-system/profiles
@desc Create client profile
@required {firstName: str # Client's first name., lastName: str # Client's last name., email: str # Client's email address., document: str # Client's document., documentType: str # Type of document informed in `document`.}
@optional {ttl: int # This parameter sets the the Time To Live (TTL), in days, of the specific document being created or updated with this request. After this period of time from the moment of the request, the document is deleted. By sending this parameter you override the TTL set for the schema.  > Currently, the available default document schemas have no TTL. This means that documents are stored indefinitely, unless a TTL is sent when creating or updating., birthDate: str # Client's birth date in ISO 8601 format., {customField}: str # Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object.}
@returns(201) {id: str, meta: map{version: str, author: str, creationDate: str, lastUpdate: str}, document: map{firstName: str, lastName: str, email: str, birthDate: str, document: str, documentType: str, {customField}: str}} # Created

@endpoint GET /api/storage/profile-system/profiles/{profileId}
@desc Get profile
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) OK

@endpoint PATCH /api/storage/profile-system/profiles/{profileId}
@desc Update client profile
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., firstName: str # Client's first name., lastName: str # Client's last name., email: str # Client's email address., document: str # Client's document., documentType: str # Type of document informed in `document`.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`., ttl: int # This parameter sets the the Time To Live (TTL), in days, of the specific document being created or updated with this request. After this period of time from the moment of the request, the document is deleted. By sending this parameter you override the TTL set for the schema.  > Currently, the available default document schemas have no TTL. This means that documents are stored indefinitely, unless a TTL is sent when creating or updating., birthDate: str # Client's birth date in ISO 8601 format., {customField}: str # Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object.}
@returns(200) {id: str, document: map{firstName: str, lastName: str, email: str, birthDate: str, document: str, documentType: str, {customField}: str}, meta: map{version: str, author: str, creationDate: str, lastUpdate: str}} # OK

@endpoint DELETE /api/storage/profile-system/profiles/{profileId}
@desc Delete client profile
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@returns(204) No content

@endpoint GET /api/storage/profile-system/profiles/{profileId}/unmask
@desc Get unmasked profile
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., reason: str # Reason for requesting unmasked data.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) OK

@endpoint GET /api/storage/profile-system/profiles/{profileId}/versions/{profileVersionId}
@desc Get profile by version
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., profileVersionId: str # ID of the version of the client's profile as returned by endpoints that create or update profile information in the `version` field.}
@returns(200) OK

@endpoint GET /api/storage/profile-system/profiles/{profileId}/versions/{profileVersionId}/unmask
@desc Get unmasked profile by version
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., profileVersionId: str # ID of the version of the client's profile as returned by endpoints that create or update profile information in the `version` field., reason: str # Reason for requesting unmasked data.}
@returns(200) OK

@endpoint POST /api/storage/profile-system/profiles/{profileId}/addresses
@desc Create client address
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., postalCode: str # Address postal code., countryName: str # Name of the address country., administrativeAreaLevel1: str # Name of administrative area, such as the state or province., locality: str # Name of address locality, such as the city., localityAreaLevel1: str # Name of the address locality area, such as the neighborhood or district., route: str # Address route or street name., streetNumber: str # Address street number.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`., countryCode: str # Two letter country code., contactId: str # Contact unique identifier.}
@returns(201) {id: str, document: map{postalCode: str, countryName: str, countryCode: str, administrativeAreaLevel1: str, locality: str, localityAreaLevel1: str, route: str, streetNumber: str, profileId: str, contactId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str}} # Created

@endpoint GET /api/storage/profile-system/profiles/{profileId}/addresses
@desc Get client addresses
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) OK

@endpoint GET /api/storage/profile-system/profiles/{profileId}/addresses/unmask
@desc Get unmasked client addresses
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) OK

@endpoint GET /api/storage/profile-system/profiles/{profileId}/addresses/{addressId}
@desc Get address
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., addressId: str # ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) {id: str, document: map{postalCode: str, countryName: str, countryCode: str, administrativeAreaLevel1: str, locality: str, localityAreaLevel1: str, route: str, streetNumber: str, profileId: str, contactId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str}} # OK

@endpoint PATCH /api/storage/profile-system/profiles/{profileId}/addresses/{addressId}
@desc Update client address
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., addressId: str # ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field., postalCode: str # Address postal code., countryName: str # Name of the address country., administrativeAreaLevel1: str # Name of administrative area, such as the state or province., locality: str # Name of address locality, such as the city., localityAreaLevel1: str # Name of the address locality area, such as the neighborhood or district., route: str # Address route or street name., streetNumber: str # Address street number.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`., countryCode: str # Two letter country code., contactId: str # Contact unique identifier.}
@returns(200) {id: str, document: map{postalCode: str, countryName: str, countryCode: str, administrativeAreaLevel1: str, locality: str, localityAreaLevel1: str, route: str, streetNumber: str, profileId: str, contactId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str}} # OK

@endpoint DELETE /api/storage/profile-system/profiles/{profileId}/addresses/{addressId}
@desc Delete address
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., addressId: str # ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(204) No content

@endpoint GET /api/storage/profile-system/profiles/{profileId}/addresses/{addressId}/unmask
@desc Get unmasked address
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., addressId: str # ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field., reason: str # Reason for requesting unmasked data.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) {id: str, document: map{postalCode: str, countryName: str, countryCode: str, administrativeAreaLevel1: str, locality: str, localityAreaLevel1: str, route: str, streetNumber: str, profileId: str, contactId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str}} # OK

@endpoint GET /api/storage/profile-system/profiles/{profileId}/addresses/{addressId}/versions/{addressVersionId}
@desc Get address by version
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., addressId: str # ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field., addressVersionId: str # ID of the version of a given client's address as returned by endpoints that create or update address information in the `version` field., reason: str # Reason for requesting unmasked data.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) {id: str, document: map{postalCode: str, countryName: str, countryCode: str, administrativeAreaLevel1: str, locality: str, localityAreaLevel1: str, route: str, streetNumber: str, profileId: str, contactId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str}} # OK

@endpoint GET /api/storage/profile-system/profiles/{profileId}/addresses/{addressId}/versions/{addressVersionId}/unmask
@desc Get unmasked address by version
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., addressId: str # ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field., addressVersionId: str # ID of the version of a given client's address as returned by endpoints that create or update address information in the `version` field., reason: str # Reason for requesting unmasked data.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) {id: str, document: map{postalCode: str, countryName: str, countryCode: str, administrativeAreaLevel1: str, locality: str, localityAreaLevel1: str, route: str, streetNumber: str, profileId: str, contactId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str}} # OK

@endpoint POST /api/storage/profile-system/prospects
@desc Create prospect
@optional {availableAddresses: [map{disposable: bool, userId: str, addressName: str, addressType: str, postalCode: str, city: str, country: str, street: str, number: str, complement: str, geoCoordinate: [str]}] # Available addresses., paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map], giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str} # Payment data., contacts: [map{contactId: str, email: str, firstName: str, lastName: str, phone: str, document: str}] # List of contacts., invoiceSubject: map{invoiceSubjectId: str, email: str, firstName: str, lastName: str, phone: str} # Information about the invoice subject., email: str # Prospect's email address., firstName: str # Prospect's first name., lastName: str # Prospect's last name., document: str # Prospect's document., cellPhone: str # Prospect's cellphone number., isPJ: bool # Defines if a prospect is corporate (`true`) or not (`false`)., customerCode: str # Prospect's customer code.}
@returns(201) {id: str, document: map{availableAddresses: [map], paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map]?, giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str?}, contacts: [map], invoiceSubject: map{invoiceSubjectId: str, email: str, firstName: str, lastName: str, phone: str}, email: str, firstName: str, lastName: str, document: str, cellPhone: str, isPJ: bool, customerCode: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str, expirationDate: str?}} # Created

@endpoint GET /api/storage/profile-system/prospects
@desc Get prospects
@returns(200) OK

@endpoint GET /api/storage/profile-system/prospects/unmask
@desc Get unmasked prospects
@returns(200) OK

@endpoint GET /api/storage/profile-system/prospects/{prospectId}
@desc Get prospect
@required {prospectId: str # ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field.}
@returns(200) {id: str, document: map{availableAddresses: [map], paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map]?, giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str?}, contacts: [map], invoiceSubject: map{invoiceSubjectId: str, email: str, firstName: str, lastName: str, phone: str}, email: str, firstName: str, lastName: str, document: str, cellPhone: str, isPJ: bool, customerCode: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str, expirationDate: str?}} # OK

@endpoint PATCH /api/storage/profile-system/prospects/{prospectId}
@desc Update prospect
@required {prospectId: str # ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field.}
@optional {availableAddresses: [map{disposable: bool, userId: str, addressName: str, addressType: str, postalCode: str, city: str, country: str, street: str, number: str, complement: str, geoCoordinate: [str]}] # Available addresses., paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map], giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str} # Payment data., contacts: [map{contactId: str, email: str, firstName: str, lastName: str, phone: str, document: str}] # List of contacts., invoiceSubject: map{invoiceSubjectId: str, email: str, firstName: str, lastName: str, phone: str} # Information about the invoice subject., email: str # Prospect's email address., firstName: str # Prospect's first name., lastName: str # Prospect's last name., document: str # Prospect's document., cellPhone: str # Prospect's cellphone number., isPJ: bool # Defines if a prospect is corporate (`true`) or not (`false`)., customerCode: str # Prospect's customer code.}
@returns(200) {id: str, document: map{availableAddresses: [map], paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map]?, giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str?}, contacts: [map], invoiceSubject: map{invoiceSubjectId: str, email: str, firstName: str, lastName: str, phone: str}, email: str, firstName: str, lastName: str, document: str, cellPhone: str, isPJ: bool, customerCode: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str, expirationDate: str?}} # OK

@endpoint DELETE /api/storage/profile-system/prospects/{prospectId}
@desc Delete prospect
@required {prospectId: str # ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field.}
@returns(204) No content

@endpoint GET /api/storage/profile-system/prospects/{prospectId}/unmask
@desc Get unmasked prospect
@required {prospectId: str # ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field., reason: str # Reason for requesting unmasked data.}
@returns(200) {id: str, document: map{availableAddresses: [map], paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map]?, giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str?}, contacts: [map], invoiceSubject: map{invoiceSubjectId: str, email: str, firstName: str, lastName: str, phone: str}, email: str, firstName: str, lastName: str, document: str, cellPhone: str, isPJ: bool, customerCode: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str, expirationDate: str?}} # OK

@endpoint POST /api/storage/profile-system/profiles/{profileId}/purchase-info
@desc Create purchase information
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`., paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map], giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str} # Payment data., clientPreferences: map{} # Client preferences., isToSavePersonalData: bool # Defines if personal data will be saved (`true`) or not (`false`)., lastUserPurchases: [map{creationDate: str, orderId: str, orderGroup: str, value: num}] # Array with latest purchases from the client., lastPurchasesAddressId: str # Unique identifier of the client address.}
@returns(200) {id: str, document: map{paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map]?, giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str?}, clientPreferences: map, isToSavePersonalData: bool, lastUserPurchases: [map], lastPurchasesAddressId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str, expirationDate: str?}} # OK
@example_request {"paymentData":{"availableAccounts":[{"accountId":"D09F5E3F01054C959CFC4CB357961ADE","paymentSystem":"2","paymentSystemName":"Visa","cardNumber":"************1111","bin":"44443334","availableAddresses":["db267dcc53c14fb2b9a985532dd287bc"],"expirationDate":"01/2032","isExpired":false,"accountStatus":null}],"availableTokens":[],"transactions":null,"giftCards":[],"giftCardMessages":[],"numberOfPaymentErrors":0,"numberOfDeniedTransactions":0,"lastDeniedTransaction":null},"clientPreferences":{"userId":"d9b946b8-9524-4b2d-96ec-b35d0625c0a7","localeDefault":"pt-BR","isNewsletterOptIn":true},"isToSavePersonalData":true,"lastUserPurchases":[{"creationDate":"2023-10-23T19:22:12.8989883Z","orderId":"1370990595750-01","orderGroup":"1370990595750","value":3498}],"lastPurchasesAddressId":"db267dcc53c14fb2b9a985532dd287bc"}

@endpoint GET /api/storage/profile-system/profiles/{profileId}/purchase-info
@desc Get purchase information
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(200) OK

@endpoint PATCH /api/storage/profile-system/profiles/{profileId}/purchase-info
@desc Update purchase information
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`., paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map], giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str} # Payment data., clientPreferences: map{} # Client preferences., isToSavePersonalData: bool # Defines if personal data will be saved (`true`) or not (`false`)., lastUserPurchases: [map{creationDate: str, orderId: str, orderGroup: str, value: num}] # Array with latest purchases from the client., lastPurchasesAddressId: str # Unique identifier of the client address.}
@returns(200) {id: str, document: map{paymentData: map{availableAccounts: [map], availableTokens: [str], transactions: [map]?, giftCards: [str], giftCardMessages: [str], numberOfPaymentErrors: num, numberOfDeniedTransactions: num, lastDeniedTransaction: str?}, clientPreferences: map, isToSavePersonalData: bool, lastUserPurchases: [map], lastPurchasesAddressId: str}, meta: map{version: str, author: str, creationDate: str, lastUpdateDate: str, expirationDate: str?}} # OK
@example_request {"paymentData":{"availableAccounts":[{"accountId":"D09F5E3F01054C959CFC4CB357961ADE","paymentSystem":"2","paymentSystemName":"Visa","cardNumber":"************1111","bin":"44443334","availableAddresses":["db267dcc53c14fb2b9a985532dd287bc"],"expirationDate":"01/2032","isExpired":false,"accountStatus":null}],"availableTokens":[],"transactions":null,"giftCards":[],"giftCardMessages":[],"numberOfPaymentErrors":0,"numberOfDeniedTransactions":0,"lastDeniedTransaction":null},"clientPreferences":{"userId":"d9b946b8-9524-4b2d-96ec-b35d0625c0a7","localeDefault":"pt-BR","isNewsletterOptIn":true},"isToSavePersonalData":true,"lastUserPurchases":[{"creationDate":"2023-10-23T19:22:12.8989883Z","orderId":"1370990595750-01","orderGroup":"1370990595750","value":3498}],"lastPurchasesAddressId":"db267dcc53c14fb2b9a985532dd287bc"}

@endpoint DELETE /api/storage/profile-system/profiles/{profileId}/purchase-info
@desc Delete purchase information
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used.}
@optional {alternativeKey: str(email/document) # When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`.}
@returns(204) No content

@endpoint GET /api/storage/profile-system/profiles/{profileId}/purchase-info/unmask
@desc Get unmasked purchase information
@required {profileId: str # There are two value options for this field:   1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint.  2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used., reason: str # Reason for requesting unmasked data.}
@returns(200) OK

@endpoint GET /api/storage/profile-system/schemas/profileSystem
@desc Get full schema
@returns(200) {title: str, type: str, description: str, required: [str], properties: map{additionalProperties: map{type: str, sensitive: bool, pii: bool, items: map{type: str}}}, documentTTL: int, version: int, v-indexed: [str], v-unique: [str]} # OK

@endpoint PUT /api/storage/profile-system/schemas/profileSystem/custom
@desc Create or delete custom fields
@returns(201) Created
@example_request {"customField1":{"type":["string","null"],"sensitive":true,"pii":true},"customField2":{"type":["string","null"],"sensitive":false,"pii":false}}

@endpoint GET /api/storage/profile-system/schemas/profileSystem/custom
@desc Get custom fields
@returns(200) {title: str, type: str, description: str, required: [str], properties: map{additionalProperties: map{type: str, sensitive: bool, pii: bool, items: map{type: str}}}, documentTTL: int, version: int, v-indexed: [str], v-unique: [str]} # OK

@end
