B2b claim lines
Every product line on every retailer-to-supplier claim, with the supplier's decision grouped into a small set of outcomes.
- Grain
- claimlane_account x ticket_id x product_index
- Built from
- 2Raw tables
- 2Staging
- 1Core
- 1Analytics
- Reads from Claimlane
- b2b_ticketb2b_ticket_product
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.claimlane.b2b_claim_lines
2-- Every product line on every retailer-to-supplier claim, with the supplier's
3-- decision grouped into a small set of outcomes.
4-- Grain: claimlane_account x ticket_id x product_index.
5-- Depends on: staging.claimlane.b2b_ticket, staging.claimlane.b2b_ticket_product
6--
7-- DECISION. Claimlane records a status per line, not per claim, because a
8-- supplier can accept one product and decline another on the same claim.
9-- decision groups it:
10-- accepted acceptedCredit, acceptedCreditAndRecycle, acceptedReturn,
11-- acceptedReturnToSupplier, acceptedNoClaim
12-- declined declined
13-- open notHandled, or no status
14-- other other, and any status Claimlane adds later
15-- acceptedNoClaim counts as accepted: the supplier agreed with the retailer,
16-- even though no credit or return followed. Move it if your process disagrees.
17--
18-- DAYS TO DECISION IS AN UPPER BOUND. The connector syncs when a claim was
19-- created and when anything on it last changed (updated_at), not when each line
20-- was decided. days_to_last_update on a decided line is therefore the time to the
21-- claim's latest edit, which is the decision or something after it. A comment
22-- added a month later moves it. Treat it as "decided within", never as "decided
23-- in".
24--
25-- No price is synced on B2B lines, so claims can be counted but not valued.
26
27SELECT
28 t.claimlane_account,
29 t.ticket_id,
30 p.product_index,
31 t.rma_number,
32 t.brand_id,
33 t.brand_name,
34 t.claim_type,
35 t.retailer_name,
36 t.retailer_customer_number,
37 t.retailer_country,
38 t.is_archived,
39 DATE(t.created_at) AS created_date,
40 t.created_at,This model and the 3 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().
How it counts. And where it stops.
DECISION. Claimlane records a status per line, not per claim, because a supplier can accept one product and decline another on the same claim. decision groups it: accepted acceptedCredit, acceptedCreditAndRecycle, acceptedReturn, acceptedReturnToSupplier, acceptedNoClaim declined declined open notHandled, or no status other other, and any status Claimlane adds later acceptedNoClaim counts as accepted: the supplier agreed with the retailer, even though no credit or return followed. Move it if your process disagrees. DAYS TO DECISION IS AN UPPER BOUND. The connector syncs when a claim was created and when anything on it last changed (updated_at), not when each line was decided. days_to_last_update on a decided line is therefore the time to the claim's latest edit, which is the decision or something after it. A comment added a month later moves it. Treat it as "decided within", never as "decided in". No price is synced on B2B lines, so claims can be counted but not valued.
Raw tables it reads
- raw.claimlane.b2b_ticket
- raw.claimlane.b2b_ticket_product
More Claimlane models
Put Claimlane in front
of your agents.
Connect Claimlane, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.