Skip to content
Denne side findes på dansk. Læs på dansk
HeyMySocial

Sales file format

The columns of a CSV file of sales, how each sale finds its lead by id or email address, which amounts and currencies are read, and what a second import does.

A sales file ties revenue to leads you already have. Each row is one sale: an amount, a date and something that says which lead it belongs to. When the row is accepted the sale is recorded and the lead moves to won.

Columns

ColumnHeadings recognisedNeededWhat it is
lead_external_idlead_external_id, lead id, lead, customer id, kundenummerThis or emailThe id you gave the lead, its external_id. Exactly one lead must have it.
emailemail, e-mail, mail, email address, e-mailadresseThis or lead_external_idThe lead's email address. The newest lead with that address that arrived no later than the day of the sale is used. A name is never used.
amountamount, beløb, belob, total, revenue, omsætning, value, værdiYesThe amount, above zero, as a number in the currency's main unit.
currencycurrency, valutaOptionalA three-letter currency code. Left empty, the workspace's currency is used.
occurred_atoccurred_at, date, dato, sale date, salgsdato, invoice date, fakturadatoOptionalThe date of the sale. Left empty, the moment of the import is used. It cannot be more than a day in the future.
external_idexternal_id, id, lead id, sale id, invoice, faktura, fakturanummer, order id, ordrenummerOptionalYour own id for the sale, such as an invoice number. Without it, the lead, the amount and the date identify the sale.
revenue_basisrevenue_basis, basisOptionalbooked, invoiced or collected. Left empty: booked.
verification_sourceverification_source, verification, source, kildeOptionalmanual, crm or invoice. Left empty: manual.

As with leads, the import screen proposes a column for each field from the header row, and you can change every choice. Capital letters do not matter, and underscores and dashes count as spaces.

How a sale finds its lead

You must map the amount, and either lead_external_id or email.

  • By the lead's id. lead_external_id is the id the lead has in your system, the one imported as external_id with the lead file or sent with the lead through the API. Exactly one lead must have it. If no lead has the id, or more than one does, the row is left out and the reason says which.
  • By email address. Used when the row has no lead id. The address must match a contact exactly. Among that contact's leads the newest one that arrived on or before the day of the sale is chosen, and leads marked as duplicates are skipped. If no lead with that address arrived before the sale, the row is left out.

A sale is never matched on a name.

Rules for a row

  • Amount. A number above zero. 48500, 48500.00, 48.500,00 and 48,500.00 are all read as the same amount: when both a comma and a full stop appear, the last one is the decimal mark, and a single mark followed by exactly three digits is read as a thousands separator. A refund cannot be imported with this file.
  • Currency. A three-letter code such as DKK. Without a currency the row gets the workspace's currency.
  • Date. occurred_at is the day of the sale, in the same forms as the date of a lead, read in the workspace's time zone. Without a date the sale gets the moment of the import; a date more than a day in the future is refused.
  • The sale's own id. external_id is the invoice or order number. Give it whenever you can: it is how the sale is recognized next time.
  • Revenue basis. booked, invoiced or collected. Empty means booked.
  • Verification source. manual, crm or invoice, saying where the number was checked. Empty means manual.

A row with an unknown revenue basis, verification source or currency is left out; nothing is corrected by guessing.

Importing the same file again

A sale with an external_id is recognized by it. A sale without one is recognized by its lead, amount, currency and date. Either way a second import leaves the sale as it is and counts the row under Already there.

Give each sale its number

Two real sales to the same lead, for the same amount on the same day, look like one sale when neither has an id. With an invoice or order number in external_id they stay two.

Sample

The rows are made up. The first sale names its lead by id; the second has only the email address and writes the amount and date the Danish way, with the amount in quotes because it contains a comma.

lead_external_id,email,amount,currency,occurred_at,external_id,revenue_basis,verification_source
L-1001,,48500.00,DKK,2026-04-22,INV-2041,invoiced,invoice
,bo@example.org,"12.500,00",DKK,28-04-2026,INV-2042,booked,manual

A file with every column and two fictional rows is at https://heymysocial.com/docs/files/samples/sales.csv and its rows point at the leads of the sample lead file, so import that one first.

In the app

  1. Open Leads and press Import. You need a role that may manage leads, and you must be on the agency's own team.
  2. Under What is in the file? choose Sales, choose the CSV file and press Read the file.
  3. On Map the columns, check the proposal against the first rows of the file, then press the import button, which says how many rows it will import. If the amount or both ways of finding the lead are unmapped, the screen says so and nothing is imported.
  4. Result shows Imported, Already there and Not imported, and lists each row that was left out with its line number and the reason.

Import the leads before their sales. A sale whose lead is not in the workspace yet is left out, and importing the same sales file again after the leads are in picks it up. The size and row limits are on the overview of files.

Other ways to record a sale

  • In the app, Record a sale on the lead's own page records one sale.
  • An assistant records one sale with record_sale.
  • A system sends a sale_won event through the API or the signed webhook; see server events.
  • A CRM connection takes sales by webhook, API or its own export file, under the CRM's ids.

How sales count toward a campaign is described under attribution.