With the Impacts endpoints you can create your impact with different sources, triggers and metadata.
| Property | Type | Description |
|---|
| impactPurchases | (ImpactPurchase | ImpactPurchaseByValue)[] | The impactPurchases array contains your spending on various impacts such as trees, plastic, carbon, kelp, water or bees. |
| estimationId | string | The id of the estimation that was used to calculate the impact. You can use it to connect an impact with an estimation. |
| projectId | string | The id of the project where the impact is made. |
| metadata | Metadata[] | 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. |
The ImpactPurchase represents a spending on a specific purpose.
| Property | Type | Description |
|---|
| type | enum | Type can be trees, plastic, carbon, kelp, water or bees. |
| amount | number | Amount means the number of trees, plastic bottles, kelp, kg of CO2, days of water supplied or bees protected. |
The ImpactPurchase represents a spending on a specific purpose.
| Property | Type | Description |
|---|
| type | enum | Type can be trees, plastic, carbon, kelp, water or bees. |
| value | number | Value of the impacts to be purchased in the account’s currency. |
With the Metadata object, you can differentiate your Impacts later.
| Property | Type | Description |
|---|
| key | string | Minimum 1, maximum 40 characters. |
| value | string | Minimum 1, maximum 500 characters. |
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".
The ImpactPurchase represents an impact purchase from our project partners.
| Property | Type | Description |
|---|
| id | string | The id of the purchase |
| type | enum | Type can be trees, plastic, carbon, kelp, water or bees. |
| amount | number | Amount means the number of trees, plastic bottles, kelp, kg of CO2, days of water supplied or bees protected. |
| projectId | string | The id of the project where the impact is made. |
| receiptUrl | string | The receipt url which serves as a proof that the purchase was made. |
| provider | string | The slug of the project partner's name. |
| periodStartDate | string | The start of the period Greenspark made the purchase for. Example: '2024-01-01' |
| periodEndDate | string | The end of the period Greenspark made the purchase for. Example: '2024-01-31' |
| evidences | EvidenceResponse[] | A list of evidences (exposed from the metadata field in the API response). Each item is a discriminated union; see EvidenceResponse below. |
EvidenceResponse is a discriminated union. The discriminator field is type.
Supported type values:
PlantingSession
PlasticCollection
A planting session evidence object.
| Property | Type | Description |
|---|
| type | "PlantingSession" | Discriminator type. |
| fieldUpdateId | number | Unique identifier of the field update. |
| accountId | string (optional) | Present only when related to the authenticated account. |
| siteAssessment | SiteAssessmentResponse | Site assessment details. |
| planting | PlantingDetailsResponse | Planting details. |
| blockchain | PlantingSessionBlockchainResponse | Blockchain references for this planting session. |
| survivabilityStats | SurvivabilityStats (optional, nullable) | Optional survivability stats. |
| externalReports | ExternalReportResponse[] (optional) | External reports attached to this session. |
| altitude | number | Altitude. |
| longitude | number | Longitude. |
| latitude | number | Latitude. |
| site | VeritreeSubsiteResponse | Subsite associated with this session. |
| Property | Type | Description |
|---|
| plantingSite | string | null | Planting site name. |
| assessedAt | string | null | ISO timestamp when the assessment was done. |
| assessorName | string | null | Assessor full name. |
| notes | string (optional) | null | Notes captured during assessment. |
| images | EvidenceImageResponse[] (optional) | Images attached to the assessment. |
| geoJSON | FeatureCollection[] (optional) | GeoJSON objects attached to the assessment. |
| videos | EvidenceVideoResponse[] (optional) | Videos attached to the assessment. |
| Property | Type | Description |
|---|
| datePlanted | string | null | ISO date when the planting happened. |
| startTime | string | null | Planting start time (ISO-8601). |
| endTime | string | null | Planting end time (ISO-8601). |
| siteForester | string | null | Name of the site forester. |
| numberOfPlanters | number | null | Number of planters. |
| notes | string (optional) | null | Notes captured during planting. |
| amountPlanted | number (optional) | null | Total amount planted during this session. |
| images | EvidenceImageResponse[] (optional) | Images attached to planting details. |
| geoJSON | FeatureCollection[] (optional) | GeoJSON objects attached to planting details. |
| videos | EvidenceVideoResponse[] (optional) | Videos attached to planting details. |
| species | PlantingSpeciesResponse[] (optional) | Species breakdown for this planting session. |
| Property | Type | Description |
|---|
| name | string | Species common name. |
| amountPlanted | number | Amount planted for this species. |
| Property | Type | Description |
|---|
| transactionId | string | null | Blockchain transaction id. |
| arweaveUrl | string | null | Arweave URL, if available. |
| ipfsUrl | string | null | IPFS URL, if available. |
| Property | Type | Description |
|---|
| type | "ExternalReport" | Discriminator type. |
| externalId | string | External report id. |
| title | string | null | External report title. |
| reportedAt | string | null | ISO date when this report was reported. |
| fieldUpdateId | number | Field update id associated with this report. |
| images | EvidenceImageResponse[] (optional) | Images attached to this report. |
| geoJSON | FeatureCollection[] (optional) | GeoJSON objects attached to this report. |
| videos | EvidenceVideoResponse[] (optional) | Videos attached to this report. |
| Property | Type | Description |
|---|
| altitude | number | Altitude. |
| longitude | number | Longitude. |
| latitude | number | Latitude. |
| url | string | Public URL of the image. |
| previewUrl | string (optional) | Optional preview URL of the image. |
| alt | string (optional) | Alternate text for the image. |
| Property | Type | Description |
|---|
| altitude | number | Altitude. |
| longitude | number | Longitude. |
| latitude | number | Latitude. |
| url | string | Public URL of the video. |
| previewUrl | string (optional) | Optional preview URL of the video. |
| alt | string (optional) | Alternate text for the video. |
| Property | Type | Description |
|---|
| type | "SurvivabilityStats" | Discriminator type. |
| fieldUpdateId | number | Field update id (Veritree). |
| metrics | SurvivabilityMetric[] | Survivability metrics for this field update. |
| Property | Type | Description |
|---|
| name | string | Metric name (e.g. "Survival Rate"). |
| type | string | Metric type (e.g. "chronological"). |
| unit | string | Unit (e.g. "%"). |
| value | number | Metric value. |
| updatedAt | string | ISO timestamp when metric was updated. |
A plastic collection evidence object.
| Property | Type | Description |
|---|
| type | "PlasticCollection" | Discriminator type. |
| accountId | string (optional) | Present only when related to the authenticated account. |
| collectorName | string | Name of the collector. |
| buyerName | string | Name of the buyer. |
| materialType | string | Type of plastic material collected. |
| weight | string | Weight of the collected plastic waste. |
| numberOfPlasticBottlesRescued | number | Number of plastic bottles rescued (computed from weight). |
| geoJSON | FeatureCollection (Point) | Geometry of the plastic collection. |
| createdAt | string | Creation time (ISO-8601). |
| externalId | string | External identifier for the plastic collection. |