With the Impacts endpoints you can create your impact with different sources, triggers and metadata.
Impact Object
Property | Type | Description |
---|---|---|
impactPurchases | (ImpactPurchase | ImpactPurchaseByValue)[] | The impactPurchases array contains your spending on various impacts such as trees, plastic, carbon or kelp. |
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. |
ImpactPurchase Object
The ImpactPurchase represents a spending on a specific purpose.
Property | Type | Description |
---|---|---|
type | enum | Type can be trees, plastic, carbon or kelp. |
amount | number | Amount means the number of trees, plastic bottles, kelp or kg of CO2. |
ImpactPurchaseByValue Object
The ImpactPurchase represents a spending on a specific purpose.
Property | Type | Description |
---|---|---|
type | enum | Type can be trees, plastic, carbon or kelp. |
value | number | Value of the impacts to be purchased in the account’s currency. |
Metadata Object
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. |
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.
Property | Type | Description |
---|---|---|
id | string | The id of the purchase |
type | enum | Type can be trees, plastic, carbon or kelp. |
amount | number | Amount means the number of trees, plastic bottles, kelp or kg of CO2. |
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 | TransactionPurchaseMetadata[] | A list of evidences serve as a proof that the purchase was made. It can contains various evidences, such as images of tree planting, GPS routes of planting sessions, etc |
TransactionPurchaseMetadata Object
The ImpactPurchase represents an impact purchase from our project partners.
Property | Type | Description |
---|---|---|
key | string | The key of the evidence. |
value | EvidenceImage | EvidenceGeoJSON | The value of the evidence. The type of the value varies, which is described by the type property. |
type | enum | The enum string which defines the type of the value. Example: "EvidenceImage" | "EvidenceGeoJSON" |
createdAt | string | The timestamp when the evidence was created in a ISO 8601 format. |