Impacts

With the Impacts endpoints you can create your impact with different sources, triggers and metadata.

Impact Object

PropertyTypeDescription
impactPurchases(ImpactPurchase | ImpactPurchaseByValue)[]The impactPurchases array contains your spending on various impacts such as trees, plastic, carbon, kelp, water or bees.
estimationIdstringThe id of the estimation that was used to calculate the impact. You can use it to connect an impact with an estimation.
projectIdstringThe id of the project where the impact is made.
metadataMetadata[]

The metadata array holds up to 50 key-value pair objects. You can use them to differentiate your Impacts later.

For example you might want to associate impacts created in your application with your users by simply passing their unique user id. Later you can use this to filter results and display the correct impact to your users.

ImpactPurchase Object

The ImpactPurchase represents a spending on a specific purpose.

PropertyTypeDescription
typeenumType can be trees, plastic, carbon, kelp, water or bees.
amountnumberAmount means the number of trees, plastic bottles, kelp, kg of CO2, days of water supplied or bees protected.

ImpactPurchaseByValue Object

The ImpactPurchase represents a spending on a specific purpose.

PropertyTypeDescription
typeenumType can be trees, plastic, carbon, kelp, water or bees.
valuenumberValue of the impacts to be purchased in the account’s currency.

Metadata Object

With the Metadata object, you can differentiate your Impacts later.

PropertyTypeDescription
keystringMinimum 1, maximum 40 characters.
valuestringMinimum 1, maximum 500 characters.

Reserved Metadata keys

With the following reserved keys, you can optionally decorate the impact you're creating in order to help segment your impacts or configure how the impacts should be billed.

  • customerEmail: the email of your customer who triggered the impact creation. This email will be used for post purchase email sending if it is enabled.
  • customerFirstName: the first name of your customer who triggered the impact creation.
  • customerLastName: the last name of your customer who triggered the impact creation.
  • customerId: the unique identifier of your customer who triggered the impact creation.
  • merchantId: the unique identifier of the merchant on whose behalf you create the impact.
  • customerEmailType: the custom type for the impact action. This name will appear on the impact emails sent out (if it is enabled) as well as within the customers impact wallet. If left blank we will simply use "impact action".

ImpactPurchase Object

The ImpactPurchase represents an impact purchase from our project partners.

PropertyTypeDescription
idstringThe id of the purchase
typeenumType can be trees, plastic, carbon, kelp, water or bees.
amountnumberAmount means the number of trees, plastic bottles, kelp, kg of CO2, days of water supplied or bees protected.
projectIdstringThe id of the project where the impact is made.
receiptUrlstringThe receipt url which serves as a proof that the purchase was made.
providerstringThe slug of the project partner's name.
periodStartDatestringThe start of the period Greenspark made the purchase for. Example: '2024-01-01'
periodEndDatestringThe end of the period Greenspark made the purchase for. Example: '2024-01-31'
evidencesEvidenceResponse[]A list of evidences (exposed from the metadata field in the API response). Each item is a discriminated union; see EvidenceResponse below.

EvidenceResponse Object

EvidenceResponse is a discriminated union. The discriminator field is type.

Supported type values:

  • PlantingSession
  • PlasticCollection

PlantingSessionResponse Object

A planting session evidence object.

PropertyTypeDescription
type"PlantingSession"Discriminator type.
fieldUpdateIdnumberUnique identifier of the field update.
accountIdstring (optional)Present only when related to the authenticated account.
siteAssessmentSiteAssessmentResponseSite assessment details.
plantingPlantingDetailsResponsePlanting details.
blockchainPlantingSessionBlockchainResponseBlockchain references for this planting session.
survivabilityStatsSurvivabilityStats (optional, nullable)Optional survivability stats.
externalReportsExternalReportResponse[] (optional)External reports attached to this session.
altitudenumberAltitude.
longitudenumberLongitude.
latitudenumberLatitude.
siteVeritreeSubsiteResponseSubsite associated with this session.

SiteAssessmentResponse Object

PropertyTypeDescription
plantingSitestring | nullPlanting site name.
assessedAtstring | nullISO timestamp when the assessment was done.
assessorNamestring | nullAssessor full name.
notesstring (optional) | nullNotes captured during assessment.
imagesEvidenceImageResponse[] (optional)Images attached to the assessment.
geoJSONFeatureCollection[] (optional)GeoJSON objects attached to the assessment.
videosEvidenceVideoResponse[] (optional)Videos attached to the assessment.

PlantingDetailsResponse Object

PropertyTypeDescription
datePlantedstring | nullISO date when the planting happened.
startTimestring | nullPlanting start time (ISO-8601).
endTimestring | nullPlanting end time (ISO-8601).
siteForesterstring | nullName of the site forester.
numberOfPlantersnumber | nullNumber of planters.
notesstring (optional) | nullNotes captured during planting.
amountPlantednumber (optional) | nullTotal amount planted during this session.
imagesEvidenceImageResponse[] (optional)Images attached to planting details.
geoJSONFeatureCollection[] (optional)GeoJSON objects attached to planting details.
videosEvidenceVideoResponse[] (optional)Videos attached to planting details.
speciesPlantingSpeciesResponse[] (optional)Species breakdown for this planting session.

PlantingSpeciesResponse Object

PropertyTypeDescription
namestringSpecies common name.
amountPlantednumberAmount planted for this species.

PlantingSessionBlockchainResponse Object

PropertyTypeDescription
transactionIdstring | nullBlockchain transaction id.
arweaveUrlstring | nullArweave URL, if available.
ipfsUrlstring | nullIPFS URL, if available.

ExternalReportResponse Object

PropertyTypeDescription
type"ExternalReport"Discriminator type.
externalIdstringExternal report id.
titlestring | nullExternal report title.
reportedAtstring | nullISO date when this report was reported.
fieldUpdateIdnumberField update id associated with this report.
imagesEvidenceImageResponse[] (optional)Images attached to this report.
geoJSONFeatureCollection[] (optional)GeoJSON objects attached to this report.
videosEvidenceVideoResponse[] (optional)Videos attached to this report.

EvidenceImageResponse Object

PropertyTypeDescription
altitudenumberAltitude.
longitudenumberLongitude.
latitudenumberLatitude.
urlstringPublic URL of the image.
previewUrlstring (optional)Optional preview URL of the image.
altstring (optional)Alternate text for the image.

EvidenceVideoResponse Object

PropertyTypeDescription
altitudenumberAltitude.
longitudenumberLongitude.
latitudenumberLatitude.
urlstringPublic URL of the video.
previewUrlstring (optional)Optional preview URL of the video.
altstring (optional)Alternate text for the video.

SurvivabilityStats Object

PropertyTypeDescription
type"SurvivabilityStats"Discriminator type.
fieldUpdateIdnumberField update id (Veritree).
metricsSurvivabilityMetric[]Survivability metrics for this field update.

SurvivabilityMetric Object

PropertyTypeDescription
namestringMetric name (e.g. "Survival Rate").
typestringMetric type (e.g. "chronological").
unitstringUnit (e.g. "%").
valuenumberMetric value.
updatedAtstringISO timestamp when metric was updated.

PlasticCollectionResponse Object

A plastic collection evidence object.

PropertyTypeDescription
type"PlasticCollection"Discriminator type.
accountIdstring (optional)Present only when related to the authenticated account.
collectorNamestringName of the collector.
buyerNamestringName of the buyer.
materialTypestringType of plastic material collected.
weightstringWeight of the collected plastic waste.
numberOfPlasticBottlesRescuednumberNumber of plastic bottles rescued (computed from weight).
geoJSONFeatureCollection (Point)Geometry of the plastic collection.
createdAtstringCreation time (ISO-8601).
externalIdstringExternal identifier for the plastic collection.