Skip to main content
Version: 2025-03

Order

An order is created when a customer completes the checkout process. Orders also can be created through the API.

Table of Contents

Get all orders

Get an order

Create an order

Update an order

Get an order value history

Get an order edition history

Pay an order

Close an order

Reopen an order

Cancel an order

Create an invoice

Read an invoice

Properties

PropertyExplanation
idThe unique numeric identifier for the Order. It's different from number
tokenSpecifies the location of the Order
store_idID of the store the order belongs to
contact_emailEmail of the buyer
contact_phonePhone of the buyer
contact_identificationIdentification of the buyer (CPF/CNPJ/DNI/CUIT)
numberUnique numberc identifier for an Order used by the shop owner and customers. It's sequential and starts at 100
completed_atObject containing information about the date when the Order was created. It's the same date than the created_at date, but in a different data type.
attributesA list with the custom attributes for this order
customerCustomer that purchased this Order. Only given if the 'read_customers' scope is set for the app
productsList of the products purchased by the customer. Contents are explained below and values hold are the ones corresponding to the time the products were purchased
noteCustomer's note about the order
owner_noteStore owner's note about the order
couponList of coupons applied to the order
discountTotal value of the discount applied to the price of the order
subtotalPrice of the order before shipping
totalTotal price of the order including shipping and discounts
total_usdTotal price of the order in US dollars
currencyThe total spent's currency in ISO 4217 format
languageOrder's language used by the customer during the checkout process
gatewayID of the payment provider that processed the order payment transaction.
gateway_id[Read-only] External transaction ID used by the payment provider.
gateway_name[Read-only] Name of the payment provider of the order.
gateway_linkURL of the transaction details page (in the payments app's website). Can be null if the payment app didn't set this URL, or if it's a custom payment method.
shipping_addressThe customer's shipping address where the order will be shipped
billing_nameBilling name for the order
billing_phoneBilling phone for the order
billing_addressBilling address for the order
billing_numberBilling number for the order
billing_floorBilling floor for the order
billing_localityBilling locality for the order
billing_zipcodeBilling zipcode for the order
billing_cityBilling city for the order
billing_provinceBilling province for the order
billing_countryBilling country code for the order
billing_customer_typeBilling customer type (person or company)
billing_business_nameBilling business name
billing_fiscal_regimeThe (Billing Fiscal Regime) is only used in es_MX, and the default is 601. For other countries, the default is null
billing_invoice_useThe (Billing Invoice Use) is only used in es_MX, and the default is G01. For other countries, the default is null
billing_trade_nameBilling trade name
billing_state_registrationBilling state registration
billing_document_typeBilling document type
extraA JSON object containing custom information. Can be set via the API or through custom form fields of name "extra[key]" on the cart's checkout form in the storefront
storefrontOrigin of the order. Possible values are "store" (order created in the storefront), "meli" (order imported from Mercado Libre), "api" (order created via API), "form" (order created in the admin panel with the draft orders feature) or "pos" (order created via point of sale app)
checkout_enabledDeprecated
weightOrder's total weight, in kilograms
cancelled_atDate when the order was cancelled in ISO 8601 format
closed_atDate when the order was closed (archived) in ISO 8601 format
read_atDate when the order was marked as read in ISO 8601 format
statusOrder's status. Possible values are "open", "closed" or "cancelled"
payment_statusOrder's payment status. Possible values are "authorized", "pending", "paid", "partially_paid", "abandoned", "refunded", "partially_refunded" or "voided"
shipping_statusOrder's shipping status. Possible values are "unpacked", "shipped" (means "fulfilled"), "unshipped" (means "unfulfilled", only possible in Orders with shipments and not in Digital Orders), "delivered", "partially_packed" (means at least 1 Fulfillment Order was packed), "partially_fulfilled" (means at least 1 Fulfillment Order was shipped).
payment_detailsA JSON object containing payment details.
paid_atDate when the order was paid in ISO 8601 format.
cancel_reasonReason why the store owner cancelled an Order. Possible values are "customer", "fraud", "inventory" or "other"
created_atDate when the Order was created in ISO 8601 format. It's the same date than the completed_at date, but in a different data type.
updated_atDate when the Order was last updated in ISO 8601 format
client_detailsCustomer details for analytics.
app_idIf the order was created via API by an app, ID of the app. Otherwise, null.
same_billing_and_shipping_address"true" if billing address and shipping address are the same, "false" otherwise.
total_paid_by_customerThe total amount of money that the Customer paid in the Order. Important: this might not be the same as the Order's total (such as in unpaid Orders or partially paid Orders). Also, the Order's transaction might also not match this value, since some Orders (ie. Orders that were created via Draft Orders) don't have transactions associated to them, as well as Edit Orders allowing to modify the Order's price without affecting associated Transaction. Finally, this price can increase or decrease depending on Order editions. See order/edited Webhook if you would like to be notified of these changes.
fulfillmentsA list of the Fulfillment Orders of the Order. See Fulfillment Order Resource Page for reference of the contents. Refer to the aggregates parameter for more information.

The products field has the following contents:

PropertyExplanation
idID of the line item. A value that uniquely identifies this product within the order.
product_idProduct purchased
variant_idProduct Variant purchased
nameProduct's name at the time of purchase
priceProduct's price at the time of purchase
quantityQuantity purchased
weightProduct's weight at the time of purchase
widthProduct's width at the time of purchase
heightProduct's height at the time of purchase
depthProduct's depth at the time of purchase
free_shippingIndicates if the product has free shipping or not.
issuesPossibles issues that can happen to an order. Contents are explained below.
propertiesAn array with values of custom fields

Important: In our API, it's possible to obtain the same product_id and variant_id in different line items.
Why can this happen? For example, an order may have two units of the same variant, but each with different custom fields.
That's why 2 units (quantity) are not sent in the same line item but are instead sent as separate units with different values in the properties array.

The products.idhas an incremental value, meaning it exceeds the limits of an int32 type and can require support for larger data types, such as int64. It's crucial for the backend to accommodate fields with extended ranges to avoid exceptions that could disrupt the correct import of information.

The issues field has the following content:

PropertyValue ExplanationIssue explanation
unclaimed_stockNumber of items claimed by the user with insufficient stockCan happens due to a race condition while the user is trying to pay the order and another user buys the same item.

Fulfillment Orders

The fulfillment_orders field is a list of Fulfillment Orders as defined here.

By default, only the Fulfillment Order IDs are returned. To get the details it's possible to use Fulfillment Order API or add the parameter aggregates=fulfillment_orders to include the full details in the response. See examples below.

Payment Details

The payment_details field has the following contents:

PropertyTypeExplanation
methodStringPayment method selected.
credit_card_companyStringCredit card company.
installmentsIntegerQuantity of installments.

Endpoints

GET /orders

Receive a list of all Orders. Make sure to check out our recommendations on best practices for retrieving orders information in our FAQ section below.

ParameterExplanation
since_idRestrict results to after the specified ID
statusShow Orders with a given state. Possible values are "any" (default), "open", "closed" or "cancelled"
channelsRestrict results to the specified sales channel. Possible values are "form" (draft order created via admin or API), "store" (order created in the storefront), "api" (order created via API - doesn't include draft orders), "meli" (order imported from Mercado Libre) or "pos" (order created via point of sale app)
payment_statusShow Orders with a given payment state. Possible values are "any" (default), "pending", "authorized", "paid", "abandoned", "refunded" or "voided"
shipping_statusShow Orders with a given shipping state. Possible values are "any" (default), "unpacked", "unfulfilled" (means "unshipped") or "fulfilled" (means "shipped")
created_at_minShow Orders created after date (ISO 8601 format)
created_at_maxShow Orders created before date (ISO 8601 format)
updated_at_minShow Orders last updated after date (ISO 8601 format)
updated_at_maxShow Orders last updated before date (ISO 8601 format)
total_minShow Orders with total value bigger or equals than the specified value
total_maxShow Orders with total value lower or equals than the specified value
customer_idsRestrict results to the specified customer IDs (comma-separated)
pagePage to show
per_pageAmount of results
fieldsComma-separated list of fields to include in the response
qSearch Orders by the given number; or containing the given text in the customer name or email
app_idShow orders created by a given app
payment_methodsShow orders with a given payment method
payment_providerShow orders with a given payment provider
aggregatesOne possible value: fulfillment_orders. Enables an array called fulfillments that displays partial information of the Fulfillment Order. If wou want to get the complete information of the Fulfillment Order, you can use the Fulfillment Order Resource or fetch the single Order with the corresponding aggregates value.

GET /orders

HTTP/1.1 200 OK

[
{
"id": 871254203,
"token": "b872a1befbcde5aaf0517ecbcc910f5dc005350e",
"store_id": "817495",
"contact_email": "buyer@tiendanube.com",
"contact_name": "Maria Silva",
"contact_phone": "+551533276436",
"contact_identification": "75839566500",
"billing_name": "Maria",
"billing_phone": "+551533276436",
"billing_address": "Rua Doutor Azevedo Sampaio",
"billing_number": "50",
"billing_floor": "",
"billing_locality": "Centro",
"billing_zipcode": "18010220",
"billing_city": "Sorocaba",
"billing_province": "São Paulo",
"billing_country": "BR",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": "871254203",
"created_at": "2022-11-15T19:37:08+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "6000.00",
"discount": "600.00",
"discount_coupon": "0.00",
"discount_gateway": "600.00",
"total": "5400.00",
"total_usd": "40.79",
"checkout_enabled": true,
"weight": "0.000",
"currency": "ARS",
"language": "es",
"gateway": "offline",
"gateway_id": null,
"gateway_name": "Transferencia Bancaria",
"extra": {},
"storefront": "store",
"note": "",
"created_at": "2022-11-15T19:36:59+0000",
"updated_at": "2022-11-15T19:37:08+0000",
"completed_at": {
"date": "2022-11-15 19:36:59.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": "custom",
"credit_card_company": null,
"installments": 1
},
"same_billing_and_shipping_address": false,
"attributes": [],
"customer": {
"id": 105799009,
"name": "Maria Silva",
"email": "buyer@tiendanube.com",
"identification": "75839566500",
"phone": "+551533276436",
"note": null,
"default_address": {
"address": "Evergreen Terrace",
"city": "New York",
"country": "US",
"created_at": "2022-11-15T19:36:59+0000",
"default": true,
"floor": "Apartment 8",
"id": 80189931,
"locality": "Bronx",
"name": "John Doe",
"number": "742",
"phone": "john.doe@example.com",
"province": "New York",
"updated_at": "2022-11-15T19:36:59+0000",
"zipcode": "10451"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "New York",
"country": "US",
"created_at": "2022-11-15T19:36:59+0000",
"default": true,
"floor": "Apartment 8",
"id": 80189931,
"locality": "Bronx",
"name": "John Doe",
"number": "742",
"phone": "john.doe@example.com",
"province": "New York",
"updated_at": "2022-11-15T19:36:59+0000",
"zipcode": "10451"
}
],
"billing_name": "Maria",
"billing_phone": "+551533276436",
"billing_address": "Rua Doutor Azevedo Sampaio",
"billing_number": "50",
"billing_floor": "",
"billing_locality": "Centro",
"billing_zipcode": "18010220",
"billing_city": "Sorocaba",
"billing_province": "São Paulo",
"billing_country": "BR",
"extra": {},
"total_spent": "27.00",
"total_spent_currency": "USD",
"last_order_id": 871254203,
"active": false,
"first_interaction": "2022-11-15T19:36:59+0000",
"created_at": "2022-11-15T19:36:59+0000",
"updated_at": "2022-11-15T19:36:59+0000"
},
"products": [
{
"id": 1069053829,
"depth": "0.00",
"height": "0.00",
"name": "Mesa de Roble",
"price": "6000.00",
"compare_at_price": "37.77",
"product_id": 111334785,
"image": {
"id": 277896749,
"product_id": 111334785,
"src": "https://d2r9epyceweg5n.cloudfront.net/stores/817/495/products/pexels-olya-prutskova-89764951-74e3f47763f1aec3ec16448436206687-1024-1024.jpg",
"position": 1,
"alt": [],
"created_at": "2022-02-14T13:00:03+0000",
"updated_at": "2022-10-28T21:52:37+0000"
},
"quantity": "1",
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": "426215948",
"variant_values": [],
"properties": [],
"sku": "12389012348124801234890",
"barcode": null
}
],
"number": 306,
"cancel_reason": null,
"owner_note": null,
"cancelled_at": null,
"closed_at": null,
"read_at": null,
"status": "open",
"payment_status": "pending",
"gateway_link": null,
"shipping_address": {
"address": "Evergreen Terrace",
"city": "New York",
"country": "US",
"created_at": "2022-11-15T19:23:59+0000",
"default": false,
"floor": "Apartment 8",
"id": 0,
"locality": "Bronx",
"name": "John Doe",
"number": "742",
"phone": "john.doe@example.com",
"province": "New York",
"updated_at": "2022-11-15T19:37:08+0000",
"zipcode": "10451",
"customs": null
},
"shipping_status": "unpacked",
"paid_at": null,
"client_details": {
"browser_ip": "181.16.41.4",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
},
"app_id": null
}
]

GET /orders?aggregates=fulfillment_orders

HTTP/1.1 200 OK

[
{
"id": 871254203,
"token": "b872a1befbcde5aaf0517ecbcc910f5dc005350e",
"store_id": "817495",
... // All fields from GET /orders are included in the response
"fulfillment_orders": [
{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"number": "123456",
"total_quantity": 12,
"total_weight": 12.12,
"total_price": {
"value": 123.45,
"currency": "BRL",
},
"assigned_location": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Location name",
"address": {
"zipcode": "12910802",
"street": "Some Street",
"number": "100",
"floor": "Some Floor",
"locality": "Some Locality",
"city": "Some City",
"reference": "Some Reference",
"between_streets": "Some Between Streets",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "Sudeste"
},
"country": {
"code": "BR",
"name": "Brasil"
}
}
},
"line_items": [
{
"id": "12345",
"quantity": 1,
"order_line_item_id": "12345678",
"created_at": "2022-11-24T10:20:19+00:00",
"updated_at": "2022-11-24T10:20:19+00:00"
}
],
"recipient": {
"name": "Recipient name",
"phone": "11988864311",
"identifier": "11223344B",
},
"shipping": {
"type": "pickup|ship",
"carrier": {
"name": "Some Carrier Name",
"id": "12345"
},
"option": {
"name": "Some Option Name",
"code": "some-option-code",
"reference": "some-option-ref"
},
"merchant_cost": {
"value": 123.14,
"currency": "BRL"
},
"consumer_cost": {
"value": 123.14,
"currency": "BRL"
},
"min_delivery_date": "2022-11-24T10:20:19+00:00" || null,
"max_delivery_date": "2022-11-25T10:20:19+00:00" || null,
"pickup_details": {
"id": "pickup-option-id",
"name": "Some option pickup detail name",
"address": {
"zipcode": "12910802",
"street": "Some Street",
"number": "100",
"floor": "Some Floor",
"locality": "Some Locality",
"city": "Some City",
"reference": "Some Reference",
"between_streets": "Some Between Streets",
"province": {
"name": "São Paulo",
"code": "SP"
},
"region": {
"name": "Sudeste",
"code": "SE"
},
"country": {
"name": "Brasil",
"code": "BR"
}
}
}
},
"destination": {
"zipcode": "12910802",
"street": "Some Street",
"number": "100",
"floor": "Some Floor",
"locality": "Some Locality",
"city": "Some City",
"reference": "Some Reference",
"between_streets": "Some Between Streets",
"province": {
"name": "São Paulo",
"code": "SP"
},
"region": {
"name": "Sudeste",
"code": "SE"
},
"country": {
"name": "Brasil",
"code": "BR"
}
},
"status": "PENDING",
"tracking_info": {
"url": null,
"code": null
},
"fulfilled_at": null,
"created_at": "2022-11-24T10:20:19+00:00",
"updated_at": "2022-11-24T10:20:19+00:00"
}]
}
]

GET /orders?fields=id,number,price_usd

HTTP/1.1 200 OK

[
{
"id": 450789469,
"number": "101",
"price_usd": "58.00"
}
]

GET /orders/{id}

Receive a single Order by its id.

If you would like to retrieve a Cart instead, refer to the Cart resource.

ParameterExplanation
fieldsComma-separated list of fields to include in the response
aggregatesOne possible value: fulfillment_orders. Enables an array called fulfillments that displays the information of the Fulfillment Order.

GET /orders/871254203

HTTP/1.1 200 OK

{
"id": 871254203,
"token": "b872a1befbcde5aaf0517ecbcc910f5dc005350e",
"store_id": "817495",
"contact_email": "buyer@tiendanube.com",
"contact_name": "Maria Silva",
"contact_phone": "+551533276436",
"contact_identification": "75839566500",
"billing_name": "Maria",
"billing_phone": "+551533276436",
"billing_address": "Rua Doutor Azevedo Sampaio",
"billing_number": "50",
"billing_floor": "",
"billing_locality": "Centro",
"billing_zipcode": "18010220",
"billing_city": "Sorocaba",
"billing_province": "São Paulo",
"billing_country": "BR",
"billing_customer_type": "company",
"billing_business_name": "Nuvem Shop LTDA",
"billing_trade_name": "Nuvem Shop",
"billing_state_registration": "388108598269",
"billing_fiscal_regime": "601",
"billing_invoice_use": "G01",
"billing_document_type": "cnpj",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": "871254203",
"created_at": "2022-11-15T19:37:08+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "6000.00",
"discount": "600.00",
"discount_coupon": "0.00",
"discount_gateway": "600.00",
"total": "5400.00",
"total_usd": "40.79",
"checkout_enabled": true,
"weight": "0.000",
"currency": "ARS",
"language": "es",
"gateway": "offline",
"gateway_id": null,
"gateway_name": "Transferencia Bancaria",
"extra": {},
"storefront": "store",
"note": "",
"created_at": "2022-11-15T19:36:59+0000",
"updated_at": "2022-11-15T19:37:08+0000",
"completed_at": {
"date": "2022-11-15 19:36:59.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": "custom",
"credit_card_company": null,
"installments": 1
},
"same_billing_and_shipping_address": false,
"attributes": [],
"customer": {
"id": 105799009,
"name": "Maria Silva",
"email": "buyer@tiendanube.com",
"identification": "75839566500",
"phone": "+551533276436",
"note": null,
"default_address": {
"address": "Evergreen Terrace",
"city": "New York",
"country": "US",
"created_at": "2022-11-15T19:36:59+0000",
"default": true,
"floor": "Apartment 8",
"id": 80189931,
"locality": "Bronx",
"name": "John Doe",
"number": "742",
"phone": "john.doe@example.com",
"province": "New York",
"updated_at": "2022-11-15T19:36:59+0000",
"zipcode": "10451"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "New York",
"country": "US",
"created_at": "2022-11-15T19:36:59+0000",
"default": true,
"floor": "Apartment 8",
"id": 80189931,
"locality": "Bronx",
"name": "John Doe",
"number": "742",
"phone": "john.doe@example.com",
"province": "New York",
"updated_at": "2022-11-15T19:36:59+0000",
"zipcode": "10451"
}
],
"billing_name": "Maria",
"billing_phone": "+551533276436",
"billing_address": "Rua Doutor Azevedo Sampaio",
"billing_number": "50",
"billing_floor": "",
"billing_locality": "Centro",
"billing_zipcode": "18010220",
"billing_city": "Sorocaba",
"billing_province": "São Paulo",
"billing_country": "BR",
"extra": {},
"total_spent": "27.00",
"total_spent_currency": "USD",
"last_order_id": 871254203,
"active": false,
"first_interaction": "2022-11-15T19:36:59+0000",
"created_at": "2022-11-15T19:36:59+0000",
"updated_at": "2022-11-15T19:36:59+0000"
},
"products": [
{
"id": 1069053829,
"depth": "0.00",
"height": "0.00",
"name": "Mesa de Roble",
"price": "6000.00",
"compare_at_price": "37.77",
"product_id": 111334785,
"image": {
"id": 277896749,
"product_id": 111334785,
"src": "https://d2r9epyceweg5n.cloudfront.net/stores/817/495/products/pexels-olya-prutskova-89764951-74e3f47763f1aec3ec16448436206687-1024-1024.jpg",
"position": 1,
"alt": [],
"created_at": "2022-02-14T13:00:03+0000",
"updated_at": "2022-10-28T21:52:37+0000"
},
"quantity": "1",
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": "426215948",
"variant_values": [],
"properties": [],
"sku": "12389012348124801234890",
"barcode": null
}
],
"number": 306,
"cancel_reason": null,
"owner_note": null,
"cancelled_at": null,
"closed_at": null,
"read_at": null,
"status": "open",
"payment_status": "pending",
"gateway_link": null,
"shipping_address": {
"address": "Evergreen Terrace",
"city": "New York",
"country": "US",
"created_at": "2022-11-15T19:23:59+0000",
"default": false,
"floor": "Apartment 8",
"id": 0,
"locality": "Bronx",
"name": "John Doe",
"number": "742",
"phone": "john.doe@example.com",
"province": "New York",
"updated_at": "2022-11-15T19:37:08+0000",
"zipcode": "10451",
"customs": null
},
"shipping_status": "unpacked",
"fulfillments": [],
"paid_at": null,
"client_details": {
"browser_ip": "181.16.41.4",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
},
"app_id": null
}

GET /orders/{id}/history/values

Receive a list of all Order's total value alterations.

Actions that may alter an Order's total are either editing or refunding an Order. Each modification carries the payment status associated to it, and while it may be related to a Transaction resource it doesn't require one (ie. Draft Orders will also generate this events even though they don't have a Transaction associated to them).

Important: you will see we sometimes refer to these modifications as "transactions". They are not to be confused with the Transaction resource from the Payments Domain, since these rely on a model that is not required for an Order to exist. While these internal transactions might trigger the creation of a new Transaction and therefore have a connection to it, they don't require it. For now, we are not creating Transaction resources beyond the initial one an Order might have when it is created.

ParameterExplanation
statusThe payment status of the Order's value transaction. Possible values are "PENDING", "CANCELLED" or "PAID". Note that if the transaction was not paid and it changes again (ie. an Order with a Pending payment is edited) then the corresponding entry will be marked as "CANCELLED", so "PENDING" is only possible for the most recent value in the history. Also, note that "PAID" in this context might mean that either the Customer or the Merchant paid it, depending of if the total_paid_diff is positive (Customer paid it) or negative (Merchat paid it, it is a partial or full refund).
total_deltaThe difference between the previous Order value and the new one.
total_paid_diffThe amount the Customer / Merchant paid in that Order's transaction state. Note that this value does not have a 1 to 1 correlation to total_delta, it can be higher or lower depending on the aggregate of previous transactions that were never paid. This value is only non-zero if the status is "PAID".
gateway_methodThe gateway / payment method the Customer / Merchant used to pay or refund the transaction. Possible values are "credit_card", "debit_card", "cash", "wire_transfer", "pix" or "other".
gateway_nameWhen "other" value is given for gateway_method, this field includes a human-readable custom name for the gateway. Otherwise, null is returned.
closed_atDatetime at which the transaciton transitioned to a final state (from "PENDING" to another state).
happened_atDatetime at which the Order's total modification happened.

HTTP/1.1 200 OK

[
{
"status": "CANCELLED",
"total_delta": 3750,
"total_paid_diff": 0,
"gateway_method": null,
"gateway_name": null,
"closed_at": "2025-04-08T18:19:40+00:00",
"happened_at": "2025-04-08T18:19:15+00:00"
},
{
"status": "PAID",
"total_delta": 3750,
"total_paid_diff": 7500,
"gateway_method": "cash",
"gateway_name": null,
"closed_at": "2025-04-08T18:24:15+0000",
"happened_at": "2025-04-08T18:19:40+00:00"
}
]

GET /orders/{id}/history/editions

Receive a list of all Order's editions.

This is intended as a small change log for the changes that an edition made. Actual changed information will be overwritten in the original Orders' fields.

ParameterExplanation
product_changesContains information about the changes made to the products in the edition.
shipping_costsContains information about the changes in Shipping costs derived from the products changes.
transaction_informationContains information about the related transaction that the edition generated in the Order. See here for object contents reference.
reasonHuman-readable text detailing why the edition was made, typically filled out by the Merchant.
happened_atDatetime at which the Order's edition happened.

Objects

Product Change

ValueDescription
type"ADD" if the product was added, "REMOVED" if it was removed from the Order. This is only the action, for the quantity added or removed see the quantity properties.
modified_stockIndicates if the stock was modified or not.
previous_quantityThe line item quantity before the edition.
new_quantityThe line item quantity after the edition.
product_nameThe name of the line item that was modified.

Shipping Cost

ValueDescription
fulfillment_numberThe number of the Fulfillment Order related to the shipping cost.
previous_merchant_costThe previous Shipping cost for the Merchant.
new_merchant_costThe new Shipping cost for the Merchant.
previous_consumer_costThe previous Shipping cost for the Customer.
new_consumer_costThe new Shipping cost for the Customer.

HTTP/1.1 200 OK

[
{
"product_changes": [
{
"type": "ADD",
"modified_stock": true,
"previous_quantity": 0,
"new_quantity": 1,
"product_name": "Pantalon de cuero (Beige)"
}
],
"shipping_costs": [
{
"fulfillment_number": 1,
"previous_merchant_cost": 200,
"new_merchant_cost": 500,
"previous_consumer_cost": 200,
"new_consumer_cost": 500
}
],
"transaction_information": {
"status": "CANCELLED",
"total_delta": 3750,
"total_paid_diff": 0,
"gateway_method": null,
"gateway_name": null,
"closed_at": null,
"happened_at": "2025-04-08T18:19:15+00:00"
},
"reason": null,
"happened_at": "2025-04-08T18:19:15+00:00"
},
{
"product_changes": [
{
"type": "ADD",
"modified_stock": true,
"previous_quantity": 1,
"new_quantity": 2,
"product_name": "Pantalon de cuero (Beige)"
}
],
"shipping_costs": [
{
"fulfillment_number": 1,
"previous_merchant_cost": 500,
"new_merchant_cost": 500,
"previous_consumer_cost": 500,
"new_consumer_cost": 500
}
],
"transaction_information": {
"status": "PAID",
"total_delta": 3750,
"total_paid_diff": 7500,
"gateway_method": "cash",
"gateway_name": null,
"closed_at": "2025-04-08T18:24:15+0000",
"happened_at": "2025-04-08T18:19:40+00:00"
},
"reason": null,
"happened_at": "2025-04-08T18:19:40+00:00"
}
]

POST /orders/

Create an Order.

ParameterDescriptionRequired
currencyThe order currency code (ISO 4217 format). The default is the store currency.No
languageThe language code (ISO 639-1 format). The default is the store main language.No
gatewayThe order's payment gateway (Payment Gateway). The default is not-provided.Yes
payment_statusThe order's payment status (Payment Status). The default is pending.No
statusThe order's status (Order Status). The default is open.No
fulfillmentThe order's status (Order Status). The default is unpacked.No
productsOrder's products list (Product).Yes
totalThe sum of all products prices, shipping costs and discounts. Must be positive. If not specified, it's calculated considering the provided costs and discounts.No
inventory_behaviourThe inventory behaviour that the order must perform (Inventory Behaviour).No
customerThe customer object (Customer).Yes
noteAn additional customer note for the order.No
billing_addressThe customer's billing address object (Address).Yes
shipping_addressThe customer's shipping address object (Address).Yes
shipping_pickup_typeThe shipping pickup type (Shipping Type). The default is pickup.Yes
shippingThe shipping method (Shipping Method). The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).Yes
shipping_optionThe order's shipping option nice name. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).Yes
shipping_tracking_numberThe order's shipping tracking numberNo
shipping_cost_customerThe customer's shipping cost double value. The value 0 means free shipping. The default is 0.Yes
shipping_cost_ownerThe owner's shipping cost double value.No
send_confirmation_emailSend the order confirmation email to the customer . The default is false.No
send_fulfillment_emailSend the order fulfillment email to the customer . The default is false.No
location_idLocation id from where the stock will be decreased . Must be string.No

Objects

Customer

ValueDescriptionTypeRequired
nameThe customer's name. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
emailThe customer's email address. The defaults are email@naoinformado.com for pt_BR and email@noinformado.com in every other cases (es_AR, es_MX, es_CO).E-mailYes
phoneThe customer's phone numberStringNo
documentThe customer's document numberStringNo

Address

ValueDescriptionTypeRequired
first_nameThe customer's first name. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
last_nameThe customer's last name. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
addressThe customer's street. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
numberThe address's number. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
floorThe address's complement. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringNo
localityThe address's locality. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringNo
cityThe address's city. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
provinceThe address's province. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
zipcodeThe address's postal code. The default is 0000.StringYes
countryThe address's country (ISO 3166-1 Format). The default is the store country.StringYes
phoneThe address's phone number.StringNo

Shipping_Address

ValueDescriptionTypeRequired
first_nameThe customer's first name. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
last_nameThe customer's last name. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
addressThe customer's street. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
numberThe shipping_address number. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
floorThe shipping_address complement. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringNo
localityThe shipping_address locality. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringNo
cityThe shipping_address city. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
provinceThe shipping_address province. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringYes
zipcodeThe shipping_address postal code. The default is 0000.StringYes
countryThe shipping_address country (ISO 3166-1 Format). The default is the store country.StringYes
phoneThe shipping_address phone number. The defaults are Não informado for pt_BR and No informado in every other cases (es_AR, es_MX, es_CO).StringNo
customsThe customs fields of the shipping address. this field can receive any custom value within the object. The default is nullObjectNo

Product

ValueDescriptionTypeRequired
variant_idThe product variant IDIntegerYes
quantityThe product quantityIntegerYes
priceThe item price. Defaults to tiendanube's product variant price.DoubleNo

Order Status

ValueDescription
openThe order is open
closedThe order is closed
cancelledThe order is cancelled

Payment Status

ValueDescription
pendingThe payment confirmation is pending
authorizedThe payment was authorized but not captured yet
paidThe payment was successfully confirmed and captured
voidedThe payment confirmation is voided
refundedThe payment was refunded to the customer
abandonedThe payment confirmation is abandoned

Payment Gateway

ValueDescription
offlineOffline payment gateway
mercadopagoMercado Pago
pagseguroPagSeguro
payuPayu
not-providedThe payment gateway is not provided

Shipping Type

ValueDescription
shipHome delivery
pickupPickup in a physical location

Shipping Method

ValueDescription
branchStore branches
correiosBrazilian Correios
correo-argentinoCorreo Argentino
oca-partner-arOCA
tableCustom
not-providedThe shipping method was not provided

Inventory Behaviour

ValueDescription
bypassDo not claim inventory (default)
claimAttempt to claim inventory, it could prevent order creation

Billing Fiscal Regime

The Billing Fiscal Regime is only used in es_MX (Régimen fiscal).

ValueDescription
601General de Ley Personas Morales (default)
603Personas Morales con Fines no Lucrativos
610Residentes en el Extranjero sin Establecimiento Permanente en México
620Sociedades Cooperativas de Producción que optan por diferir sus ingresos
622Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras
623Opcional para Grupos de Sociedades
624Attempt to claim inventory, it could prevent order creation
626Régimen Simplificado de Confianza

Billing Invoice Use

The Billing Invoice Use is only used in es_MX (Uso de factura).

ValueDescription
G01General de Ley Personas Morales (default)
G02Devoluciones, descuentos o bonificaciones
G03Gastos en general
I01Construcciones
I02Mobiliario y equipo de oficina por inversiones
I03Equipo de transporte
I04Equipo de computo y accesorios
I05Dados, troqueles, moldes, matrices y herramental
I06Comunicaciones telefónicas
I07Comunicaciones satelitales
I08Otra maquinaria y equipo
S01Sin efectos fiscales
CP01Pagos

POST /orders/

HTTP/1.1 201 Created

{
"id": 871310835,
"token": "d928449fdd060fb7f3854c681923c28cfbccbcc1",
"store_id": 817495,
"contact_email": "john.doe@example.com",
"contact_name": "John Doe",
"contact_phone": "+55 11 99999-9999",
"contact_identification": null,
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": 871310835,
"created_at": "2022-11-15T19:47:32+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "80.00",
"discount": "0.00",
"discount_coupon": "0.00",
"discount_gateway": "0.00",
"total": "80.00",
"total_usd": "80.00",
"checkout_enabled": true,
"weight": "0.000",
"currency": "USD",
"language": "es",
"gateway": "not-provided",
"gateway_id": null,
"gateway_name": "",
"extra": {},
"storefront": "api",
"note": null,
"created_at": "2022-11-15T19:47:32+0000",
"updated_at": "2022-11-15T19:47:32+0000",
"completed_at": {
"date": "2022-11-15 19:47:32.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": null,
"credit_card_company": null,
"installments": 1
},
"attributes": [],
"customer": {
"id": 44769493,
"name": "John Doe",
"email": "john.doe@example.com",
"identification": null,
"phone": "+55 11 99999-9999",
"note": null,
"default_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": null,
"created_at": "2020-09-11T18:06:09+0000",
"default": false,
"floor": "",
"id": 28900058,
"locality": "",
"name": "John Doe",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2020-09-11T18:06:09+0000",
"zipcode": "97475"
},
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-15T18:55:48+0000",
"default": false,
"floor": null,
"id": 52249003,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-15T18:55:48+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-24T14:01:01+0000",
"default": false,
"floor": null,
"id": 52781492,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-24T14:01:01+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
{
"address": "Fake Street",
"city": "Rosario",
"country": "AR",
"created_at": "2021-09-27T15:39:31+0000",
"default": false,
"floor": "",
"id": 52933588,
"locality": "",
"name": "John Doe",
"number": "123",
"phone": "+55 11 99999-9999",
"province": "Santa Fe",
"updated_at": "2021-09-27T15:39:31+0000",
"zipcode": "2000"
},
{
"address": null,
"city": null,
"country": "AR",
"created_at": "2021-09-27T15:43:15+0000",
"default": false,
"floor": null,
"id": 52933858,
"locality": null,
"name": "John Doe",
"number": null,
"phone": "+55 11 99999-9999",
"province": null,
"updated_at": "2021-09-27T15:43:15+0000",
"zipcode": null
}
],
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"extra": {},
"total_spent": "187.50",
"total_spent_currency": "USD",
"last_order_id": 871310835,
"active": false,
"first_interaction": "2022-11-15T19:47:32+0000",
"created_at": "2020-09-11T18:06:09+0000",
"updated_at": "2022-11-15T19:47:32+0000"
},
"products": [
{
"id": 1069079649,
"depth": "0.00",
"height": "0.00",
"name": "Producto B",
"price": "40.00",
"compare_at_price": "40.00",
"product_id": 63021345,
"image": {
"id": 0,
"product_id": 0,
"src": "https://d2r9epyceweg5n.cloudfront.net/assets/stores/img/no-photo-1024-1024.png",
"position": 0,
"alt": [],
"created_at": "2022-11-15T19:47:33+0000",
"updated_at": "2022-11-15T19:47:33+0000"
},
"quantity": 2,
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": 194113141,
"variant_values": [],
"properties": [],
"sku": null,
"barcode": null
}
],
"number": 307,
"cancel_reason": null,
"owner_note": null,
"cancelled_at": null,
"closed_at": null,
"read_at": null,
"status": "open",
"payment_status": "pending",
"gateway_link": null,
"shipping_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2022-11-15T19:47:32+0000",
"default": false,
"floor": "No informado",
"id": 0,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2022-11-15T19:47:32+0000",
"zipcode": "0000",
"customs": null
},
"shipping_status": "unpacked",
"paid_at": null,
"client_details": {
"browser_ip": null,
"user_agent": null
},
"app_id": 2181
}

PUT /orders/{id}

Change an Order's attributes (just owner_note for now) and/or update an Order's status

PUT /orders/871310835

{
"owner_note": "Need to gift wrap this order",
"status": "closed"
}

HTTP/1.1 200 OK

{
"id": 871310835,
"token": "d928449fdd060fb7f3854c681923c28cfbccbcc1",
"store_id": 817495,
"contact_email": "john.doe@example.com",
"contact_name": "John Doe",
"contact_phone": "+55 11 99999-9999",
"contact_identification": null,
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": 871310835,
"created_at": "2022-11-15T19:49:48+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "80.00",
"discount": "0.00",
"discount_coupon": "0.00",
"discount_gateway": "0.00",
"total": "80.00",
"total_usd": "80.00",
"checkout_enabled": true,
"weight": "0.000",
"currency": "USD",
"language": "es",
"gateway": "not-provided",
"gateway_id": null,
"gateway_name": "",
"shipping_pickup_type": "pickup",
"extra": {},
"storefront": "api",
"note": null,
"created_at": "2022-11-15T19:47:32+0000",
"updated_at": "2022-11-15T19:49:48+0000",
"completed_at": {
"date": "2022-11-15 19:47:32.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": null,
"credit_card_company": null,
"installments": 1
},
"attributes": [],
"customer": {
"id": 44769493,
"name": "John Doe",
"email": "john.doe@example.com",
"identification": null,
"phone": "+55 11 99999-9999",
"note": null,
"default_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": null,
"created_at": "2020-09-11T18:06:09+0000",
"default": false,
"floor": "",
"id": 28900058,
"locality": "",
"name": "John Doe",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2020-09-11T18:06:09+0000",
"zipcode": "97475"
},
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-15T18:55:48+0000",
"default": false,
"floor": null,
"id": 52249003,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-15T18:55:48+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-24T14:01:01+0000",
"default": false,
"floor": null,
"id": 52781492,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-24T14:01:01+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
{
"address": "Fake Street",
"city": "Rosario",
"country": "AR",
"created_at": "2021-09-27T15:39:31+0000",
"default": false,
"floor": "",
"id": 52933588,
"locality": "",
"name": "John Doe",
"number": "123",
"phone": "+55 11 99999-9999",
"province": "Santa Fe",
"updated_at": "2021-09-27T15:39:31+0000",
"zipcode": "2000"
},
{
"address": null,
"city": null,
"country": "AR",
"created_at": "2021-09-27T15:43:15+0000",
"default": false,
"floor": null,
"id": 52933858,
"locality": null,
"name": "John Doe",
"number": null,
"phone": "+55 11 99999-9999",
"province": null,
"updated_at": "2021-09-27T15:43:15+0000",
"zipcode": null
}
],
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"extra": {},
"total_spent": "187.50",
"total_spent_currency": "USD",
"last_order_id": 871310835,
"active": false,
"first_interaction": "2022-11-15T19:47:32+0000",
"created_at": "2020-09-11T18:06:09+0000",
"updated_at": "2022-11-15T19:47:32+0000"
},
"products": [
{
"id": 1069079649,
"depth": "0.00",
"height": "0.00",
"name": "Producto B",
"price": "40.00",
"compare_at_price": "40.00",
"product_id": 63021345,
"image": {
"id": 0,
"product_id": 0,
"src": "https://d2r9epyceweg5n.cloudfront.net/assets/stores/img/no-photo-1024-1024.png",
"position": 0,
"alt": [],
"created_at": "2022-11-15T19:49:48+0000",
"updated_at": "2022-11-15T19:49:48+0000"
},
"quantity": 2,
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": 194113141,
"variant_values": [],
"properties": [],
"sku": null,
"barcode": null
}
],
"number": 307,
"cancel_reason": null,
"owner_note": "Need to gift wrap this order",
"cancelled_at": null,
"closed_at": "2022-11-15T19:49:48+0000",
"read_at": null,
"status": "closed",
"payment_status": "paid",
"gateway_link": null,
"shipping_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2022-11-15T19:47:32+0000",
"default": false,
"floor": "No informado",
"id": 0,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2022-11-15T19:49:48+0000",
"zipcode": "0000",
"customs": null
},
"shipping_status": "unpacked",
"paid_at": "2022-11-15T19:48:39+0000",
"client_details": {
"browser_ip": null,
"user_agent": null
},
"app_id": 2181
}

Pay an Order

In fact, there is no action to pay an order. Orders are paid when sending a Transaction with status success, regardless of the event (sale or capture).

After payment, two order's attributes get modified: attribute payment_status receives "paid" and attribute paid_at receives the exact time the payment was processed.

{
"payment_status": "paid",
"paid_at": "2022-11-07T12:17:22+0000"
}

POST /orders/{id}/close

Close an Order

POST /orders/871310835/close

HTTP/1.1 200 OK

{
"id": 871310835,
"token": "d928449fdd060fb7f3854c681923c28cfbccbcc1",
"store_id": 817495,
"contact_email": "john.doe@example.com",
"contact_name": "John Doe",
"contact_phone": "+55 11 99999-9999",
"contact_identification": null,
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": 871310835,
"created_at": "2022-11-15T19:51:59+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "80.00",
"discount": "0.00",
"discount_coupon": "0.00",
"discount_gateway": "0.00",
"total": "80.00",
"total_usd": "80.00",
"checkout_enabled": true,
"weight": "0.000",
"currency": "USD",
"language": "es",
"gateway": "not-provided",
"gateway_id": null,
"gateway_name": "",
"extra": {},
"storefront": "api",
"note": null,
"created_at": "2022-11-15T19:47:32+0000",
"updated_at": "2022-11-15T19:51:59+0000",
"completed_at": {
"date": "2022-11-15 19:47:32.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": null,
"credit_card_company": null,
"installments": 1
},
"attributes": [],
"customer": {
"id": 44769493,
"name": "John Doe",
"email": "john.doe@example.com",
"identification": null,
"phone": "+55 11 99999-9999",
"note": null,
"default_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": null,
"created_at": "2020-09-11T18:06:09+0000",
"default": false,
"floor": "",
"id": 28900058,
"locality": "",
"name": "John Doe",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2020-09-11T18:06:09+0000",
"zipcode": "97475"
},
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-15T18:55:48+0000",
"default": false,
"floor": null,
"id": 52249003,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-15T18:55:48+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-24T14:01:01+0000",
"default": false,
"floor": null,
"id": 52781492,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-24T14:01:01+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
{
"address": "Fake Street",
"city": "Rosario",
"country": "AR",
"created_at": "2021-09-27T15:39:31+0000",
"default": false,
"floor": "",
"id": 52933588,
"locality": "",
"name": "John Doe",
"number": "123",
"phone": "+55 11 99999-9999",
"province": "Santa Fe",
"updated_at": "2021-09-27T15:39:31+0000",
"zipcode": "2000"
},
{
"address": null,
"city": null,
"country": "AR",
"created_at": "2021-09-27T15:43:15+0000",
"default": false,
"floor": null,
"id": 52933858,
"locality": null,
"name": "John Doe",
"number": null,
"phone": "+55 11 99999-9999",
"province": null,
"updated_at": "2021-09-27T15:43:15+0000",
"zipcode": null
}
],
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"extra": {},
"total_spent": "187.50",
"total_spent_currency": "USD",
"last_order_id": 871310835,
"active": false,
"first_interaction": "2022-11-15T19:47:32+0000",
"created_at": "2020-09-11T18:06:09+0000",
"updated_at": "2022-11-15T19:47:32+0000"
},
"products": [
{
"id": 1069079649,
"depth": "0.00",
"height": "0.00",
"name": "Producto B",
"price": "40.00",
"compare_at_price": "40.00",
"product_id": 63021345,
"image": {
"id": 0,
"product_id": 0,
"src": "https://d2r9epyceweg5n.cloudfront.net/assets/stores/img/no-photo-1024-1024.png",
"position": 0,
"alt": [],
"created_at": "2022-11-15T19:51:59+0000",
"updated_at": "2022-11-15T19:51:59+0000"
},
"quantity": 2,
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": 194113141,
"variant_values": [],
"properties": [],
"sku": null,
"barcode": null
}
],
"number": 307,
"cancel_reason": null,
"owner_note": "Need to gift wrap this order",
"cancelled_at": null,
"closed_at": "2022-11-15T19:51:59+0000",
"read_at": null,
"status": "closed",
"payment_status": "paid",
"gateway_link": null,
"shipping_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2022-11-15T19:47:32+0000",
"default": false,
"floor": "No informado",
"id": 0,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2022-11-15T19:51:59+0000",
"zipcode": "0000",
"customs": null
},
"shipping_status": "unpacked",
"paid_at": "2022-11-15T19:48:39+0000",
"client_details": {
"browser_ip": null,
"user_agent": null
},
"app_id": 2181
}

POST /orders/{id}/open

Re-open a closed Order

POST /orders/871310835/open

HTTP/1.1 200 OK

{
"id": 871310835,
"token": "d928449fdd060fb7f3854c681923c28cfbccbcc1",
"store_id": 817495,
"contact_email": "john.doe@example.com",
"contact_name": "John Doe",
"contact_phone": "+55 11 99999-9999",
"contact_identification": null,
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": 871310835,
"created_at": "2022-11-15T19:52:37+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "80.00",
"discount": "0.00",
"discount_coupon": "0.00",
"discount_gateway": "0.00",
"total": "80.00",
"total_usd": "80.00",
"checkout_enabled": true,
"weight": "0.000",
"currency": "USD",
"language": "es",
"gateway": "not-provided",
"gateway_id": null,
"gateway_name": "",
"extra": {},
"storefront": "api",
"note": null,
"created_at": "2022-11-15T19:47:32+0000",
"updated_at": "2022-11-15T19:52:37+0000",
"completed_at": {
"date": "2022-11-15 19:47:32.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": null,
"credit_card_company": null,
"installments": 1
},
"attributes": [],
"customer": {
"id": 44769493,
"name": "John Doe",
"email": "john.doe@example.com",
"identification": null,
"phone": "+55 11 99999-9999",
"note": null,
"default_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": null,
"created_at": "2020-09-11T18:06:09+0000",
"default": false,
"floor": "",
"id": 28900058,
"locality": "",
"name": "John Doe",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2020-09-11T18:06:09+0000",
"zipcode": "97475"
},
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-15T18:55:48+0000",
"default": false,
"floor": null,
"id": 52249003,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-15T18:55:48+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-24T14:01:01+0000",
"default": false,
"floor": null,
"id": 52781492,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-24T14:01:01+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
{
"address": "Fake Street",
"city": "Rosario",
"country": "AR",
"created_at": "2021-09-27T15:39:31+0000",
"default": false,
"floor": "",
"id": 52933588,
"locality": "",
"name": "John Doe",
"number": "123",
"phone": "+55 11 99999-9999",
"province": "Santa Fe",
"updated_at": "2021-09-27T15:39:31+0000",
"zipcode": "2000"
},
{
"address": null,
"city": null,
"country": "AR",
"created_at": "2021-09-27T15:43:15+0000",
"default": false,
"floor": null,
"id": 52933858,
"locality": null,
"name": "John Doe",
"number": null,
"phone": "+55 11 99999-9999",
"province": null,
"updated_at": "2021-09-27T15:43:15+0000",
"zipcode": null
}
],
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"extra": {},
"total_spent": "187.50",
"total_spent_currency": "USD",
"last_order_id": 871310835,
"active": false,
"first_interaction": "2022-11-15T19:47:32+0000",
"created_at": "2020-09-11T18:06:09+0000",
"updated_at": "2022-11-15T19:47:32+0000"
},
"products": [
{
"id": 1069079649,
"depth": "0.00",
"height": "0.00",
"name": "Producto B",
"price": "40.00",
"compare_at_price": "40.00",
"product_id": 63021345,
"image": {
"id": 0,
"product_id": 0,
"src": "https://d2r9epyceweg5n.cloudfront.net/assets/stores/img/no-photo-1024-1024.png",
"position": 0,
"alt": [],
"created_at": "2022-11-15T19:52:37+0000",
"updated_at": "2022-11-15T19:52:37+0000"
},
"quantity": 2,
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": 194113141,
"variant_values": [],
"properties": [],
"sku": null,
"barcode": null
}
],
"number": 307,
"cancel_reason": null,
"owner_note": "Need to gift wrap this order",
"cancelled_at": null,
"closed_at": null,
"read_at": null,
"status": "open",
"payment_status": "paid",
"gateway_link": null,
"shipping_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2022-11-15T19:47:32+0000",
"default": false,
"floor": "No informado",
"id": 0,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2022-11-15T19:52:37+0000",
"zipcode": "0000",
"customs": null
},
"shipping_status": "unpacked",
"paid_at": "2022-11-15T19:48:39+0000",
"client_details": {
"browser_ip": null,
"user_agent": null
},
"app_id": 2181
}

POST /orders/{id}/cancel

Cancel an Order

ParameterExplanation
reasonThe reason for the order cancellation. Possible values are "customer", "inventory", "fraud" or "other"
emailNotify the customer of the cancellation (the default value is true)
restockRestock the store's products (the default value is true)

POST /orders/871310835/cancel

HTTP/1.1 200 OK

{
"id": 871310835,
"token": "d928449fdd060fb7f3854c681923c28cfbccbcc1",
"store_id": 817495,
"contact_email": "john.doe@example.com",
"contact_name": "John Doe",
"contact_phone": "+55 11 99999-9999",
"contact_identification": null,
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"coupon": [],
"promotional_discount": {
"id": null,
"store_id": 817495,
"order_id": 871310835,
"created_at": "2022-11-15T19:52:37+0000",
"total_discount_amount": "0.00",
"contents": [],
"promotions_applied": []
},
"subtotal": "80.00",
"discount": "0.00",
"discount_coupon": "0.00",
"discount_gateway": "0.00",
"total": "80.00",
"total_usd": "80.00",
"checkout_enabled": true,
"weight": "0.000",
"currency": "USD",
"language": "es",
"gateway": "not-provided",
"gateway_id": null,
"gateway_name": "",
"extra": {},
"storefront": "api",
"note": null,
"created_at": "2022-11-15T19:47:32+0000",
"updated_at": "2022-11-15T19:52:37+0000",
"completed_at": {
"date": "2022-11-15 19:47:32.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"payment_details": {
"method": null,
"credit_card_company": null,
"installments": 1
},
"attributes": [],
"customer": {
"id": 44769493,
"name": "John Doe",
"email": "john.doe@example.com",
"identification": null,
"phone": "+55 11 99999-9999",
"note": null,
"default_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
"addresses": [
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": null,
"created_at": "2020-09-11T18:06:09+0000",
"default": false,
"floor": "",
"id": 28900058,
"locality": "",
"name": "John Doe",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2020-09-11T18:06:09+0000",
"zipcode": "97475"
},
{
"address": "Evergreen Terrace",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-15T18:55:48+0000",
"default": false,
"floor": null,
"id": 52249003,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-15T18:55:48+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "Springfield",
"country": "US",
"created_at": "2021-09-24T14:01:01+0000",
"default": false,
"floor": null,
"id": 52781492,
"locality": null,
"name": "No informado No informado",
"number": "742",
"phone": "5551230413",
"province": "Oregon",
"updated_at": "2021-09-24T14:01:01+0000",
"zipcode": "97475"
},
{
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2021-09-24T14:02:57+0000",
"default": true,
"floor": "No informado",
"id": 52781637,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2021-09-24T14:02:57+0000",
"zipcode": "0000"
},
{
"address": "Fake Street",
"city": "Rosario",
"country": "AR",
"created_at": "2021-09-27T15:39:31+0000",
"default": false,
"floor": "",
"id": 52933588,
"locality": "",
"name": "John Doe",
"number": "123",
"phone": "+55 11 99999-9999",
"province": "Santa Fe",
"updated_at": "2021-09-27T15:39:31+0000",
"zipcode": "2000"
},
{
"address": null,
"city": null,
"country": "AR",
"created_at": "2021-09-27T15:43:15+0000",
"default": false,
"floor": null,
"id": 52933858,
"locality": null,
"name": "John Doe",
"number": null,
"phone": "+55 11 99999-9999",
"province": null,
"updated_at": "2021-09-27T15:43:15+0000",
"zipcode": null
}
],
"billing_name": "John",
"billing_phone": "51230413",
"billing_address": "Evergreen Terrace",
"billing_number": "742",
"billing_floor": "Apartment 8",
"billing_locality": "Bronx",
"billing_zipcode": "10451",
"billing_city": "New York",
"billing_province": "New York",
"billing_country": "US",
"extra": {},
"total_spent": "187.50",
"total_spent_currency": "USD",
"last_order_id": 871310835,
"active": false,
"first_interaction": "2022-11-15T19:47:32+0000",
"created_at": "2020-09-11T18:06:09+0000",
"updated_at": "2022-11-15T19:47:32+0000"
},
"products": [
{
"id": 1069079649,
"depth": "0.00",
"height": "0.00",
"name": "Producto B",
"price": "40.00",
"compare_at_price": "40.00",
"product_id": 63021345,
"image": {
"id": 0,
"product_id": 0,
"src": "https://d2r9epyceweg5n.cloudfront.net/assets/stores/img/no-photo-1024-1024.png",
"position": 0,
"alt": [],
"created_at": "2022-11-15T19:52:37+0000",
"updated_at": "2022-11-15T19:52:37+0000"
},
"quantity": 2,
"free_shipping": false,
"weight": "0.00",
"width": "0.00",
"variant_id": 194113141,
"variant_values": [],
"properties": [],
"sku": null,
"barcode": null
}
],
"number": 307,
"cancel_reason": "other",
"owner_note": "Need to gift wrap this order",
"cancelled_at": "2022-11-15T19:57:42+0000",
"closed_at": null,
"read_at": null,
"status": "cancelled",
"payment_status": "paid",
"gateway_link": null,
"shipping_address": {
"address": "No informado",
"city": "No informado",
"country": "AR",
"created_at": "2022-11-15T19:47:32+0000",
"default": false,
"floor": "No informado",
"id": 0,
"locality": "No informado",
"name": "No informado No informado",
"number": "No informado",
"phone": "No informado",
"province": "No informado",
"updated_at": "2022-11-15T19:52:37+0000",
"zipcode": "0000",
"customs": null
},
"shipping_status": "unpacked",
"paid_at": "2022-11-15T19:48:39+0000",
"client_details": {
"browser_ip": null,
"user_agent": null
},
"app_id": 2181
}

Invoices (e.g. NFe in Brazil)

We currently do not offer an Invoice API, but there are many apps which need to read and/or write invoice information. The way to achieve this is using Metafields.

The advantage of using Metafields is that a certain app could generate the invoice and another app can read it. Let's take a real Brazilian example: an ERP can generate the nota fiscal (NFe) and a Shipping Carrier can use that NFe to fulfill a shipment.

Create an invoice

An Order may have more than one invoice, so we will have a Metafield that holds a list of invoices. It's the responsbility of invoice producers to make sure this format is maintained when new invoices are added.

When adding a new invoice you have to append it to the list of NFEs adding both the NFe key (generated when created) and the link to the NFe XML and an optional fulfillment_order_id specifying the Fulfillment Order the NFe applies to. The value of the metafields holds a json encoded string representation of the NFEs' list; the list is an array of object that have key and link properties. The value of owner_id should hold the Order id.

Example: let's say we want to add a new NFe with key 55555555555555555555555555555 and link http://nfe.com.br/nsaasb assigned to the Fulfillment Order with id 01FHZXHK8PTP9FVK99Z66GXASS.

To make sure other apps can read the invoice you create, please use this example as-is.

First we have to check if the NFe metafield already exists.

GET /metafields/orders?per_page=1&owner_id=ORDER_ID&namespace=nfe&key=list&fields=id,value

This will return an empty array if the NFe metafield does not exist.

HTTP/1.1 200 OK

[]

or an aray with one object with the id and value in case it exists.

HTTP/1.1 200 OK

[
{
"id": 12345,
"value": "[{\"key\": \"44444444444444444444444444444\", \"link\": \"http://nfe.com.br/nsaasa\", \"fulfillment_order_id\": \"01FHZXHK8PTP9FVK99Z66GXASS\"}]",
}
]
If the NFe list metafield does not exist

We need to create a new metafield. Please note that value is a JSON encoded string so for it to be valid JSON all double quotes must be escaped.

POST /metafields

{
"namespace": "nfe",
"key": "list",
"value": "[{\"key\": \"55555555555555555555555555555\", \"link\": \"http://nfe.com.br/nsaasb\", \"fulfillment_order_id\": \"01FHZXHK8PTP9FVK99Z66GXASS\"}]",
"description": "Lista de NFes",
"owner_resource": "Order",
"owner_id": 12345678
}

HTTP/1.1 201 Created

{
"id": 12345,
"namespace": "nfe",
"key": "link",
"value": "[{\"key\": \"55555555555555555555555555555\", link: \"http://nfe.com.br/nsaasb\", \"fulfillment_order_id\": \"01FHZXHK8PTP9FVK99Z66GXASS\"}]",
"description": "Lista de NFes",
"owner_resource": "Order",
"owner_id": 12345678,
"created_at": "2015-01-02 20:27:51",
"updated_at": "2015-01-02 20:27:51",
"deleted_at": null
}
If the NFe list metafield already existed

We now have to append our NFe to the existing array and update the metafield using the metafield id.

PUT /metafields/METAFIELD_ID

{
"value": "[{\"key\": \"44444444444444444444444444444\", \"link\": \"http://nfe.com.br/nsaasa\", \"fulfillment_order_id\": \"01FHZXHK8PTP9FVK99Z66GXASS\"}, {\"key\": \"55555555555555555555555555555\", \"link\": \"http://nfe.com.br/nsaasb\", \"fulfillment_order_id\": \"01ARZ3NDEKTSV4RRFFQ69G5FAV\"}]"
}

HTTP/1.1 200 OK

{
"id": 12345,
"namespace": "nfe",
"key": "list",
"value": "[{\"key\": \"44444444444444444444444444444\", \"link\": \"http://nfe.com.br/nsaasa\", \"fulfillment_order_id\": \"01FHZXHK8PTP9FVK99Z66GXASS\"}, {\"key\": \"55555555555555555555555555555\", \"link\": \"http://nfe.com.br/nsaasb\", \"fulfillment_order_id\": \"01ARZ3NDEKTSV4RRFFQ69G5FAV\"}]",
"description": "Lista de NFes",
"owner_resource": "Order",
"owner_id": 12345678,
"created_at": "2015-01-02 20:27:51",
"updated_at": "2015-01-05 18:15:40",
"deleted_at": null
}

Please take into account that JSON arrays do not allow trailing commas.

Read an invoice

To read an invoice we need to search for the previously created metafield holding the invoice.

GET /metafields/orders?per_page=1&owner_id=ORDER_ID&namespace=nfe&key=list&fields=value

HTTP/1.1 200 OK

[
{
"value": "[{\"key\": \"44444444444444444444444444444\", \"link\": \"http://nfe.com.br/nsaasa\", \"fulfillment_order_id\": \"01FHZXHK8PTP9FVK99Z66GXASS\"}, {\"key\": \"55555555555555555555555555555\", \"link\": \"http://nfe.com.br/nsaasb\", \"fulfillment_order_id\": \"01ARZ3NDEKTSV4RRFFQ69G5FAV\"}]",
}
]

You can then JSON decode the value to access the list of NFEs.

Note: you can still use the old method of sending the NFe key and url as two separate metafields, but we recommend migrating to this new method as it is now the preferred method for NFe consumers as it allows to receive multiple NFes supporting orders with multiple fulfillments.

FAQ

What are our recommendations on best practices for retrieving orders information?

We at Tiendanube are a platform concerned with balancing cost x resilience x security of our APIs, so we recommend following some practices that we consider healthy when interacting with orders.

General:

  • Rate Limit: in order to control the incoming traffic from the API
  • Pagination: to make sure responses are easier to handle

Import:

  • Loop calls: avoid frequent loop calls - many times these calls are unnecessary as the resource has not changed and the response will be the same as before.
  • Import by period: to avoid loop calls, you can use import by period, which consists of defining time intervals for imports. Ex: first import takes orders from 01/01/2023 to 01/03/2023, the second import takes orders from 01/04/2023 to 01/06/2023 and so on. For this case, you can use the parameters created_at_min and created_at_max to import orders by period.

Webhooks:

  • Import orders using Webhooks: an even better alternative than importing by period is to create orders webhooks to be notified as soon as there is an interaction with a resource (create, retrieve, update, delete).
  • Use Specific Webhooks: there are all kinds of Webhooks. Therefore, we encourage our partners to only use those that apply to their use case. Example: if you need to know when an order was packed, create a webhook for order/packed and not order/updated, which in turn notifies the user of any changes to the order. Creating the order/updated webhook would generate several non-applicable notifications to the partner, which in turn would make several unnecessary queries to the Tiendanube API.
  • Order/paid Webhook: the order/paid webhook notifies the partner that the order has been paid. After payment, two order's attributes get modified: attribute payment_status receives "paid" and attribute paid_at receives the exact time the payment was processed. Therefore, it is not necessary to send a request to Tiendanube, since the gateway field (which contains the payment method used by the customer) will already have been filled in at the time of creating the order and can be obtained if the partner has created the webhook for order/created.
Orders placed via API do not update stock?

The Tiendanube API has the ability to create orders without reserving stock. It depends on the inventory behavior parameter. If it's claim, it reserves stock. If it's bypass skips the stock reserve.

Things to take into account when implementing a Subscription App

Usually a Subscription App works this way: a consumer places an Order for the first time and the subsequent orders are created through API. The first order will be created without any problems or lack of information, that is, order will appear as paid on Tiendanube's Admin and you will be able to see information regarding transactions (external_id and external_url). That's because the order was created through Tiendanube's Checkout by selecting the payment provider.

On the other hand, because the subsequent orders are created through API, the Merchant won't be able to see which payment processor created the order. Besides that, even though the Partners tries to create transaction to provide more info (external_id and external_url) on the order, the transaction won't be read by order since it was created through API, as mentioned before.

Despite this "limitations", we recommend creating the subsequent order as paid and put more info (external_id and external_url) on a field called owner_note, which is visible to the Merchant. This way, we guarantee the Merchant will see the Order as paid to perform the next steps (packing and shipping) and will also be able to see more details about the payment processing directly through the order detail.

Only Argentinian stores: How to know when the buyer requested a 'Factura A' during checkout?

In checkout, we have the following checkbox available: image

When it is checked, the following fields are sent with information:- billing_customer_type: "company"

  • billing_business_name: "{value_of_business_name}"
  • billing_document_type: "cuit"

If it is not checked, those fields are sent as null.