Plant trees
Plants trees on behalf of the authenticated API user.
Selection logic:
- If
planter_idis given, the template for that planter is used; falls back to the catch-all template (planter_id = 0) if no specific one exists. - If
recipientsis given,quantitytrees are planted per recipient. - If
species_idis given, it overrides the template’s default species.
Idempotency: supply order_id to prevent duplicate processing.
Authentication
Bearer token required for all User API endpoints.
Routes are additionally guarded by an active middleware (account must be active).
Request
Target planter user ID. Defaults to the API user’s configured planter. Falls back to the catch-all template (planter_id = 0) if no specific template exists.
Trees to plant per recipient. Defaults to the tree template’s package_quantity.
Idempotency key. If an order with this order_id was already processed for the same API user, the request is rejected with already_processed.
Locale for certificate/notification emails.
Response
Planting result. Check status field — HTTP 200 is returned even for business-logic errors.
ID of the created payment record (present on success).