Initiate an order

This endpoint allows reserving X credits with a immediate payment via web checkout

Legend

❓ - clarification will be provided
⚪️ - discontinued
⏳ - TBD
🟡 - supported but requires changes
🟢 - supported

Request

Comparison

TermOld APINew API
Endpoint🟢 POST /api/offset🟡 POST /v1/checkout Offset by web checkout
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
Language🟢 Via l⏳ TBD
Referral Code🟢 Via rc⏳ TBD
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

Examples

curl --request POST \
  --url https://sandbox.market-api.southpole.com/api/offset \
  --header 'Content-Type: application/json' \
  --data '{
  "t": "token",
  "p": {
    "300190": "2",
    "300990": "1.33"
  },
  "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"
}'
curl --request POST \
     --url https://dcs-compensate-api-sandbox.southpole.com/v1/checkout \
     --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 APINew API
Status🟢 status⚪️ Removed in favour of the HTTP client response status field
Message🟢 msg⚪️ Removed (success is indicated with HTTP 200)
Redirect to🟢 redirectTo🟡 webUrl (redirect user to payment page)
Timestamp🟢 timestamp⚪️ Removed
Valid until🟢 validUntil⚪️ Removed
Transaction hash🟢 transactionHash⚪️ Removed

Examples

{
  "status": "ok",
  "redirectTo": "https://sandbox.market-api.southpole.com/api/finalize?h=53b0e43b73d9a8307b11ccf20aba68fac0fedd87",
  "timestamp": 1603361187,
  "validUntil": "2020/10/22 10:36:27,",
  "transactionHash": "53b0e43b73d9a8307b11ccf20aba68fac0fedd87"
}
{
  "webUrl": "https://sandbox.market-api.southpole.com/api/finalize?h=53b0e43b73d9a8307b11ccf20aba68fac0fedd87"
}