Developers

Migrating from v1

Endpoint by endpoint, what changed between the legacy woodyou.care API and the Platform API.

API v1 is the API of the old woodyou.care shop. It keeps working with the same responses until the end date you receive from us, but nothing new is added to it. This page walks through what changes when you move to v2.

In short

  • New tokens. v1 tokens are Sanctum tokens from the old dashboard. v2 uses Platform API tokens with scopes, created at Settings > API tokens on the Automate package. See Authentication.
  • New base URL. https://woodyou.care/api/v1 becomes https://woodyou.care/api/v2.
  • Buying and gifting moved to the Foundation. The Platform shows proof; it does not sell trees. Everything that created an order in v1 answers 410 Gone and points to the WoodYouCare Foundation.
  • Allocations instead of individual trees. Trees that come in through the Foundation have no per-tree identity. v2 reports allocations: a number of trees from one planting, with a status.
  • No emission figures. v1 reported co2_compensation and goal_emissions_compensated. v2 reports trees, plantings, monitoring and verification, nothing else.
  • Uniform lists and errors. Cursor pagination with has_more instead of Laravel page numbers, and one error shape with stable codes instead of free-form messages.

Endpoint by endpoint

v1v2Notes
GET /pingGET /v2/mev2 has no unauthenticated ping; a 200 on /me tells you the token works
GET /meGET /v2/meSame purpose. The customer block disappears; company gains package and totals
GET /get-statsGET /v2/companytree_count becomes trees.total with a breakdown per status. available_for_gifting becomes trees_unassigned. The emission fields have no successor
GET /get-treesGET /v2/allocationsOne row per allocation instead of per tree. Legacy trees keep their WYC... ids inside the allocation; Foundation trees never had one
GET /get-projectsGET /v2/projectsSame fields plus ecosystem_type and verification. Stock disappears, because the Platform does not sell trees; trees counts your own trees per project
POST /buy-tree, POST /buy-treesFoundation410 Gone. Donate at the Foundation; the allocation shows up in v2 and a webhook tells you
POST /gift-treePOST /v2/recipientsAssign trees from your unassigned trees to a recipient. New trees are no longer bought on the fly
POST /buy-vouchersPOST /v2/gift-codesReserve trees behind a code the receiver claims at /gift; nothing is bought
POST /cancel-order/{id}Foundation410 Gone
GET /get-productsFoundation410 Gone. Products are Foundation domain
POST /calculate-delivery-compentationRemoved410 Gone, no successor

Field mapping for trees

v1 get-trees rowv2 allocation
id (WYC00000001)legacy_tree_ids[] on the allocation, only for trees imported from woodyou.care
projectproject.name (expand project)
supplierpartner.name on the planting (expand planting, then partner)
latitude, longitudeplanting.location (centroid of the planting polygon)
countryproject.country, as an ISO code instead of a translated name

Checklist

Create a Platform token

Ask an administrator to create a live and a test token with the scopes you need.

Replace the reads

Point me, get-stats, get-trees and get-projects at their v2 successors and switch your list handling to cursor pagination.

Move purchases to the Foundation

Anything that called buy-*, gift-tree or buy-vouchers now donates at the Foundation or assigns trees to a recipient in v2.

Subscribe to webhooks

Replace polling with webhooks for new allocations, plantings and verification.

Drop the emission figures

Remove co2_compensation and goal_emissions_compensated from your reports. The Platform talks about trees.

On this page