API Reference
Log In
API Reference

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 or kelp.
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 or kelp.
amountnumberAmount means the number of trees, plastic bottles, kelp or kg of CO2.

ImpactPurchaseByValue Object

The ImpactPurchase represents a spending on a specific purpose.

PropertyTypeDescription
typeenumType can be trees, plastic, carbon or kelp.
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 or kelp.
amountnumberAmount means the number of trees, plastic bottles, kelp or kg of CO2.
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'
evidencesTransactionPurchaseMetadata[]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.

PropertyTypeDescription
keystringThe key of the evidence.
valueEvidenceImage | EvidenceGeoJSONThe value of the evidence. The type of the value varies, which is described by the type property.
typeenumThe enum string which defines the type of the value. Example: "EvidenceImage" | "EvidenceGeoJSON"
createdAtstringThe timestamp when the evidence was created in a ISO 8601 format.