Create a post-purchase SDK session
Call POST /v3/post-purchase/sessions to create a session for the post-purchase SDK. The response returns a sessionId and clientSecret that you pass to the frontend SDK to render the impact experience on your confirmation page.
For SDK initialisation, events and the difference between the embedded and takeover variants, see Post-purchase web SDKs.
You can omit
merchantif the organisation has an MCC set at organisation level.
Making the request
The request requires organisationId, sdkVariant, consumer and transaction. You can optionally set impactType to carbon or nature (defaults to carbon if omitted).
sdkVariant determines the frontend experience:
embedded: renders inside a container on your existing confirmation pagetakeover: renders as a full-page experience between payment and order confirmation
{
"organisationId": "2f6d6b1f-1c6a-4e9a-9c15-7b8a0db1a2c3",
"impactType": "carbon",
"sdkVariant": "embedded",
"consumer": {
"reference": "consumer_123",
"postalCode": "SW1A 1AA",
"city": "London",
"countryCode": "GBR"
},
"merchant": {
"name": "Blossom & Bloom",
"mcc": "5992",
"address": {
"line1": "Ground floor",
"line2": "45 Rosewood Avenue",
"city": "London",
"postalCode": "SW1A 1AA",
"countryCode": "GBR"
}
},
"transaction": {
"amount": 47.97,
"currencyCode": "GBP"
},
"orderItems": [
{
"itemReference": "line_1",
"sku": "POT_MEDIUM",
"description": "Flower pot",
"category": "pots",
"quantity": 3,
"unitPrice": {
"value": 15.99,
"currencyCode": "GBP"
}
}
],
"projectFilters": {
"matchConsumerLocation": true
}
}orderItems are optional and not used in the footprint calculation, but are recommended for analytics and reporting.
Set projectFilters.matchConsumerLocation to true to prioritise projects near the consumer's location.
The response
A successful request returns HTTP 200 with a session you can use to initialise the frontend SDK.
{
"sessionId": "a3d8f6b2-9c14-4e7a-b8d5-2e6f1a3c9b78",
"clientSecret": "cs_live_a94f2e7b1c3d4e5f9a0b_secret_K8mQ2R",
"quoteId": "7b4f1b1b-47a0-4c2a-a5ed-2cfe5bfc2c4a",
"expiresAt": "2026-01-07T17:17:59Z"
}Pass sessionId and clientSecret to the post-purchase SDK on the frontend. The quoteId is for your records and can be used to trace the session back to the underlying quote.
Sessions expire at the time shown in
expiresAt. Create a new session if the current one has expired.
