Skip to main content

Purchases

Partners can purchase trees in Tree projects or carbon tonne in Carbon Offsets projects on behalf of their customers.

There are two types of purchases:

  1. Direct purchase - end customer pays directly to Earthbanc
  2. Indirect purchase - end customer pays to a partner and partner pays to Earthbanc

These endpoints are protected and requires authorization.

Authorization

Authorization parts:

  1. Whitelisted IP - we allow only traffic from whitelisted IP of our partners (not needed for sandbox environment)
  2. Partner ID - Partner ID is part of the path see endpoints below
  3. Secret key - stored in Authorization: Api-Key <secret> header of the request

Direct Purchase

End customer pays for purchased trees and carbon tonnes directly to Earthbanc via Stripe Payment Gateway. Purchased volume has to be below reservation threshold. A partner needs to use Earthbanc's Publishable key for Stripe to successfully proceed the payment.

Publishable key:

  • Sandbox environment - pk_test_mG0VOLVfhhQJNepEXAjQ4ROF00gmjeUlDW
  • Production environment - pk_live_VbTBqzcT7NTAy7XXhTgtaZGP00Xfhq2kbB

Allowed payment methods:

  • Card
  • SEPA Direct Debit

Steps:

  1. Create payment intent API definition
  2. Use clientSecret from response together with Publishable key to process payment in Stripe

Note: Purchase might not be immediately visible in List of purchases because of payment gateway delay which might be from couple seconds for card payment to several days for sepa direct debit.

Indirect Purchase

This API receives new partner purchase on behalf of a customer with volume below reservation threshold.

Path: POST https://app.earthbanc.io/api/partners/{partner-id}/indirect-purchases

More details: API definition

List of purchases

This API provides partner's purchases for a customer

Path: GET https://app.earthbanc.io/api/partners/{partner-id}/purchases?emailSha3={emailSha3}

More details: API definition

Printable purchase certificate

There is possibility to receive an image of certificate for purchased trees and carbon tonnes. We support PDF and PNG image format. You can also apply for multiple certificate at once. In case of PDF you can decide to receive it as single page pdf documents compressed into and archived or multipage PDF.

More details: API definition