{ "openapi": "3.0.0", "info": { "title": "Profile System", "description": "Create shopper profiles and manage their information.", "contact": {}, "version": "1.0" }, "servers": [ { "url": "https://{accountName}.{environment}.com.br", "description": "VTEX server URL.", "variables": { "accountName": { "description": "Name of the VTEX account. Used as part of the URL.", "default": "apiexamples" }, "environment": { "description": "Environment to use. Used as part of the URL.", "enum": [ "vtexcommercestable" ], "default": "vtexcommercestable" } } } ], "paths": { "/api/storage/profile-system/profiles": { "post": { "tags": [ "Profiles" ], "summary": "Create client profile", "description": "Create a new client profile.\n\r\n\r> You can send custom fields in the request body and they will be saved as part of your document. Therefore, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly.\n\r\n\r> The `id` field returned by this request is the `profileId` used to retrieve information on a specific profile in other requests.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "CreateClientProfile", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/ttl" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Profile" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "$ref": "#/components/schemas/ProfileId" }, "meta": { "$ref": "#/components/schemas/meta" }, "document": { "$ref": "#/components/schemas/Profile" } } }, "example": { "id": "c2cbebba-214e-40b2-b68f-98f862e755d5", "meta": { "version": "27112371-a71b-45d6-b3bc-93436a3a0b4f", "author": "82a2b53d-39be-4f49-bb7c-8971b58cb7dc", "creationDate": "2022-01-05T15:41:37.5009471+00:00", "lastUpdateDate": "2022-01-05T15:41:37.5009471+00:00" }, "document": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "birthDate": "1925-11-17", "document": "12345678911", "documentType": "CPF" } } } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}": { "get": { "tags": [ "Profiles" ], "summary": "Get profile", "description": "Retrieves the information of a specific client, by its `profileId`.\n\r\n\r> Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly.\n\r\n\r> For security and privacy reasons, this request returns masked profile data. For unmasked information, see [Get unmasked profile](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/unmask).\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetProfile", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaskedProfileResponse" }, "example": [ { "id": "70caf394-8534-447e-a0ca-1803c669c771", "meta": { "version": "abc", "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", "creationDate": "13/12/2021T00:00:00Z", "lastUpdate": "13/12/2021T00:00:00Z" }, "document": { "firstName": "J***", "lastName": "D**", "email": "j***.d**@e******.c**", "birthDate": "1925-11-17", "document": "1**********", "documentType": "CPF" } } ] } } } }, "deprecated": false }, "patch": { "tags": [ "Profiles" ], "summary": "Updates client profile", "description": "Updates one or more fields of an existing client profile.\n\r\n\r> Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "UpdateClientProfile", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" }, { "$ref": "#/components/parameters/ttl" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Profile" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnmaskedProfileResponse" } } } } }, "deprecated": false }, "delete": { "tags": [ "Profiles" ], "summary": "Delete client profile", "description": "Deletes a client profile by `profileId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.\n\r\n\r> This endpoint is not suitable for granting a shopper's [right to erasure](https://help.vtex.com/en/tutorial/data-subject-rights--6imchxTx09icupKMbzHVIM#erasure). For that purpose, open a [support](https://help.vtex.com/en/support) ticket, according to the instructions in the section [Request erasure via support](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU#request-erasure-via-support) of the shopper data erasure guide.", "operationId": "DeleteClientProfile", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" } ], "responses": { "204": { "description": "No content" } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/unmask": { "get": { "tags": [ "Profiles" ], "summary": "Get unmasked profile", "description": "Retrieves unmasked information of a specific client, given their `profileId`.\n\r\n\r> Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedProfile", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/reason" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "description": "Array with unmasked profile information.", "items": { "$ref": "#/components/schemas/UnmaskedProfileResponse" } } } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/versions/{profileVersionId}": { "get": { "tags": [ "Profiles" ], "summary": "Get profile by version", "description": "Retrieves the information of a specific version of a client profile.\n\r\n\rVersions of profiles are like a snapshot of data at a given moment, so they are imutable. This means that whenever you retrieve data from a specific version you are ensured to receive the same data. It is only possible to retrieve a version of a profile by having its ID and the ID of the version.\n\r\n\r> Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly.\n\r\n\r> For security and privacy reasons, this request returns masked profile data. For unmasked information, see Get unmasked profile by version.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetProfileByVersion", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/profileVersionId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaskedProfileResponseByVersion" } } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/versions/{profileVersionId}/unmask": { "get": { "tags": [ "Profiles" ], "summary": "Get unmasked profile by version", "description": "Retrieves unmasked information of a specific version of a client profile.\n\r\n\rVersions of profiles are like a snapshot of data at a given moment, so they are imutable. This means that whenever you retrieve data from a specific version you are ensured to receive the same data. It is only possible to retrieve a version of a profile by having its ID and the ID of the version.\n\r\n\r> Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedProfileByVersion", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/profileVersionId" }, { "$ref": "#/components/parameters/reason" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "description": "Array with unmasked profile information.", "items": { "$ref": "#/components/schemas/UnmaskedProfileResponse" } } } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/addresses": { "post": { "tags": [ "Addresses" ], "summary": "Create client address", "description": "Creates new address for a given client profile.\n\r\n\r> The `id` field returned by this request is the `addressId` used to retrieve or update information of a specific address later.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "CreateClientAddress", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/address" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object" }, "example": { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "20200-000", "countryName": "Brasil", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "Locality", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } } } } }, "deprecated": false }, "get": { "tags": [ "Addresses" ], "summary": "Get client addresses", "description": "Retrieves information of all addresses of a given client, by its `profileId`.\n\r\n\r> For security and privacy reasons, this request returns masked address data. For unmasked information, see Get unmasked client addresses.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetClientAddresses", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": {} }, "example": [ { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "2****-0**", "countryName": "B*****", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "L*******", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } ] } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/addresses/unmask": { "get": { "tags": [ "Addresses" ], "summary": "Get unmasked client addresses", "description": "Retrieves unmasked information of all addresses of a given client, by its `profileId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedClientAddresses", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "example": [ { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "20200-000", "countryName": "Brasil", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "Locality", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } ] } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/addresses/{addressId}": { "get": { "tags": [ "Addresses" ], "summary": "Get address", "description": "Retrieves information of a specific address of a given client, by its respectives `adderssId` and `profileId`.\n\r\n\r> For security and privacy reasons, this request returns masked address data. For unmasked information, see Get unmasked address.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetAddress", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/addressId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "2****-0**", "countryName": "B*****", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "L*******", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } } } } }, "deprecated": false }, "patch": { "tags": [ "Addresses" ], "summary": "Update client address", "description": "Updates one or more fields of an existing address for a given client profile.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "UpdateClientAddress", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/addressId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "postalCode": { "$ref": "#/components/schemas/address/properties/postalCode" }, "countryName": { "$ref": "#/components/schemas/address/properties/countryName" }, "countryCode": { "$ref": "#/components/schemas/address/properties/countryCode" }, "administrativeAreaLevel1": { "$ref": "#/components/schemas/address/properties/administrativeAreaLevel1" }, "locality": { "$ref": "#/components/schemas/address/properties/locality" }, "localityAreaLevel1": { "$ref": "#/components/schemas/address/properties/localityAreaLevel1" }, "route": { "$ref": "#/components/schemas/address/properties/countryName" }, "streetNumber": { "$ref": "#/components/schemas/address/properties/countryName" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "20200-000", "countryName": "Brasil", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "Locality", "localityAreaLevel1": "locality area", "route": "34", "streetNumber": "333", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "86dfae79-1d23-43f2-a643-2fc8f1839461", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T21:08:02.9364099+00:00" } } } } } }, "deprecated": false }, "delete": { "tags": [ "Addresses" ], "summary": "Delete address", "description": "Deletes a client's address by `profileId` and `addressId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "DeleteAddress", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/addressId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "204": { "description": "No content" } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/addresses/{addressId}/unmask": { "get": { "tags": [ "Addresses" ], "summary": "Get unmasked address", "description": "Retrieves unmasked information of a specific address of a given client, by its respectives `adderssId` and `profileId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedAddress", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/addressId" }, { "$ref": "#/components/parameters/reason" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "20200-000", "countryName": "Brasil", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "Locality", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/addresses/{addressId}/versions/{addressVersionId}": { "get": { "tags": [ "Addresses" ], "summary": "Get address by version", "description": "Retrieves information of a specific version address of a given client.\n\r\n\r> For security and privacy reasons, this request returns masked address data by version. For unmasked information, see Get unmasked address by version.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetAddressByVersion", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/addressId" }, { "$ref": "#/components/parameters/addressVersionId" }, { "$ref": "#/components/parameters/reason" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "2****-0**", "countryName": "B*****", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "L*******", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/addresses/{addressId}/versions/{addressVersionId}/unmask": { "get": { "tags": [ "Addresses" ], "summary": "Get unmasked address by version", "description": "Retrieves unmasked information of a specific address version of a given client.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedAddressByVersion", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/addressId" }, { "$ref": "#/components/parameters/addressVersionId" }, { "$ref": "#/components/parameters/reason" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "20200-000", "countryName": "Brasil", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "Locality", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } } } } }, "deprecated": false } }, "/api/storage/profile-system/prospects": { "post": { "tags": [ "Prospects" ], "summary": "Create prospect", "description": "Creates new prospect.\n\r\n\r> The `id` field returned by this request is the `prospectId` used to retrieve information on a specific prospect later.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "CreateProspect", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/prospect" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object" }, "example": {} } } } }, "deprecated": false } }, "/api/storage/profile-system/prospects/{prospectId}": { "get": { "tags": [ "Prospects" ], "summary": "Get prospect", "description": "Retrieves the information of a specific prospect, by its `prospectId`.\n\r\n\r> For security and privacy reasons, this request returns masked prospect data. For unmasked information, see Get unmasked prospect.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetProspect", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/prospectId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": {} }, "example": [ {} ] } } } }, "deprecated": false }, "patch": { "tags": [ "Prospects" ], "summary": "Update prospect", "description": "Updates one or more fields of an existing prospect.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "UpdateProspect", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/prospectId" } ], "requestBody": { "content": { "application/json": { "schema": {} } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": {} } } } }, "deprecated": false }, "delete": { "tags": [ "Prospects" ], "summary": "Delete prospect", "description": "Deletes a prospect by `prospectId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "DeleteProspect", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/prospectId" } ], "responses": { "204": { "description": "No content" } }, "deprecated": false } }, "/api/storage/profile-system/prospects/{prospectId}/unmask": { "get": { "tags": [ "Prospects" ], "summary": "Get unmasked prospect", "description": "Retrieves unmasked information of a specific prospect, by its `prospectId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedProspect", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/prospectId" }, { "$ref": "#/components/parameters/reason" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": {} }, "example": [ {} ] } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/purchase-info": { "post": { "tags": [ "Purchase information" ], "summary": "Create purchase information", "description": "Creates purchase information for a given client profile.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "CreatePurchaseInformation", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "requestBody": { "content": { "application/json": { "schema": {} } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object" }, "example": {} } } } }, "deprecated": false }, "get": { "tags": [ "Purchase information" ], "summary": "Get purchase information", "description": "Retrieves purchase information of a given client, by its `profileId`.\n\r\n\r> For security and privacy reasons, this request returns masked data. For unmasked information, see Get unmasked purchase information.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetPurchaseInformation", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": {} }, "example": [ {} ] } } } }, "deprecated": false }, "patch": { "tags": [ "Purchase information" ], "summary": "Update purchase information", "description": "Updates one or more fields of existing purchase information for a given client profile.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "UpdatePurchaseInformation", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "requestBody": { "content": { "application/json": { "schema": {} } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" }, "example": {} } } } }, "deprecated": false }, "delete": { "tags": [ "Purchase information" ], "summary": "Delete purchase information", "description": "Deletes purchase informaiton by `profileId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "DeletePurchaseInformation", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" }, { "$ref": "#/components/parameters/alternativeKey" } ], "responses": { "204": { "description": "No content" } }, "deprecated": false } }, "/api/storage/profile-system/profiles/{profileId}/purchase-info/unmask": { "get": { "tags": [ "Purchase information" ], "summary": "Get unmasked purchase information", "description": "Retrieves unmasked purchase information of a given client, by its `profileId`.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "GetUnmaskedPurchaseInformation", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/profileId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object" } }, "example": [ { "id": "bf82180e-cf9e-4089-9af6-ae1518555992", "document": { "postalCode": "20200-000", "countryName": "Brasil", "countryCode": "BR", "administrativeAreaLevel1": "RJ", "locality": "Locality", "localityAreaLevel1": "locality area", "route": "51", "streetNumber": "999", "profileId": "70caf394-8534-447e-a0ca-1803c669c771" }, "meta": { "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", "creationDate": "2022-01-18T18:51:34.1293829+00:00", "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" } } ] } } } }, "deprecated": false } }, "/api/storage/profile-system/profiles/schema": { "put": { "tags": [ "Schemas" ], "summary": "Create or update profile schema", "description": "Creates or updates profile schema.\n\r\n\r> Each account has one profile schema. Updating it with this request will substitute the previous version.\n\r\n\r> Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints.", "operationId": "CreateOrUpdateProfileSchema", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schema" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object" }, "example": {} } } } }, "deprecated": false } } }, "components": { "schemas": { "Profile": { "title": "Profile", "type": "object", "required": [ "firstName", "lastName", "email", "document", "documentType" ], "properties": { "firstName": { "type": "string", "description": "Client's first name.", "example": "John" }, "lastName": { "type": "string", "description": "Client's last name.", "example": "Doe" }, "email": { "type": "string", "description": "Client's email address.", "example": "john.doe@example.com" }, "birthDate": { "type": "string", "description": "Client's birth date in ISO 8601 format.", "example": "1925-11-17" }, "document": { "type": "string", "description": "Client's document.", "example": "12345678900" }, "documentType": { "type": "string", "description": "Type of document informed in `document`.", "example": "CPF" } } }, "meta": { "title": "Metadata", "type": "object", "required": [ "version", "author", "creationDate", "lastUpdateDate" ], "properties": { "version": { "type": "string", "description": "Unique identifier of the profile version.", "example": "27112371-a71b-45d6-b3bc-93436a3a0b4f" }, "author": { "type": "string", "description": "Unique identifier of the user who created the profile.", "example": "82a2b53d-39be-4f49-bb7c-8971b58cb7dc" }, "creationDate": { "type": "string", "description": "Date when the profile was created in ISO 8601 format.", "example": "2022-01-05T15:41:37.5009471+00:00" }, "lastUpdateDate": { "type": "string", "description": "Date when the profile was last updated in ISO 8601 format.", "example": "2022-01-05T15:41:37.5009471+00:00" } } }, "ProfileId": { "title": "id", "type": "string", "description": "ID of the client's profile.", "example": "c2cbebba-214e-40b2-b68f-98f862e755d5" }, "MaskedProfileResponse": { "title": "Masked profile response", "type": "array", "description": "Array containing masked profile information.", "items": { "type": "object", "properties": { "id": { "$ref": "#/components/schemas/ProfileId" }, "meta": { "$ref": "#/components/schemas/meta" }, "document": { "$ref": "#/components/schemas/Profile" } } }, "example": [ { "id": "70caf394-8534-447e-a0ca-1803c669c771", "meta": { "version": "abc", "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", "creationDate": "13/12/2021T00:00:00Z", "lastUpdate": "13/12/2021T00:00:00Z" }, "document": { "firstName": "J***", "lastName": "D**", "email": "j***.d**@e******.c**", "birthDate": "1925-11-17", "document": "1**********", "documentType": "CPF" } } ] }, "MaskedProfileResponseByVersion": { "title": "Masked profile response", "type": "array", "description": "Array containing masked profile information.", "items": { "type": "object", "properties": { "id": { "$ref": "#/components/schemas/ProfileId" }, "document": { "$ref": "#/components/schemas/Profile" }, "meta": { "$ref": "#/components/schemas/meta" } } }, "example": [ { "id": "70caf394-8534-447e-a0ca-1803c669c771", "document": { "firstName": "J***", "lastName": "G****", "email": "j***********", "birthDate": "1925-11-17", "document": "1********", "documentType": "CPF" }, "meta": { "version": "bb996089-b77c-4bf3-be35-b99b6d91f91c", "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", "creationDate": "2022-01-05T15:41:37.5009471+00:00", "lastUpdate": "2022-01-15T15:41:37.5009471+00:00" } } ] }, "UnmaskedProfileResponse": { "title": "Unmasked profile response", "type": "object", "properties": { "id": { "$ref": "#/components/schemas/ProfileId" }, "document": { "$ref": "#/components/schemas/Profile" }, "meta": { "$ref": "#/components/schemas/meta" } }, "example": { "id": "70caf394-8534-447e-a0ca-1803c669c771", "document": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "birthDate": "1925-11-17", "document": "12345678911", "documentType": "CPF" }, "meta": { "version": "abc", "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", "creationDate": "2022-01-05T15:41:37.5009471+00:00", "lastUpdate": "2022-01-17T15:41:37.5009471+00:00" } } }, "address": { "title": "Address", "type": "object", "required": [ "postalCode", "countryName", "administrativeAreaLevel1", "locality", "localityAreaLevel1", "route", "streetNumber" ], "properties": { "postalCode": { "type": "string", "description": "Address postal code.", "example": "20200-000" }, "countryName": { "type": "string", "description": "Name of the address country.", "example": "Brasil" }, "countryCode": { "type": "string", "description": "Two letter country code.", "example": "BR" }, "administrativeAreaLevel1": { "type": "string", "description": "Name of administrative area, such as the state or province.", "example": "RJ" }, "locality": { "type": "string", "description": "Name of address locality, such as the city.", "example": "Locality" }, "localityAreaLevel1": { "type": "string", "description": "Name of the address locality area, such as the neighborhood or district.", "example": "Locality area" }, "route": { "type": "string", "description": "Address route or street name.", "example": "51" }, "streetNumber": { "type": "string", "description": "Address street number.", "example": "999" } } }, "prospect": {}, "schema": { "title": "Schema", "type": "object", "required": [ "title", "type", "description", "required", "properties" ], "properties": { "title": { "type": "string", "description": "Schema title.", "example": "Client profile schema" }, "type": { "type": "string", "description": "Schema type.", "example": "object" }, "description": { "type": "string", "description": "Schema's human readable description.", "example": "This schema describes a b2c customer profile." }, "required": { "type": "array", "description": "Schema required fields.", "items": { "type": "string", "description": "Key of a field that is rqeuired in the schema." }, "example": [ "firstName", "lastName", "email", "document", "documentType" ] }, "properties": { "type": "object", "description": "Object describing each field in your desired schema. In this object, each property is a new object, describing the field according to: `type` (string); `sensitive` (boolean); `pii` (boolean) and; `items.type` (if field is array).", "properties": { "{fieldName}": { "type": "object", "description": "Schema of any given field described in the `properties` field.", "required": [ "type", "sensitive", "pii" ], "properties": { "type": { "type": "string", "description": "Schema property type.", "example": "string" }, "sensitive": { "type": "boolean", "description": "Indicates whether property is sensitive data.", "example": true }, "pii": { "type": "boolean", "description": "Indicates whether property is Personal Identifiable Information.", "example": true }, "items": { "type": "object", "description": "Object containing the type of the items if the field is an array. Typically, arrays will contain strings and will be used for fields such as `email`.", "example": { "type": "string" } } } } } }, "documentTTL": { "type": "integer", "description": "Document time to live, in days. After this many days from its creation or update, any document cerated from this schema will be deleted.", "example": 1825 }, "version": { "type": "integer", "description": "Schema version.", "example": 1 }, "v-indexed": { "type": "array", "description": "", "example": [ "email", "document" ] }, "v-unique": { "type": "array", "description": "", "example": [ "email", "document" ] } } } }, "parameters": { "Content-Type": { "name": "Content-Type", "in": "header", "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "example": "application/json" } }, "Accept": { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "example": "application/json" } }, "profileId": { "name": "profileId", "in": "path", "description": "ID of the client's profile as returned by the Create profile endpoint's response, in the `id` field. It can also be an `alternativeKey` according to your custom profile schema. In this case, this request should also send the `alternativeKey` parameter.", "required": true, "style": "simple", "schema": { "type": "string", "example": "70caf394-8534-447e-a0ca-1803c669c771" } }, "addressId": { "name": "addressId", "in": "path", "description": "ID of a client's specific address as returned in the Create client address endpoint's response, in the `id` field.", "required": true, "style": "simple", "schema": { "type": "string", "example": "bf82180e-cf9e-4089-9af6-ae1518555992" } }, "prospectId": { "name": "prospectId", "in": "path", "description": "ID of the prospect as returned by the Create prospect endpoint's response, in the `id` field.", "required": true, "style": "simple", "schema": { "type": "string", "example": "51clk394-8534-447e-a0ca-1803p669c987" } }, "profileVersionId": { "name": "profileVersionId", "in": "path", "description": "ID of the version of the client's profile as returned by endpoints that create or update profile information in the `version` field.", "required": true, "style": "simple", "schema": { "type": "string", "example": "70caf394-8534-447e-a0ca-1803c669c771" } }, "addressVersionId": { "name": "addressVersionId", "in": "path", "description": "ID of the version of a given client's address as returned by endpoints that create or update address information in the `version` field.", "required": true, "style": "simple", "schema": { "type": "string", "example": "86dfae79-1d23-43f2-a643-2fc8f1839461" } }, "alternativeKey": { "name": "alternativeKey", "in": "query", "description": "The `profileId` path parameter may be substituted by other profile fields in this request. When making this request, send the `alternativeKey` parameter with a value equal to the key of the field you wish to use as `profileId`.\n\r\n\r> Currently, there are two possible values for this parameter: `email` and `document`.", "required": false, "style": "form", "schema": { "type": "string", "example": "email" } }, "ttl": { "name": "ttl", "in": "query", "description": "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.\n\r\n\r> 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.", "required": false, "style": "form", "schema": { "type": "integer", "example": 365 } }, "reason": { "name": "reason", "in": "query", "description": "Reason for requesting unmasked data.", "required": true, "style": "form", "schema": { "type": "string", "example": "data-validation" } }, "onBehalfOf": { "name": "onBehalfOf", "in": "query", "description": "Identification of the unmasked information requester.", "required": false, "style": "form", "schema": { "type": "string", "example": "johndoe@store.com" } } }, "securitySchemes": { "appKey": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppKey", "description": "Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)." }, "appToken": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppToken", "description": "Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)." }, "VtexIdclientAutCookie": { "type": "apiKey", "in": "header", "name": "VtexIdclientAutCookie", "description": "[User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours." } } }, "tags": [ { "name": "Profiles" }, { "name": "Addresses" }, { "name": "Prospects" }, { "name": "Purchase information" }, { "name": "Schemas" } ], "security": [ { "appKey": [], "appToken": [] }, { "VtexIdclientAutCookie": [] } ] }