Purchase information

Create purchase information

Creates purchase information for a given client profile.

Learn more about the Profile System and its other API endpoints.

⚠️ The Profile System is only compatible with stores using the PII data architecture from Data Protection Plus, which is in closed beta phase, only available in select regions.

This feature is part of VTEX Shield. If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact Commercial Support. Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our contact form.

Permissions

Any user or API key must have at least one of the appropriate License Manager resources 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:

ProductCategoryResource
Profile SystemDocumentsGet Item
Profile SystemDocumentsSave and Update Item
Profile SystemDocumentsDelete Item

There are no applicable predefined roles for this resource list. You must create a custom 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.

❗ To prevent integrations from having excessive permissions, consider the best practices for managing API keys when assigning License Manager roles to integrations.

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

Path parameters

profileIdstring required
Example:70caf394-8534-447e-a0ca-1803c669c771

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 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.

Query parameters

alternativeKey'email' | 'document'
Example:email

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.

Headers

Content-Typestring required
Example:application/json

Type of the content being sent.

Acceptstring required
Example:application/json

HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.

Request body

clientPreferencesobject

Client preferences.

isToSavePersonalDataboolean

Defines if personal data will be saved (true) or not (false).

lastPurchasesAddressIdstring

Unique identifier of the client address.

Example request

{
  "paymentData": {
    "availableAccounts": [
      {
        "accountId": "D09F5E3F01054C959CFC4CB357961ADE",
        "paymentSystem": "2",
        "paymentSystemName": "Visa",
        "cardNumber": "************1111",
        "bin": "44443334",
        "availableAddresses": [
          "db267dcc53c14fb2b9a985532dd287bc"
        ],
        "expirationDate": "01/2032"
      }
    ],
    "availableTokens": [
      "12345"
    ],
    "transactions": [
      {
        "isActive": true,
        "transactionId": "418213DE29634837A63DD693A937A696",
        "merchantName": "luxstore",
        "payments": [
          {
            "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3",
            "paymentSystem": "6",
            "paymentSystemName": "Boleto Bancário",
            "value": 4450,
            "installments": 1,
            "referenceValue": 4450,
            "cardHolder": null,
            "cardNumber": null,
            "firstDigits": null,
            "lastDigits": null,
            "cvv2": null,
            "expireMonth": null,
            "expireYear": null,
            "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}",
            "giftCardId": null,
            "giftCardName": null,
            "giftCardCaption": null,
            "redemptionCode": null,
            "group": "bankInvoice",
            "tid": null,
            "dueDate": "2019-02-02",
            "connectorResponses": {}
          }
        ]
      }
    ],
    "giftCards": [
      "12345"
    ],
    "giftCardMessages": [
      "Message."
    ]
  }
}

Response

OK

idstring

ID of purchase information.

Example response

{
  "document": {
    "paymentData": {
      "availableAccounts": [
        {
          "accountId": "D09F5E3F01054C959CFC4CB357961ADE",
          "paymentSystem": "2",
          "paymentSystemName": "Visa",
          "cardNumber": "************1111",
          "bin": "44443334",
          "availableAddresses": [
            "db267dcc53c14fb2b9a985532dd287bc"
          ],
          "expirationDate": "01/2032"
        }
      ],
      "availableTokens": [
        "12345"
      ],
      "transactions": [
        {
          "isActive": true,
          "transactionId": "418213DE29634837A63DD693A937A696",
          "merchantName": "luxstore",
          "payments": [
            {
              "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3",
              "paymentSystem": "6",
              "paymentSystemName": "Boleto Bancário",
              "value": 4450,
              "installments": 1,
              "referenceValue": 4450,
              "cardHolder": null,
              "cardNumber": null,
              "firstDigits": null,
              "lastDigits": null,
              "cvv2": null,
              "expireMonth": null,
              "expireYear": null,
              "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}",
              "giftCardId": null,
              "giftCardName": null,
              "giftCardCaption": null,
              "redemptionCode": null,
              "group": "bankInvoice",
              "tid": null,
              "dueDate": "2019-02-02",
              "connectorResponses": {}
            }
          ]
        }
      ],
      "giftCards": [
        "12345"
      ],
      "giftCardMessages": [
        "Message."
      ]
    }
  }
}

Changes

Changed in 5 of the 50 revisions of this API.9515

  • e27de7bcbf6012See the full diff
    • ▲

      the query request parameter alternativeKey was restricted to a list of enum values

      request-parameter-became-enum

    • ○

      added the new enum value document to the query request parameter alternativeKey

      request-parameter-enum-value-added

    • ○

      added the new enum value email to the query request parameter alternativeKey

      request-parameter-enum-value-added

    • ▲

      the / request property type changed from string to array

      request-property-type-changed

    • ▲

      the // response's property type changed from string to array for status

      response-property-type-changed

  • fb9c5ab4fd8d26See the full diff
    • ▲

      the request's body type changed from no type to object

      request-body-type-changed

    • ▲

      removed the success response with the status

      response-success-status-removed

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the success response with the status

      response-success-status-added

  • 882bd80cdbee251See the full diff
    • ▲

      the request's body type changed from object to no type

      request-body-type-changed

    • ▲

      removed the success response with the status

      response-success-status-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property

      request-property-removed

    • ○

      added the success response with the status

      response-success-status-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 1f5d8ff1919326See the full diff
    • ▲

      the request's body type changed from no type to object

      request-body-type-changed

    • ▲

      removed the success response with the status

      response-success-status-removed

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the success response with the status

      response-success-status-added