Reserve credits
This endpoint is relevant for partners that would like to process the payments themselves. It enables you to reserve credits which will be invoiced at an agreed billing frequency (see contract, f.ex. once per quarter).
Legend
❓ - clarification will be provided
⚪️ - discontinued
⏳ - TBD
🟡 - supported but requires changes
🟢 - supported
Request
Comparison
Term | Old API | New API |
---|---|---|
Endpoint | 🟢 POST /api/offset-certificate | 🟡 POST /compensations/v1/orders Offset by volume |
Authorization | 🟢 Via t (required) | 🟡 Via the Authorization request header (required) |
Specify projects | 🟢 Specify multiple projects and respective volumes via p (required) | 🟡 Single project id in criteria.ids[] and volume ⏳ Multi project support - TBD |
Specify currency | 🟢 Via c | 🟡 Via currency (enum) |
Provide additional notes | 🟢 Via n | ⚪️ Removed |
Redirect to success page | 🟢 Via r | ⚪️ Partner handles success page |
Language | 🟢 Via l | ⚪️ Partner handles localisation |
Referral Code | 🟢 Via rc | ⚪️ - discontinued |
Customer First Name | 🟢 Via billing_first_name (required) | 🟡 Via consumer.firstName (optional) |
Customer Last Name | 🟢 Via billing_last_name (required) | 🟡 Via consumer.lastName (optional) |
Customer Email | 🟢 Via billing_email (required) | 🟡 Via consumer.email (optional) |
Customer Company | 🟢 Via billing_company (required) | 🟡 Via consumer.company (optional) |
Customer Street | 🟢 Via billing_street (required) | 🟡 Via consumer.street (optional) |
Customer City | 🟢 Via billing_city (required) | 🟡 Via consumer.city (optional) |
Customer Zip | 🟢 Via billing_zip (required) | 🟡 Via consumer.zip (optional) |
Customer Country Code | 🟢 Via billing_country_code (required) | 🟡 Via consumer.country (optional) |
Customer name on certificate | 🟢 Via billing_name_on_certificate | ⚪️ consumer.firstName , consumer.lastName or consumer.company are used |
Skip emailing | 🟢 Via noemail | 🟡 Omit consumer.email |
Examples
curl --request POST \
--url https://sandbox.market-api.southpole.com/api/offset-certificate \
--header 'Content-Type: application/json' \
--data '{
"t": "token",
"p": {
"300190": "2",
"300990": "1"
},
"c": "USD",
"n": "notes...",
"r": "www.company.com",
"l": "en",
"rc": "referral code",
"billing_first_name": "John",
"billing_last_name": "Doe",
"billing_email": "[email protected]",
"billing_company": "Test company",
"billing_street": "1234 Main Street, Apartment 101",
"billing_city": "Washington",
"billing_zip": "77578",
"billing_country_code": "US",
"billing_name_on_certificate": "Test name",
"noemail": 0
}'
curl --request POST \
--url https://dcs-compensate-api-sandbox.southpole.com/v1/compensate/emission \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '
{
"volume": {
"unit": "t",
"quantity": "5"
},
"criteria": {
"ids": [
"7619267199133"
]
},
"currency": "EUR",
"consumer": {
"firstName": "John",
"lastName": "Doe"
}
}
'
Response
Comparison
Data Model (JSON path) | Old API | New API |
---|---|---|
Status | 🟢 status | ⚪️ Removed in favour of the HTTP client response status field |
Message | 🟢 msg | ⚪️ Removed (success is indicated with HTTP 200) |
Order ID | 🟢 orderId | 🟡 order.id |
Certificate ID | 🟢 certificateId | ⏳ TBD |
Examples
{
"status": "ok",
"msg": "Order saved. Certificate sent to email: [email protected]",
"orderId": 1598959529,
"certificateId": 1598959529
}
{
"order": {
"consumer": {
"firstName": "John",
"lastName": "Doe",
"country": "DEU"
},
"createdAt": "2023-01-19T13:26:31Z",
"id": "4802296938653",
"projects": [
{
"contribution": {
"amount": "30",
"currency": "EUR"
},
"id": "7619267199133",
"volume": {
"quantity": "5",
"unit": "t"
}
}
],
"status": "RESERVED",
"totalPrice": {
"amount": "30",
"currency": "EUR"
},
"totalVolume": {
"quantity": "5",
"unit": "t"
},
"updatedAt": "2023-01-19T13:26:31Z"
}
}
Updated over 1 year ago