Buy credit

Purchase credit for a planter account. Credit is denominated in EUR and used to fund future tree plantings. The API user must have can_refill_credit = true.

Authentication

AuthorizationBearer

Bearer token required for all User API endpoints. Routes are additionally guarded by an active middleware (account must be active).

Request

This endpoint expects an object.
planter_idintegerRequired
ID of the user whose credit balance is topped up.
amountdoubleRequired

Credit amount to add (in EUR). If credit_unpaid_limit is set on the API user, cumulative unpaid credit plus this amount must not exceed that limit.

Response

Credit result. Check status field — HTTP 200 is returned even for business-logic errors.

statusenum
payment_idinteger

ID of the created payment record (present on success).

errorCodeenum or null
errorMessagestring or null

Errors

401
Unauthorized Error
403
Forbidden Error