Skip to main content

Getting started with the Business API

Use the Coolblue Business API to show Coolblue products in your systems, check delivery options and place orders for your business customers. This guide takes you from credentials to your first order in Acceptance.

Before you start​

  • An active business agreement with Coolblue.
  • Acceptance credentials (client_id and client_secret) for the Business API. See Authentication.
  • Your businessCustomerId, the Coolblue customer that is invoiced for the orders.

1. Get an access token​

TOKEN=$(curl -s -X POST "https://auth.business.coolblue-acceptance.eu/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET" | jq -r .access_token)

Reuse the token until it expires.

2. Look up a product​

The product endpoint has its own host:

curl "https://products.business.coolblue-acceptance.eu/products/900001" \
-H "Authorization: Bearer $TOKEN" \
-H "User-Agent: Coolblue-YourCompanyName" \
-H "Accept-Language: nl-NL"

3. Check how the basket can be delivered​

curl -X POST "https://business.coolblue-acceptance.eu/deliveries/propositions" \
-H "Authorization: Bearer $TOKEN" \
-H "User-Agent: Coolblue-YourCompanyName" \
-H "Content-Type: application/json" \
-d '{
"businessCustomerId": "12345",
"shipmentAddress": {
"street": "Weena", "houseNumber": "664",
"postalCode": "3012CN", "city": "Rotterdam", "countryIsoCode": "NL"
},
"products": [{ "id": "900001", "quantity": 1 }]
}'
{ "availableDeliveryPropositions": ["nextDay"] }

If you get ["coolblueTimeSlots"] instead, book a time slot first. The Delivery & time slots guide explains every outcome, including mixed orders with large and small products.

4. Place the order​

curl -X POST "https://business.coolblue-acceptance.eu/orders" \
-H "Authorization: Bearer $TOKEN" \
-H "User-Agent: Coolblue-YourCompanyName" \
-H "Content-Type: application/json" \
-d '{
"businessCustomerId": 12345,
"recipient": {
"address": {
"firstName": "Jane", "lastName": "Doe",
"street": "Weena", "streetNumber": 664,
"postalCode": "3012CN", "city": "Rotterdam", "countryCode": "NL"
},
"languageCode": "nl",
"email": "jane.doe@example.com",
"telephoneNumber": "+31612345678"
},
"products": [{ "productId": 900001, "quantity": 1 }]
}'

The response contains the orderId. Orders in Acceptance are never fulfilled.

5. Go live​

  1. Request Production credentials.
  2. Switch the hosts to the Production ones listed in Environments.

Common pitfalls​

  • Forgetting the User-Agent header: the firewall can block the request with 403.
  • Calling /products on the orders host instead of the products host.
  • Placing an order without a timeslot when the propositions response was ["coolblueTimeSlots"]: you get 422.
  • Using a token from the wrong environment: you get 401.

Next steps​