Documentation
Feedback
Guides
API Reference

Guides
Guides

Creating a regular order from an existing cart

Learn how to use VTEX APIs to place a regular order from an existing cart.

This step-by-step guide will walk you through the process of using the Checkout API and Payments Gateway API to create an order from an existing shopping cart. It is divided into the following steps:

  1. Get cart information: Begin by retrieving the orderFormId of the current shopping cart via the Get current or create a new cart endpoint.
  2. Place the order: Continue by placing the order on the VTEX platform via the Place order from an existing cart endpoint.
  3. Handling the order payment and processing: The process ends by sending the necessary payment data to resolve the order payment and by processing order details.

Before you begin

Before proceeding any further, ensure that you have a valid appKey and appToken with the necessary permissions to access the Checkout and Payments Gateway APIs. For more information, refer to the Roles article.

Preparing the cart

In addition to valid credentials, ensure that the cart used to create the order already includes all the required information. Without these details, the steps described in this guide cannot be completed:

  • Selected products: Ensure the cart includes the desired items.
  • Customer data and shipping address: Confirm that the information is complete and valid.
  • Payment method: Define the payment option in advance. For credit cards, also include the number of installments and the card brand.

All of these details can be easily verified on the checkout screen, as shown in the illustration below.

{"base64":"  ","img":{"width":817,"height":604,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":91726,"url":"https://raw.githubusercontent.com/vtexdocs/dev-portal-content/main/docs/guides/Checkout/checkout_cart.png"}}

Click the steps below to navigate through this article and explore specific topics. Relevant code for each phase or parameter is highlighted on the right side of the screen.

Step 1 - Getting cart information

Send a GET request to the Get current or create a new cart endpoint to retrieve the orderFormId of the shopping cart you intend to use to create an order. The orderFormId is a unique identifier for the orderForm linked to a specific shopping cart.

For more information, refer to the Get cart information by ID guide.

Shell
Python
Node.js

_10
curl --request get \
_10
--url https://apiexamples.vtexcommercestable.com.br/api/checkout/pub/orderForm \
_10
--header 'Accept: application/json' \
_10
--header 'Content-Type: application/json'

Response

_268
{
_268
"orderFormId": "9563daa04ee24ac09be80d272dcc9e72",
_268
"salesChannel": "1",
_268
"loggedIn": false,
_268
"isCheckedIn": false,
_268
"storeId": null,
_268
"checkedInPickupPointId": null,
_268
"allowManualPrice": false,
_268
"canEditData": true,
_268
"userProfileId": "string",
_268
"userType": null,
_268
"ignoreProfileData": false,
_268
"value": 30000,
_268
"messages": [],
_268
"items": [
_268
{
_268
"uniqueId": "07FA7060463B48B7A8761E72C763DCE4",
_268
"id": "102",
_268
"productId": "11",
_268
"productRefId": "00011",
_268
"refId": "00012",
_268
"ean": null,
_268
"name": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"skuName": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"modalType": null,
_268
"parentItemIndex": null,
_268
"parentAssemblyBinding": null,
_268
"assemblies": [],
_268
"priceValidUntil": "2026-09-22T22:02:39Z",
_268
"tax": 0,
_268
"price": 30000,
_268
"listPrice": 30000,
_268
"manualPrice": null,
_268
"manualPriceAppliedBy": null,
_268
"sellingPrice": 30000,
_268
"rewardValue": 0,
_268
"isGift": false,
_268
"additionalInfo": {
_268
"dimension": null,
_268
"brandName": "VTEX Brand",
_268
"brandId": "2000002",
_268
"offeringInfo": null,
_268
"offeringType": null,
_268
"offeringTypeId": null
_268
},
_268
"preSaleDate": null,
_268
"productCategoryIds": "/2000017/",
_268
"productCategories": {
_268
"2000017": "VTEX Day Hackthon"
_268
},
_268
"quantity": 1,
_268
"seller": "1",
_268
"sellerChain": [
_268
"1"
_268
],
_268
"imageUrl": "https://accountname.vteximg.com.br/arquivos/ids/155427-55-55/gy6475-1.jpg?v=638418000550100000",
_268
"detailUrl": "/adidas-southpark-awesome/p",
_268
"components": [],
_268
"bundleItems": [],
_268
"attachments": [],
_268
"attachmentOfferings": [],
_268
"offerings": [],
_268
"priceTags": [],
_268
"availability": "available",
_268
"measurementUnit": "un",
_268
"unitMultiplier": 1.0000,
_268
"manufacturerCode": null,
_268
"priceDefinition": {
_268
"calculatedSellingPrice": 30000,
_268
"total": 2200,
_268
"sellingPrices": [
_268
{
_268
"value": 30000,
_268
"quantity": 1
_268
}
_268
],
_268
"reason": null
_268
},
_268
"taxCode": ""
_268
}
_268
],
_268
"selectableGifts": [],
_268
"totalizers": [
_268
{
_268
"id": "Items",
_268
"name": "Total dos Itens",
_268
"value": 30000
_268
},
_268
{
_268
"id": "Shipping",
_268
"name": "Total do Frete",
_268
"value": 0
_268
}
_268
],
_268
"shippingData": {
_268
"address": {},
_268
"logisticsInfo": [],
_268
"selectedAddresses": [],
_268
"availableAddresses": [],
_268
"pickupPoints": [],
_268
"contactInformation": []
_268
},
_268
"clientProfileData": {
_268
"email": "name.surname@test.com",
_268
"firstName": "Name",
_268
"lastName": "Surname",
_268
"document": "5555555555",
_268
"documentType": "cpf",
_268
"phone": "+55125555555",
_268
"corporateName": null,
_268
"tradeName": null,
_268
"corporateDocument": null,
_268
"stateInscription": null,
_268
"corporatePhone": null,
_268
"isCorporate": false,
_268
"profileCompleteOnLoading": null,
_268
"profileErrorOnLoading": null,
_268
"customerClass": null
_268
},
_268
"paymentData": {
_268
"updateStatus": "updated",
_268
"installmentOptions": [
_268
{
_268
"paymentSystem": "1",
_268
"bin": null,
_268
"paymentName": null,
_268
"paymentGroupName": null,
_268
"value": 30000,
_268
"installments": [
_268
{
_268
"count": 1,
_268
"hasInterestRate": false,
_268
"interestRate": 0,
_268
"value": 30000,
_268
"total": 30000,
_268
"sellerMerchantInstallments": [
_268
{
_268
"id": "accountName",
_268
"count": 1,
_268
"hasInterestRate": false,
_268
"interestRate": 0,
_268
"value": 30000,
_268
"total": 30000
_268
}
_268
]
_268
},
_268
{
_268
"count": 2,
_268
"hasInterestRate": true,
_268
"interestRate": 200,
_268
"value": 15451,
_268
"total": 30902,
_268
"sellerMerchantInstallments": [
_268
{
_268
"id": "accountName",
_268
"count": 2,
_268
"hasInterestRate": true,
_268
"interestRate": 200,
_268
"value": 15451,
_268
"total": 30902
_268
}
_268
]
_268
},
_268
...
_268
]
_268
}
_268
],
_268
"paymentSystems": [
_268
"paymentSystems": [
_268
{
_268
"id": 64,
_268
"name": "Customer Credit",
_268
"groupName": "creditControlPaymentGroup",
_268
"validator": {
_268
"regex": null,
_268
"mask": null,
_268
"cardCodeRegex": null,
_268
"cardCodeMask": null,
_268
"weights": null,
_268
"useCvv": false,
_268
"useExpirationDate": false,
_268
"useCardHolderName": false,
_268
"useBillingAddress": false
_268
},
_268
...
_268
}
_268
]
_268
],
_268
"payments": [
_268
{
_268
"paymentSystem": "2",
_268
"bin": null,
_268
"accountId": null,
_268
"tokenId": null,
_268
"installments": 1,
_268
"referenceValue": 30000,
_268
"value": 30000,
_268
"merchantSellerPayments": [
_268
{
_268
"id": "accountName",
_268
"installments": 1,
_268
"referenceValue": 30000,
_268
"value": 30000,
_268
"interestRate": null,
_268
"installmentValue": 30000
_268
}
_268
]
_268
}
_268
],
_268
"giftCards": [],
_268
"giftCardMessages": [],
_268
"availableAccounts": [],
_268
"availableTokens": []
_268
},
_268
"marketingData": null,
_268
"sellers": [
_268
{
_268
"id": "1",
_268
"name": "accountName",
_268
"logo": "",
_268
"minimumOrderValue": 0
_268
}
_268
],
_268
"clientPreferencesData": {
_268
"locale": "pt-BR",
_268
"optinNewsLetter": null
_268
},
_268
"commercialConditionData": null,
_268
"storePreferencesData": {
_268
"countryCode": "BRA",
_268
"saveUserData": true,
_268
"timeZone": "E. South America Standard Time",
_268
"currencyCode": "BRL",
_268
"currencyLocale": 1046,
_268
"currencySymbol": "R$",
_268
"currencyFormatInfo": {
_268
"currencyDecimalDigits": 2,
_268
"currencyDecimalSeparator": ",",
_268
"currencyGroupSeparator": ".",
_268
"currencyGroupSize": 3,
_268
"startsWithCurrencySymbol": true
_268
}
_268
},
_268
"giftRegistryData": null,
_268
"openTextField": null,
_268
"invoiceData": null,
_268
"customData": null,
_268
"itemMetadata": {
_268
"items": [
_268
{
_268
"id": "102",
_268
"seller": "1",
_268
"name": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"skuName": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"productId": "11",
_268
"refId": "00012",
_268
"ean": null,
_268
"imageUrl": "https://accountname.vteximg.com.br/arquivos/ids/155427-55-55/gy6475-1.jpg?v=638418000550100000",
_268
"detailUrl": "/adidas-southpark-awesome/p",
_268
"assemblyOptions": []
_268
}
_268
]
_268
},
_268
"hooksData": null,
_268
"ratesAndBenefitsData": null,
_268
"subscriptionData": null,
_268
"itemsOrdination": null
_268
}

Step 2 - Placing the order

Place a new order via the Place order from an existing cart endpoint, using the shopping cart identification (orderFormId) as a path parameter and providing the following information in the request body:

  • referenceId: the same orderFormId value used in the path parameter.
  • value: total value of the order in cents (e.g., $24.99 is represented by 2499).
  • referenceValue: reference value of the order in cents (e.g., $24.99 is represented by 2499). This is used for calculating interest, if applicable.
  • interestValue: interest value to be applied, if applicable.
  • savePersonalData: set as true if the shopper's data provided during checkout should be saved for future reference (default is false).
  • optinNewsLetter: set as true if the shopper opted to receive the newsletter (default is false).

Upon receiving a 200 OK response, the request will provide a response body containing the orderForm with comprehensive details of the newly created regular order. Note the following details. Then, proceed to Resolving the order payment.

  • orderGroup - ID that groups all orders related to the same purchase. For example, when an order is fulfilled by multiple sellers, each seller has its own order ID (v71021570str-01 and v71021570str-02), but they share the same order group ID (v71021570str).
  • transactionId - ID of the transaction, which can be found within an object contained in the merchantTransactions array.

If you encounter errors during the request submission, refer to Handling HTTP response errors when placing the order for common error scenarios when placing an order.

Shell
Python
Node.js

_10
curl --request post \
_10
--url 'https://apiexamples.vtexcommercestable.com.br/api/checkout/pub/orderForm/{orderFormId}/transaction' \
_10
--header 'Accept: application/json' \
_10
--header 'Content-Type: application/json' \
_10
--data '{"referenceId":"9563daa04ee24ac09be80d272dcc9e72","value":30000,"referenceValue":30000,"interestValue":0,"savePersonalData":false,"optinNewsLetter":false}'

Response

_31
{
_31
"id": "E785435CCAAE4C45AAE547AB6D9B57CF",
_31
"merchantTransactions": [
_31
{
_31
"id": "accountName",
_31
"transactionId": "E785435CCAAE4C45AAE547AB6D9B57CF",
_31
"merchantName": "accountName",
_31
"payments": [
_31
{
_31
"paymentSystem": "2",
_31
"bin": "45398623",
_31
"accountId": null,
_31
"tokenId": null,
_31
"value": 30000,
_31
"referenceValue": 30000,
_31
"giftCardRedemptionCode": null,
_31
"giftCardProvider": null,
_31
"giftCardId": null
_31
}
_31
]
_31
}
_31
],
_31
"receiverUri": "https://accountName.vtexpayments.com.br/split/17700236/payments",
_31
"gatewayCallbackTemplatePath": "/checkout/gatewayCallback/17700236/{messageCode}",
_31
"orderGroup": "17700236",
_31
"orderFormId": "9563daa04ee24ac09be80d272dcc9e72",
_31
"salesChannel": "1",
_31
"loggedIn": true,
_31
"isCheckedIn": false,
_31
...
_31
}

Step 3 - Resolving the order payment

Now, we will communicate the necessary payment data to VTEX to finalize the order payment.

Note that from now on (once Step 2 has been completed), you have 5 minutes to submit the payment information (Step 3) and process the order (Step 4). If Steps 3 and 4 are not completed within 5 minutes, the order will be automatically canceled.

  • Send a request to the Send payments information endpoint, considering the following:

    • Use the transactionId value from the previous step as both the path parameter and the value for the id field within the transaction object.
    • Set the merchantName field within the transaction object to your account name.
    • Use the orderId value as a query string parameter. This is the same orderGroup obtained in the previous step.
    • Ensure that the request body is based on the paymentData section of your orderForm.
    • In the fields object, you can:
      • Fill in the credit or debit card information (when applicable).
      • Use the addressId field to reference an existing address, or provide a new address object for an entirely new address. This type of information is only required if the shopper's address was not previously entered during checkout.

This request does not return any data in the response body, only a 201 Created success confirmation message.

Shell
Python
Node.js

_10
curl --request post \
_10
--url 'https://{accountName}.vtexpayments.com.br/api/pub/transactions/{transactionId}/payments?orderId={orderId}' \
_10
--header 'Accept: application/json' \
_10
--header 'Content-Type: application/json' \
_10
--header 'X-VTEX-API-AppKey: {appKey}' \
_10
--header 'X-VTEX-API-AppToken: {appToken}' \
_10
--data '[{"paymentSystem":2,"installments":1,"currencyCode":"BRL","value":30000,"installmentsInterestRate":0,"installmentsValue":30000,"referenceValue":30000,"fields":{"holderName":"UserTest","cardNumber":"5378244888889174","validationCode":"231","dueDate":"10/19","document":"8041734561","accountId":"","address":null,"callbackUrl":""},"transaction":{"id":"E785435CCAAE4C45AAE547AB6D9B57CF","merchantName":"accountName"}}]'

Response

_10
201 Created

Step 4 - Processing and validating the order

In this final step, we will process the order.

  • Send a request to the Process order endpoint, using the orderGroup value (which is the orderFormId) as a path parameter.

If the payment is processed without any issues, the order should be successfully placed (204 No Content status). Otherwise, a 500 Internal Server Error message might occur.

Note that this process uses the gateway connectors configured in your VTEX environment. Be careful to prevent any unwanted charges or unexpected payment denials.

Shell
Python
Node.js

_10
curl --request post \
_10
--url 'https://{accountName}.{environment}.com.br/api/checkout/pub/gatewayCallback/{orderGroup}' \
_10
--header 'Accept: application/json' \
_10
--header 'Content-Type: application/json' \
_10
--header 'Cookie: {cookie}' \
_10
--header 'X-VTEX-API-AppKey: {appKey}' \
_10
--header 'X-VTEX-API-AppToken: {appToken}'

Response

_10
204 No Content

Step 1 - Getting cart information

Send a GET request to the Get current or create a new cart endpoint to retrieve the orderFormId of the shopping cart you intend to use to create an order. The orderFormId is a unique identifier for the orderForm linked to a specific shopping cart.

For more information, refer to the Get cart information by ID guide.

Step 2 - Placing the order

Place a new order via the Place order from an existing cart endpoint, using the shopping cart identification (orderFormId) as a path parameter and providing the following information in the request body:

  • referenceId: the same orderFormId value used in the path parameter.
  • value: total value of the order in cents (e.g., $24.99 is represented by 2499).
  • referenceValue: reference value of the order in cents (e.g., $24.99 is represented by 2499). This is used for calculating interest, if applicable.
  • interestValue: interest value to be applied, if applicable.
  • savePersonalData: set as true if the shopper's data provided during checkout should be saved for future reference (default is false).
  • optinNewsLetter: set as true if the shopper opted to receive the newsletter (default is false).

Upon receiving a 200 OK response, the request will provide a response body containing the orderForm with comprehensive details of the newly created regular order. Note the following details. Then, proceed to Resolving the order payment.

  • orderGroup - ID that groups all orders related to the same purchase. For example, when an order is fulfilled by multiple sellers, each seller has its own order ID (v71021570str-01 and v71021570str-02), but they share the same order group ID (v71021570str).
  • transactionId - ID of the transaction, which can be found within an object contained in the merchantTransactions array.

If you encounter errors during the request submission, refer to Handling HTTP response errors when placing the order for common error scenarios when placing an order.

Step 3 - Resolving the order payment

Now, we will communicate the necessary payment data to VTEX to finalize the order payment.

Note that from now on (once Step 2 has been completed), you have 5 minutes to submit the payment information (Step 3) and process the order (Step 4). If Steps 3 and 4 are not completed within 5 minutes, the order will be automatically canceled.

  • Send a request to the Send payments information endpoint, considering the following:

    • Use the transactionId value from the previous step as both the path parameter and the value for the id field within the transaction object.
    • Set the merchantName field within the transaction object to your account name.
    • Use the orderId value as a query string parameter. This is the same orderGroup obtained in the previous step.
    • Ensure that the request body is based on the paymentData section of your orderForm.
    • In the fields object, you can:
      • Fill in the credit or debit card information (when applicable).
      • Use the addressId field to reference an existing address, or provide a new address object for an entirely new address. This type of information is only required if the shopper's address was not previously entered during checkout.

This request does not return any data in the response body, only a 201 Created success confirmation message.

Step 4 - Processing and validating the order

In this final step, we will process the order.

  • Send a request to the Process order endpoint, using the orderGroup value (which is the orderFormId) as a path parameter.

If the payment is processed without any issues, the order should be successfully placed (204 No Content status). Otherwise, a 500 Internal Server Error message might occur.

Note that this process uses the gateway connectors configured in your VTEX environment. Be careful to prevent any unwanted charges or unexpected payment denials.

Shell
Python
Node.js

_10
curl --request get \
_10
--url https://apiexamples.vtexcommercestable.com.br/api/checkout/pub/orderForm \
_10
--header 'Accept: application/json' \
_10
--header 'Content-Type: application/json'

Response

_268
{
_268
"orderFormId": "9563daa04ee24ac09be80d272dcc9e72",
_268
"salesChannel": "1",
_268
"loggedIn": false,
_268
"isCheckedIn": false,
_268
"storeId": null,
_268
"checkedInPickupPointId": null,
_268
"allowManualPrice": false,
_268
"canEditData": true,
_268
"userProfileId": "string",
_268
"userType": null,
_268
"ignoreProfileData": false,
_268
"value": 30000,
_268
"messages": [],
_268
"items": [
_268
{
_268
"uniqueId": "07FA7060463B48B7A8761E72C763DCE4",
_268
"id": "102",
_268
"productId": "11",
_268
"productRefId": "00011",
_268
"refId": "00012",
_268
"ean": null,
_268
"name": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"skuName": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"modalType": null,
_268
"parentItemIndex": null,
_268
"parentAssemblyBinding": null,
_268
"assemblies": [],
_268
"priceValidUntil": "2026-09-22T22:02:39Z",
_268
"tax": 0,
_268
"price": 30000,
_268
"listPrice": 30000,
_268
"manualPrice": null,
_268
"manualPriceAppliedBy": null,
_268
"sellingPrice": 30000,
_268
"rewardValue": 0,
_268
"isGift": false,
_268
"additionalInfo": {
_268
"dimension": null,
_268
"brandName": "VTEX Brand",
_268
"brandId": "2000002",
_268
"offeringInfo": null,
_268
"offeringType": null,
_268
"offeringTypeId": null
_268
},
_268
"preSaleDate": null,
_268
"productCategoryIds": "/2000017/",
_268
"productCategories": {
_268
"2000017": "VTEX Day Hackthon"
_268
},
_268
"quantity": 1,
_268
"seller": "1",
_268
"sellerChain": [
_268
"1"
_268
],
_268
"imageUrl": "https://accountname.vteximg.com.br/arquivos/ids/155427-55-55/gy6475-1.jpg?v=638418000550100000",
_268
"detailUrl": "/adidas-southpark-awesome/p",
_268
"components": [],
_268
"bundleItems": [],
_268
"attachments": [],
_268
"attachmentOfferings": [],
_268
"offerings": [],
_268
"priceTags": [],
_268
"availability": "available",
_268
"measurementUnit": "un",
_268
"unitMultiplier": 1.0000,
_268
"manufacturerCode": null,
_268
"priceDefinition": {
_268
"calculatedSellingPrice": 30000,
_268
"total": 2200,
_268
"sellingPrices": [
_268
{
_268
"value": 30000,
_268
"quantity": 1
_268
}
_268
],
_268
"reason": null
_268
},
_268
"taxCode": ""
_268
}
_268
],
_268
"selectableGifts": [],
_268
"totalizers": [
_268
{
_268
"id": "Items",
_268
"name": "Total dos Itens",
_268
"value": 30000
_268
},
_268
{
_268
"id": "Shipping",
_268
"name": "Total do Frete",
_268
"value": 0
_268
}
_268
],
_268
"shippingData": {
_268
"address": {},
_268
"logisticsInfo": [],
_268
"selectedAddresses": [],
_268
"availableAddresses": [],
_268
"pickupPoints": [],
_268
"contactInformation": []
_268
},
_268
"clientProfileData": {
_268
"email": "name.surname@test.com",
_268
"firstName": "Name",
_268
"lastName": "Surname",
_268
"document": "5555555555",
_268
"documentType": "cpf",
_268
"phone": "+55125555555",
_268
"corporateName": null,
_268
"tradeName": null,
_268
"corporateDocument": null,
_268
"stateInscription": null,
_268
"corporatePhone": null,
_268
"isCorporate": false,
_268
"profileCompleteOnLoading": null,
_268
"profileErrorOnLoading": null,
_268
"customerClass": null
_268
},
_268
"paymentData": {
_268
"updateStatus": "updated",
_268
"installmentOptions": [
_268
{
_268
"paymentSystem": "1",
_268
"bin": null,
_268
"paymentName": null,
_268
"paymentGroupName": null,
_268
"value": 30000,
_268
"installments": [
_268
{
_268
"count": 1,
_268
"hasInterestRate": false,
_268
"interestRate": 0,
_268
"value": 30000,
_268
"total": 30000,
_268
"sellerMerchantInstallments": [
_268
{
_268
"id": "accountName",
_268
"count": 1,
_268
"hasInterestRate": false,
_268
"interestRate": 0,
_268
"value": 30000,
_268
"total": 30000
_268
}
_268
]
_268
},
_268
{
_268
"count": 2,
_268
"hasInterestRate": true,
_268
"interestRate": 200,
_268
"value": 15451,
_268
"total": 30902,
_268
"sellerMerchantInstallments": [
_268
{
_268
"id": "accountName",
_268
"count": 2,
_268
"hasInterestRate": true,
_268
"interestRate": 200,
_268
"value": 15451,
_268
"total": 30902
_268
}
_268
]
_268
},
_268
...
_268
]
_268
}
_268
],
_268
"paymentSystems": [
_268
"paymentSystems": [
_268
{
_268
"id": 64,
_268
"name": "Customer Credit",
_268
"groupName": "creditControlPaymentGroup",
_268
"validator": {
_268
"regex": null,
_268
"mask": null,
_268
"cardCodeRegex": null,
_268
"cardCodeMask": null,
_268
"weights": null,
_268
"useCvv": false,
_268
"useExpirationDate": false,
_268
"useCardHolderName": false,
_268
"useBillingAddress": false
_268
},
_268
...
_268
}
_268
]
_268
],
_268
"payments": [
_268
{
_268
"paymentSystem": "2",
_268
"bin": null,
_268
"accountId": null,
_268
"tokenId": null,
_268
"installments": 1,
_268
"referenceValue": 30000,
_268
"value": 30000,
_268
"merchantSellerPayments": [
_268
{
_268
"id": "accountName",
_268
"installments": 1,
_268
"referenceValue": 30000,
_268
"value": 30000,
_268
"interestRate": null,
_268
"installmentValue": 30000
_268
}
_268
]
_268
}
_268
],
_268
"giftCards": [],
_268
"giftCardMessages": [],
_268
"availableAccounts": [],
_268
"availableTokens": []
_268
},
_268
"marketingData": null,
_268
"sellers": [
_268
{
_268
"id": "1",
_268
"name": "accountName",
_268
"logo": "",
_268
"minimumOrderValue": 0
_268
}
_268
],
_268
"clientPreferencesData": {
_268
"locale": "pt-BR",
_268
"optinNewsLetter": null
_268
},
_268
"commercialConditionData": null,
_268
"storePreferencesData": {
_268
"countryCode": "BRA",
_268
"saveUserData": true,
_268
"timeZone": "E. South America Standard Time",
_268
"currencyCode": "BRL",
_268
"currencyLocale": 1046,
_268
"currencySymbol": "R$",
_268
"currencyFormatInfo": {
_268
"currencyDecimalDigits": 2,
_268
"currencyDecimalSeparator": ",",
_268
"currencyGroupSeparator": ".",
_268
"currencyGroupSize": 3,
_268
"startsWithCurrencySymbol": true
_268
}
_268
},
_268
"giftRegistryData": null,
_268
"openTextField": null,
_268
"invoiceData": null,
_268
"customData": null,
_268
"itemMetadata": {
_268
"items": [
_268
{
_268
"id": "102",
_268
"seller": "1",
_268
"name": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"skuName": "Adidas x South Park Forum Low “AWESOM-O” caramel 38",
_268
"productId": "11",
_268
"refId": "00012",
_268
"ean": null,
_268
"imageUrl": "https://accountname.vteximg.com.br/arquivos/ids/155427-55-55/gy6475-1.jpg?v=638418000550100000",
_268
"detailUrl": "/adidas-southpark-awesome/p",
_268
"assemblyOptions": []
_268
}
_268
]
_268
},
_268
"hooksData": null,
_268
"ratesAndBenefitsData": null,
_268
"subscriptionData": null,
_268
"itemsOrdination": null
_268
}

Handling HTTP response errors when placing the order

400 - Bad Request (ORD002)

Message error example (code ORD002): "Invalid order form"

  • Issue: The orderFormId information is not valid.
  • Troubleshooting:
    • Verify that the orderFormId is correct.
    • Ensure that the orderFormId corresponds to an existing shopping cart.
Response

_10
{
_10
"fields": {},
_10
"error": {
_10
"code": "ORD002",
_10
"message": "Invalid order form",
_10
"exception": null
_10
},
_10
"operationId": "f01ef909-8b81-4ffd-a91d-82be680d60ff"
_10
}

400 - Bad Request (CHK0016)

Message error example (code CHK0016): "Payment value does not match with reference value"

  • Issue: The value and referenceValue fields have different values even when no interest is applied to the payment.
  • Troubleshooting:
    • Confirm that the provided value and referenceValue align correctly.
    • Check if the interest rate is correctly configured.
Response

_10
{
_10
"fields": {},
_10
"error": {
_10
"code": "CHK0016",
_10
"message": "Payment value does not match with reference value",
_10
"exception": null
_10
},
_10
"operationId": "6a080d5f-6911-4469-a661-312e93c23419"
_10
}

404 - Not Found

Message error example: "The requested URL was not found on the server"

  • Issue: The requested URL was not found on the server.
  • Troubleshooting: Check if the endpoint used is correct.
Response

_10
<body>
_10
<h1>404 Not Found</h1>
_10
<p>The requested URL was not found on this server.</p>
_10
</body>

500 - Internal Server Error

Message error example (code ORD005): "The purchase cannot be done without items"

  • Issue: The shopping cart (orderFormId) informed in the request does not have any item, making it impossible to create an order.
  • Troubleshooting:
    • Verify that the specified shopping cart has items.
    • Confirm that the orderFormId corresponds to a valid and non-empty shopping cart.
Response

_10
{
_10
"fields": {},
_10
"error": {
_10
"code": "ORD005",
_10
"message": "The purchase cannot be done without items",
_10
"exception": null
_10
},
_10
"operationId": "673771c0-f5ba-4fa6-800d-bea836c51f93"
_10
}

400 - Bad Request (ORD002)

Message error example (code ORD002): "Invalid order form"

  • Issue: The orderFormId information is not valid.
  • Troubleshooting:
    • Verify that the orderFormId is correct.
    • Ensure that the orderFormId corresponds to an existing shopping cart.

400 - Bad Request (CHK0016)

Message error example (code CHK0016): "Payment value does not match with reference value"

  • Issue: The value and referenceValue fields have different values even when no interest is applied to the payment.
  • Troubleshooting:
    • Confirm that the provided value and referenceValue align correctly.
    • Check if the interest rate is correctly configured.

404 - Not Found

Message error example: "The requested URL was not found on the server"

  • Issue: The requested URL was not found on the server.
  • Troubleshooting: Check if the endpoint used is correct.

500 - Internal Server Error

Message error example (code ORD005): "The purchase cannot be done without items"

  • Issue: The shopping cart (orderFormId) informed in the request does not have any item, making it impossible to create an order.
  • Troubleshooting:
    • Verify that the specified shopping cart has items.
    • Confirm that the orderFormId corresponds to a valid and non-empty shopping cart.
Response

_10
{
_10
"fields": {},
_10
"error": {
_10
"code": "ORD002",
_10
"message": "Invalid order form",
_10
"exception": null
_10
},
_10
"operationId": "f01ef909-8b81-4ffd-a91d-82be680d60ff"
_10
}

Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Suggest edits (GitHub)
On this page