Configuring Rede as a Source
In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Rede option from the list of connectors. Click Next and you’ll be prompted to add your access.1. Add account access
Rede gives access to the Sales Management API through credentials it issues to your company: a Client ID and a Client Secret. There is no self-service page for production credentials: they are only issued by Rede’s integrations team, by e-mail, and only after Rede has certified the integration in its sandbox (test) environment. The steps are:- Request access by e-mail. Send an e-mail to
ecommerce@userede.com.br(or to your Linha Direta box, if you are a Rede wholesale customer) with:- the name, CNPJ, e-mail and phone number of your company;
- your company’s segment;
- the name and e-mail of the person who will receive the credentials;
- the API you want to access: Gestão de Vendas (Sales Management).
- Sandbox certification. Before releasing production, Rede certifies the integration in its sandbox. Sandbox credentials are free: create an account in Rede’s developer portal, open Meus Projetos (My Projects) and create a project with the Gestão de Vendas API package. Rede’s sandbox only answers for its own test points of sale (
13381369and22523510). To run the certification through Nekt, create a source with the sandbox credentials, the Sandbox option enabled and those PVs, and contact Nekt support if Rede asks for anything else. - Production credentials. Once certified, Rede registers your organization, user and application and sends the production Client ID and Client Secret by e-mail. Use them in a source with the Sandbox option disabled.
This process is handled between your company and Rede, so start it before you need the data, and reply to the same e-mail thread if Rede asks for more information.
- Client ID: the Client ID sent by Rede. Required.
- Client Secret: the Client Secret sent together with the Client ID. Required.
- Points of sale (PV): the PV numbers whose data you want to extract, one per item. Each PV must belong to the company Rede issued the credentials to. Required.
- Start Date: the first date read on the first sync (the sale date for sales, the payment date for payments). Later syncs continue from where the previous one stopped. Leave it empty to read the last 365 days. A full sync also reads from this date, so with it empty a full sync keeps only the last 365 days in the tables.
- Lookback Days (advanced): how many days before the last extracted date every sync reads again. The default is 30. Sales can be cancelled or charged back and payments change status after they first appear, so recent days are read again to keep them up to date.
- Days Ahead (advanced): how many days after today are read for scheduled values (future payments, credit orders, debits and receivables). The default is 365.
- Sandbox (advanced): uses Rede’s test environment. Enable it only with sandbox credentials created in Rede’s developer portal.
2. Select streams
Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.Tip: The stream can be found more easily by typing its name.
Rede answers for one point of sale and a limited date range per request (62 days for sales, 30 days for the other data), so the extraction time grows with the number of PVs and with the history requested on the first sync.
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: all streams except
adjustment_typesare INCREMENTAL: each sync brings the new dates and reads the recent ones again (see Lookback Days).adjustment_typesis FULL_TABLE. A full sync rebuilds the tables from the Start Date; it is the way to pick up changes Rede makes to records older than the lookback (for example a chargeback months after the sale). Read more about Sync Types here.
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. Rede updates the statement once a day (with the previous day’s data), so a daily trigger is usually enough. 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.
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.Streams and Fields
Below you’ll find all available data streams from Rede and their corresponding fields. API reference: Rede Sales Management API.Every table (except
adjustment_types) has a merchant_id column with the point of sale the record was requested for, and every table has a raw_payload column with the whole record exactly as Rede returned it, so information without a column of its own is still available. Lists and objects are stored as JSON text. The sales summary number (sale_summary_number, the RV) links sales, credit orders and charges; payment_id links payments and credit orders.Sales
Sales
Card sales of each point of sale, one record per transaction: gross amount, MDR discount, net amount, brand, modality, installments, status and chargeback status. Incremental on the sale date.Table:
sales · Primary key: merchant_id, sale_date, nsu · Sync: IncrementalSales Installments
Sales Installments
Installments of the installment sales, with the due date and the amounts of each installment. Incremental on the sale date.Table:
sales_installments · Primary key: merchant_id, sale_date, nsu, installment_number · Sync: IncrementalPayments
Payments
Payments settled or scheduled for each point of sale: the net amount paid into the bank account, with its status. Future payments are included (see Days Ahead). Incremental on the payment date.Table:
payments · Primary key: merchant_id, payment_id · Sync: IncrementalPayment Credit Orders
Payment Credit Orders
Credit orders of each payment. A credit order ties a payment to the sales summary (RV) it pays, which is how sales are reconciled with the money received. Incremental on the payment date.Table:
payment_credit_orders · Primary key: merchant_id, payment_id, credit_order_number · Sync: IncrementalCharges
Charges
Debits and adjustments Rede discounts from the payments: sale cancellations, chargebacks, fees and other adjustments, with the amount already compensated and the amount still to compensate. Incremental on the payment date.Table:
charges · Primary key: merchant_id, debit_number, credit_order_number · Sync: IncrementalAdjustment Types
Adjustment Types
Reference list of the debit adjustment codes used in
charges. Extracted in full on every sync.Table: adjustment_types · Primary key: code · Sync: Full tableReceivables Installments
Receivables Installments
Receivables schedule of each point of sale: every installment to receive (or received), with its date, original and updated amounts, net amount and bank account. Future dates are included (see Days Ahead). Incremental on the receivable date.Table:
receivables_installments · Primary key: hash_unique · Sync: IncrementalTroubleshooting
- “Rede rejected the Client ID or Client Secret”: check that both values were copied exactly as Rede sent them and that they are production credentials. Sandbox credentials only work with the Sandbox option enabled.
- “Rede did not allow this connection to read the statement of point of sale”: the PV does not belong to the company the credentials were issued to, or its access was not approved. Check the PV number; if the access was requested through Rede, the PV owner approves it in the logged area of Portal Rede.
- “Rede rejected the request” with a message about dates: Rede may not keep history as old as the configured start date. Try a more recent Start Date.
- “Rede returned an inconsistent page” or “Rede answered … in an unexpected format”: the sync stopped on purpose so that it would not finish with records missing. Nothing was deleted: in a full sync the table keeps its previous data, and in an incremental sync the records read before the stop may already have been saved (added or updated) while the rest are read again by the next sync. If the message repeats, contact Nekt support.