Get started with Brink Commerce API
About the guide
The purpose of this guide is to walk you through direct integration with Brink Commerce API and get you acquainted with Brink Merchant Portal, our administrative interface.
We use Klarna as the payment method in this example to minimize the number of required steps and preparation.
How it works
This basic integration with Brink Commerce API consists of four main steps.
- It starts with setting up all the prerequisites in the Brink Merchant Portal; a
Store group
withStore markets
,Inventories
,Payment providers
, andShipping providers
.
Authentication
Brink Commerce API requires OAuth 2.0 authorization and a custom HTTP header, x-api-key
, for authentication in every API request.
Get bearer token
curl 'https://brinkcommerce-${env}.auth.eu-west-1.amazoncognito.com/oauth2/token' \
-H 'authorization: Basic {Base64Encode(client_id:client_secret)}' \
-H 'content-type: application/x-www-form-urlencoded' \
--data-raw 'grant_type=client_credentials' \
--compressed
Response:
{"access_token":${accessToken},"expires_in":7200,"token_type":"Bearer"}
Now you can use the Bearer token and x-api-key
header for authorization.
Note
Requests to shopper.eu-west-1.{env}.brinkcommerce.io/shopper
doesn't need Oath 2.0 authorization or x-api-key
Prerequisites
To be able to complete all the steps previously described, you need the following:
- API credentials to a Brink Commerce test environment - Don't have them yet? Get in touch.
- A Brink Merchant Portal user
- A website where you can embed the Klarna Checkout snippet
- A server backend of your choice to make HTTP requests towards Brink Commerce API.