v1

latestOpenAPI 3.0.02026-07-141525155.4 KB
External Seller

Fulfillment simulation - External Seller

This endpoint may be called upon by VTEX for fulfillment simulation in the external seller different contexts. See examples below.

When a price or inventory notification request returns a response with status 200 OK, it means that the SKU already exists in the marketplace. Whenever this happens, the marketplace will call the seller to get two updated information about the SKU: Price and Inventory.

The seller needs to have an endpoint implemented in order to receive this call and send a response containing the requested information to the marketplace. We call it the Fulfillment Simulation endpoint.

If the seller wishes to include other parameters in this call (like account name, or sales channel ID), this should be done within their {fulfillmentEndpoint}. This path is then inserted in the marketplace's VTEX admin when configuring a seller.

The marketplace will send an object containing an array of items. The seller must use this list to get the updated information about the referred SKUs and send them back to the marketplace, following the response format explained in the API Reference.

This call is also applied in the Storefront simulation scenario, in which case the request from VTEX does not send the paramenters country and postalCode. The call's payload can be adapted into two scenarios:

  • Displaying items in the storefront: the address information can be nulled in the request, since they are not mandatory data for this context.
  • Making a shopping cart simulation during checkout: address information must be sent, since this data is needed to calculate freight values. If the address information (including postalCode and country) is not sent through the call, VTEX interprets the stock balance as zero. Without a valid stock balance, the seller will not be shown as an option during checkout.

Request body example - Indexing simulation

{
    "items": [
      {
        "id": "7908010136043",
        "quantity": 1,
        "seller": "1",
      }
    ],
    "isCheckedIn": false,
  }

Request body example - Checkout simulation

{
    "items": [
      {
        "id": "7908010136043",
        "quantity": 1,
        "seller": "1",
      }
    ],
    "postalCode": "22270-030",
    "country": "BRA",
  }
post/{fulfillmentEndpoint}/pvt/orderForms/simulation

Path parameters

fulfillmentEndpointstring required
Example:marketplaceexample.externalseller.com

This is the fulfillment endpoint registered for each specific external seller in the seller management section of VTEX's admin panel.

Headers

Acceptstring required
Example:application/json

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

Content-Typestring required
Example:application/json

Describes the type of the content being sent.

Request body

countrystring

ISO 3-digit code of the country where the delivery address is located. This field is mandatory, for shopping carts simulations, where both Country and Postal Code are required. This field should be sent as null for storefront simulations, where the information is not necessary.

geoCoordinatesstring[]

Geographic coordinates of the delivery address. This may be used instead of the postalCode, in case the marketplace is configured to accept geolocation. Example of value: [-22.9443504,-43.1825635].

postalCodestring required

Delivery address postal code. This field is mandatory for shopping carts simulations, where both Country and Postal Code are required. This field should be sent as null for storefront simulations, where the information is not necessary.

scstring

Sales channel (or trade policy) associated to the seller account created.

Example request

{
  "country": "USA",
  "geoCoordinates": [
    "00.00000000"
  ],
  "items": [
    {
      "id": "6",
      "quantity": 1,
      "seller": "01"
    }
  ],
  "postalCode": "12345678",
  "sc": "1"
}

Response

OK

countrystring required

ISO 3-digit code of the country where the delivery address is located. If you don’t want to send it, use the value null.

postalCodestring required

Postal code of the delivery address. This field is mandatory, for shopping carts simulations, where both Country and Postal Code are required. This field should be sent as null for storefront simulations, where the information is not necessary.

Example response

{
  "country": "BRA",
  "items": [
    {
      "id": "2000037",
      "listPrice": 67203,
      "measurementUnit": "un",
      "merchantName": "mySeller1",
      "offerings": [
        {
          "id": "5",
          "name": "1 year warranty",
          "price": 10000,
          "type": "Warranty"
        }
      ],
      "price": 67203,
      "priceTags": [],
      "priceValidUntil": "2014-03-01T22:58:28.143",
      "quantity": 1,
      "requestIndex": 0,
      "seller": "1",
      "unitMultiplier": 1
    }
  ],
  "logisticsInfo": [
    {
      "deliveryChannels": [
        {
          "id": "delivery",
          "stockBalance": 179
        },
        {
          "id": "pickup-in-point",
          "stockBalance": 20
        }
      ],
      "itemIndex": 0,
      "quantity": 1,
      "shipsTo": [
        "BRA"
      ],
      "slas": [
        {
          "availableDeliveryWindows": [
            {
              "endDateUtc": "2013-02-04T13:00:00+00:00",
              "price": 0,
              "startDateUtc": "2013-02-04T08:00:00+00:00"
            }
          ],
          "deliveryChannel": "pickup-in-point",
          "id": "Curbside pickup",
          "name": "Curbside pickup",
          "pickupStoreInfo": {
            "additionalInfo": "",
            "address": {
              "addressId": "548304ed-dd40-4416-b12b-4b32bfa7b1e0",
              "addressType": "pickup",
              "city": "Curitiba",
              "complement": "Loja 10",
              "country": "BRA",
              "geoCoordinates": [
                49.334934,
                25.401705
              ],
              "neighborhood": "Santa Felicidade",
              "number": "100",
              "postalCode": "82320-040",
              "receiverName": "Juliana",
              "reference": "Next to the unicorn statue",
              "state": "PR",
              "street": "Rua Domingos Strapasson"
            },
            "friendlyName": "Santa Felicidade",
            "isPickupStore": true
          },
          "price": 0,
          "shippingEstimate": "0bd"
        }
      ],
      "stockBalance": 199
    }
  ],
  "postalCode": "80250000"
}