Both use the same API key and the same rate limits, and you can call both from
one integration.
v1 keeps working and does not change. Every guide on this site uses v2.
What v2 is
v2 is not v1 with new paths. It has its own shapes, and every operation in it follows the same rules, so what you learn from one operation holds for the rest. v1 grew one route at a time and does not have that property: its lists have six different shapes, its totals three, and some responses carry placeholder names and logos.
Pagination and formats and Errors state the v2
rules in full.
Config ids do not change
A config created on v1 is the same config on v2, with the same id. You do not create anything again or change anything on-chain. v2 reads every config, including one v1 created, and v1 reads every config that names only charities.From v1 to v2
Each v1 operation and the v2 operation that does its job. The reference page of every v1 operation names its v2 form too.
None of these is a rename. Read the v2 reference page before moving a call: the parameters and
the response are v2’s own.
What to change when you move a call
- Lists. Read
itemsandnextCursor. SendnextCursorascursor. - Totals. Read
stats.totalUsdE6where you readusdDonatedE6ordisplayedUsdE6. - Recipients. Use config beneficiaries for every weighted profile, including the charities a campaign supports. Use lookup for summaries of individual references.
- A config body.
charityBeneficiaries: [{ charityId, weight }]becomesbeneficiaries: [{ type: "charity", id, weight }]. - A config id.
id.hexbecomesid, andid.base58becomesidBase58. - Errors. Read
messagewhere you readerror, and check the codes: some are new, and a missing or wrong key is401on v2. - Nulls.
nameandimageUrlcan benull. Show your own fallback. available. A recipient withavailable: falseand a name is a stand-in: show it as it is.
Move the reads with the writes
v1 cannot describe a campaign. Once one of your configs names a campaign, these v1 reads stop working for it, so move them to v2 at the same time as config creation.What is only on v1
The feed of new charities
To watch for newly listed charities, v1 has a feed. v2 lists the same charities newest first withGET /v2/charities?sort=newest, without the time each was
listed.
- Items are in the v1 charity shape. Take the
idto v2. - Poll the feed to watch for new charities. It honours
ETagandLast-Modified: an unchanged feed answers304.
The rest
The reference lists every v1 operation under
Earlier version (v1).