Skip to main content
Troquecommerce is an exchanges and returns platform for e-commerce stores: customers open their exchange or return requests (“reversas”) in the store’s exchange center, and the store follows, approves and refunds them in the Troquecommerce dashboard. This connector reads, through the Troquecommerce public API, every request with its values, refund, voucher and reverse logistics, the items of each request, its history of events, its comments and internal pending issues, plus the store’s return points and its general exchange and refund deadlines.
The connector only reads. It never approves, cancels, receives or comments on a request.

Configuring Troquecommerce as a Source

In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Troquecommerce option from the list of connectors. Click Next and you’ll be prompted to add your access.

1. Add account access

The connector authenticates with an API token of your store.
1

Generate the API token

In the Troquecommerce dashboard, open Automações e Integrações › API and click Gerar novo token. A token with READ access is enough. See Troquecommerce’s help article.
2

Fill in the source

Paste the token below exactly as shown, without any prefix.
The following configurations are available:
  • API Token: The API token of your store.
  • Start Date: Requests last updated before this date are not read.
  • Lookback Days (advanced, default 1): Each incremental sync reads again this many days before where the previous sync stopped, to pick up late changes (1 to 30).
Troquecommerce allows 40 requests every 10 seconds per token, shared by every integration that uses the same token. The connector stays below that, but if another system uses the same token heavily, generate a separate token for Nekt.
Once you’re done, click Next.

2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis.
Tip: The stream can be found more easily by typing its name.
Select the streams and click Next.

3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.
  • Layer: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
  • Folder: a folder can be created inside the selected layer to group all tables being created from this new data source.
  • Table name: we suggest a name, but feel free to customize it. You have the option to add a prefix to all tables at once and make this process faster!
  • Sync Type: you can choose between INCREMENTAL and FULL_TABLE.
    • Incremental: every time the extraction happens, we’ll get only the new data, which is good if, for example, you want to keep every record ever fetched.
    • Full table: every time the extraction happens, we’ll get the current state of the data, which is good if, for example, you don’t want to have deleted data in your catalog.
Once you are done configuring, click Next.

4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters. To define your Trigger, consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times). Optionally, you can define some additional settings:
  • Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource here.
  • Determine when to execute an Additional Full Sync. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.
Once you are ready, click Next to finalize the setup.

5. Check your new source

You can view your new source on the Sources page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.
For you to be able to see it on your Catalog, you need at least one successful source run.

How the data is read

  • Requests are read by their last update date: the first sync reads everything updated since the Start Date, and each later sync reads what changed since the previous one (minus the Lookback Days). Whenever Troquecommerce updates a request’s last update date (for example on a status change), the request comes again with its new values.
  • Each changed request is read in full, so the first sync of a store with many requests takes a while: about one request to Troquecommerce per exchange or return (two when comments are selected), at up to three per second; about 6 hours for 30,000 requests with comments. For a store with many requests, start with a recent Start Date. If a later sync fails midway, the next one resumes after the last period it completed; a first sync or a Full sync that fails starts over.
  • When Reverse Order Comments is selected, requests that are still open (not Finalizado or Cancelado) and were updated in the last 30 days are read again on every sync (at most the 1,000 most recent), so new comments and pending issues are picked up even when nothing else changed in the request. Each one costs two requests per sync. A comment added to an older or already finished request arrives when the request changes again or on a Full sync.
  • A request deleted in Troquecommerce stays in your tables as it was last read (the API does not report deletions); it is no longer followed.
  • If you select Reverse Order Comments on a source that already exists, run a Full sync to bring the comments of the requests read before.
  • Some links are temporary: the shipping label (tracking_shipping_label_url) and the customer’s photos (reason_image_urls) expire after a while.
  • The API token needs only READ access, and every table uses the same access: if Troquecommerce refuses the token, the sync stops with a message asking to update the token.

Streams and Fields

Available streams

The table below lists every stream, its slug (the exact identifier to pass when creating the source via API) and a short description.

Fields by stream

One row per exchange or return request. Primary key: id. Incremental by updated_at.Identification and status:
  • id - Unique id of the request in Troquecommerce (UUID)
  • ecommerce_number - Number of the original order in the e-commerce platform
  • ecommerce_id - Internal id of the original order in the e-commerce platform
  • status - Current status as shown in the dashboard (e.g. Em Análise, Aguardando Envio, Finalizado, Cancelado)
  • reverse_type - Type of the request (Troca, Devolução, Troca e devolução, Sem Reembolso, Vale (Cupom), Estorno…)
  • created_at - When the request was opened (UTC)
  • updated_at - When the request last changed (UTC)
  • cancel_reason - Why the request was canceled
  • is_split_order, is_collect, is_complete, is_exception, is_second_request, is_second_reverse - Flags of the request
Customer:
  • client_name, client_email, client_phone, client_document - Customer who opened the request
  • client_address - Customer address (JSON)
Values:
  • price - Total value of the items in the request
  • exchange_value - Part turned into an exchange voucher
  • refund_value - Part refunded in money
  • saved_refund_value, saved_exchange_value, saved_shipping_value - Values saved by an operator in the dashboard
  • discount, order_shipping_cost - Discount and shipping of the original order, proportional to the returned items
  • retained_value, retained_bonus, retention_level - Values retained by the store and retention rule applied
Voucher:
  • coupon_code, coupon_description, coupon_ecommerce_id, coupon_validity, coupon_value - Voucher generated for the exchange part
  • coupon_bonus_code, coupon_bonus_ecommerce_id, coupon_bonus_value - Separate bonus voucher, in stores that split it
  • coupon_used_on_order - Coupon used in the original order
Refund:
  • refund_payment_value, refund_payment_action, refund_payment_is_integrated, refund_payment_created_at - Refund made
  • refund_payment_giftcard_value, refund_payment_original_method_value, refund_payment_cashback_value, refund_payment_summary - How the refund was split
  • gateway_transaction_id, gateway_name - Payment gateway of an integrated refund
  • refund_details_is_pix, refund_details_pix_type, refund_details_pix_key, refund_details_bank_code, refund_details_bank_agency, refund_details_bank_account, refund_details_bank_account_type, refund_details_document, refund_details_refund_method, refund_details_refund_type - Refund details informed by the customer
Reverse logistics:
  • tracking_status, tracking_courier_company, tracking_courier_tracking_code, tracking_courier_collect_number - Current tracking
  • tracking_created_at, tracking_due_date, tracking_posted_date, tracking_expected_delivery_date, tracking_delivery_date - Tracking dates
  • tracking_is_collect, tracking_posting_address, tracking_price, tracking_locker, tracking_url, tracking_shipping_label_url - Shipment details
  • tracking_return_address_id, tracking_return_address - Return point the package goes to (JSON)
Invoices and others:
  • invoices - Return invoices (NFD) registered (JSON)
  • sales_invoices - Sales invoices of the original order (JSON)
  • replaced_items - Items chosen in a direct exchange (JSON)
  • replaced_order_ecommerce_number - Replacement order created in the e-commerce platform
  • sellers - Sellers involved (marketplaces)
One row per item of a request. Primary key: reverse_order_id + item_key.
  • reverse_order_id - Request the item belongs to
  • item_key - Key of the item within its request (Troquecommerce gives items no id)
  • item_index - Position of the item in the request
  • reverse_order_updated_at - Last update of the request when the item was read
  • ecommerce_product_id, sku, ean, ref_id, description, image_url - Product
  • quantity, original_quantity, price, price_discount, shipping_price - Quantities and values
  • is_exchange, is_removed, is_received, is_retained, is_added_by_operator - Flags of the item
  • reason, sub_reason, client_comment, organisation_comment, reason_image_urls - Reason given by the customer
  • ecommerce_number, seller - Original order and seller of the item
  • replaced_item_sku, replaced_item_description - Item chosen in a direct exchange
One row per event of a request. Primary key: reverse_order_id + event_key.
  • reverse_order_id - Request the event belongs to
  • event_key - Key of the event within its request
  • event_index - Position of the event in the history (oldest first)
  • reverse_order_updated_at - Last update of the request when the event was read
  • created_at - When the event happened
  • created_by - Who performed it (an operator’s email, or a system or integration)
  • description - What happened
One row per comment. Primary key: id.
  • id - Unique id of the comment
  • reverse_order_id - Request the comment belongs to
  • reverse_order_updated_at - Last update of the request when the comment was read
  • comment, created_at, created_by_email - The comment, when and who wrote it (‘Sistema’ for the API or the system)
  • attachments - Files attached (JSON)
  • pending_id, pending_opened_at, pending_closed_at, pending_type_id, pending_type_name, pending_opened_by_email, pending_closed_by_email - Internal pending issue opened or closed by the comment (pending_closed_at empty while it is open)
One row per address registered by the store. Primary key: address_key. Full table.
  • address_key - The address id (or a hash of its fields when it has none)
  • id, recipient - Id and name of the address
  • street, number, complement, suburb, city, state, zip_code, country - Address
  • is_main, is_default, is_physical_store, is_distribution_center - Kind of address
  • email, phone_number, opening_hours, document, seller_id, organisation_name - Contact and owner
  • has_transfer, transfer_name, transfer_deadline, transfer_fee - Transfer service of the return point
One row with the store’s general deadlines (Settings › Rules › General deadlines). Full table. Empty when the store has no rules registered.
  • exchange_deadline_days - Maximum number of days for an exchange
  • refund_deadline_days - Maximum number of days for a refund

Implementation notes

  • Dates are in UTC (ISO 8601). Monetary values keep the API’s exact decimals.
  • Nested values (addresses, invoices, attachments) are stored as JSON text.
  • The connector does not read the sales invoice lookup (it queries the store’s ERP live for each order) nor the refund proof files (their links expire in 15 minutes).