Add Razorpay paying customers to Attio
A Razorpay + Attio agent flow
A customer pays through Razorpay and that's the last the CRM hears of it. The account team in Attio is left blind to who's actually transacting, so outreach and renewals run off a stale list or no list at all. The agent fetches payments with fetch_all_payments, reads the contact on each, and upserts a matching person record into Attio with upsert-record, keyed on email so the same payer never doubles up. Razorpay answers the call rather than pushing, so the read runs on whatever cadence you set, and only payments the agent hasn't seen turn into CRM records.
The flow
fetch_all_paymentsFetches all payments with filtering and pagination.
upsert-recordCreates or updates a record by matching attributes such as email or domain.
Step by step
- Scope the payment window
Decide which payments the agent reads, typically captured payments from the last day, and the Attio object they map to, usually people. Choose the email attribute upsert will match on.
- Read the payments
The agent calls fetch_all_payments with a captured filter and a time range, reading each payment's email, contact, amount, and the method used.
- Upsert into Attio
For each payer the agent calls upsert-record matching on email, so a returning customer updates their record rather than duplicating, and a new one is created with the contact and a note on the amount paid.
- Record what's already synced
Store each payment ID the agent processed. Next run it skips payments already synced, so re-reading the window doesn't keep touching the same records.
Tell your agent
Each morning, fetch captured Razorpay payments from the last 24 hours. For each, read the payer's email, contact, and amount, then upsert a person record in Attio matching on email, setting the contact and a note with the amount and date. Skip payments you've already synced.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- fetch_all_payments returns the payer's email and contact when the customer supplied them at checkout. A payment with no email can't dedupe on it, so decide whether to skip those or match on the contact number instead.
- Amounts come back in the smallest currency unit, paise for INR. Convert before writing the note so the record shows a readable figure.
- fetch_all_payments paginates, and the list includes authorized and failed payments depending on the filter. Scope to captured so the CRM fills with customers who actually paid.
Questions
- Does a repeat payer create a second record?
- No. upsert-record matches on email, so a customer who pays again updates their existing Attio record instead of creating a duplicate.
- Can it tell sales how much the customer paid?
- Yes. fetch_all_payments returns the amount, so the agent can write it to an attribute or a note on the record when it upserts, giving the account team that context.