Skip to main content
GET /v1/workspace/ledger serves a connected shop’s Etsy payment account ledger, entry by entry, as Etsy booked it: sales, fees, taxes, refunds, advertising fees and payouts, each with the balance after it. Each entry says which order it belongs to. It needs an API key with the workspace:read and orders:read scopes, which only a workspace owner or admin can create; AI assistants cannot reach it over an MCP connection. This page covers how to keep a correct copy and compute profit per order from it.

Copy the ledger

  1. Start with after=0.
  2. Call GET /v1/workspace/ledger?shop_id=<shop>&after=<after>.
  3. Upsert every entry by id. A later sync can rewrite an entry, so never insert blindly.
  4. Set after to the last entry’s sequence_number and repeat until a page comes back empty.
Then keep it current: call again from the last sequence_number you stored, and read the whole shop again from after=0 now and then.

Stop at a hole

A page never passes sequence numbers Alura has not stored. It stops before them with has_more: false and next_cursor: null, names them in summary.not_stored, and adds one of two notices:
  • ledger_gap: entries are stored on both sides of the range.
  • ledger_history_pending: nothing is stored up to the range yet, as while a shop’s older history is still being fetched. Older entries can still arrive, so read from after=0 again later.
Hold there and read again later from the same after. Send not_stored.after only to skip the range on purpose: a copy that skips it never gets those entries.

Add up an order

Group entries by order_id where order_link is order. The sum is what the order earned after Etsy’s fees, taxes and refunds.
  • Treat an order’s sum as final only once its refunds have had time to arrive. A transaction fee refund can arrive a day or more after the refund it belongs to.
  • An entry with order_link: "unknown" is one Alura can’t tie to an order yet. It never means “no order”. Read it again later.
  • Entries with order_link: "listing" are per-listing fees, such as listing fees and renewals after a sale. Attribute them by listing_id if your profit calculation spreads listing costs.
  • Entries with order_link: "none" name neither an order nor a listing, such as advertising fees and payouts. Some of them are still costs of selling, such as VAT on seller fees (vat_seller_services), which Etsy books directly after the fee it applies to and without a reference. Count them in your profit even though they name no order.

Money

amount and balance are in the entry’s own currency. When a payment account changed currency, the running balance does not carry across the change, so never add balances of two currencies. An entry with amount_error: "currency_unknown" has null amounts: Alura has not verified how Etsy counts that currency in the ledger yet.