Description and Overview

Representation

IdentifierTypeDescriptionRestrictions
countryCodeStringCountry code [ISO 3166-1] format[A-Z]{2}
languageCodeStringLanguage code [ISO 639-1] format[a-z]{2}
currencyUnitStringCurrency unit [ISO 4217] format[A-Z]{2}
taxPercentageIntegerTax percentage for storeMin: 0. Max: 40

Create your stores

swagger

curl --request PUT \
  --url https://api.${env}.brinkcommerce.com/productv1/stores \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '{
    "countryCode": "SE",
    "languageCode": "sv",
    "currencyUnit": "SEK",
    "tax": 0
  }'

Concept

Brink Commerce support webhooks on Order or Product status changes. If you need multiple hooks create them with different hook names.

Add webhook

To add a webhook you need to provide a name and callback URL for Brink Commerce to use

IdentifierTypeDescriptionRestrictions
nameStringName of the webhook. Requiredwebhook\.(order|product)\.(\w+)
data.urlStringCallback URL. RequiredURL
data.headersObjectOptional headers to send with the callback

Swagger

curl --request PUT \
  --url https://api.${env}.brinkcommerce.com/configurationv1/configurations/webhooks \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${api key}' \
  --data '[
    {
      "name": "webhook.${order|product}.newHookName",
      "data": {
        "url": "https://1527b018dffa8a2320879f1728e72958.m.pipedream.net",
        "headers": {
          "hello": "world"
        }
      }
    }
  ]'

Response

[
  {
    "service": "brink",
    "name": "webhook.${order|product}.newHookName",
    "data": {
      "url": "https://1527b018dffa8a2320879f1728e72958.m.pipedream.net",
      "headers": {
        "hello": "world"
      }
    }
  }
]

Brink Commerce will POST a sample message to the endpoint provided to verify its validity. If there was a problem for Brink Commerce to POST to the configured URL you will receive a 400 Bad Request

Verification message:

{
  "message": "Hello from Brink Commerce"
}

Order callback

Brink Commerce will send a callback for when there is a state change on order.

State values are (success|refunded|canceled|shipped|waiting)

Example of a callback:

{
  "service": "order",
  "state": "success",
  "orderId": "f3a1b916-63b5-469f-8654-2762d5ca8589"
}

Product callback

Brink Commerce will send a callback for when there is a state change on product.

State values are (created|updated)

Example of a callback:

{
  "service": "product",
  "state": "created",
  "productId": "e9fd11fb-ce94-4eee-a253-3c180a94f857"
}

##Description Products exist in Brink for processing orders and transaction purposes only, meaning there are no product information enrichment possibilities in Brink but rather transactional necessary information only such as SKU number, price and stock. Setting up a product is done using the product API. There are three different types of products within Brink

graph RL A[ERP] -- PRODUCT --> B[PIM] B -- ENRICHED PRODUCT --> C[CMS] B -- PRODUCT --> D[BRINK]

Product

Model Product has 5 different types

  • product
  • productVariant
  • shippingProvider
  • shippingOption
  • addon

Hooks can be configured for the different statuses of the product

Create product

Swagger

curl --request POST \
  --url https://api.${env}.brinkcommerce.com/productv1/products \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '[{
    "id": "product-id",
    "name": "Black socks",
    "type": "product",
    "category": "Socks",
  }]'

Create product variant related to the product

Swagger

curl --request POST \
  --url https://api.${env}.brinkcommerce.com/productv1/products \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '[{
    "id": "product-variant-id",
    "name": "Black socks size 9",
    "type": "productVariant",
    "category": "Socks",
    "price": [{
        "currencyUnit": "SEK",
        "amount": 20000
    }],
    "relatedProduct": "product-id"
  }]'

Create add-on

Swagger

curl --request POST \
  --url https://api.${env}.brinkcommerce.com/productv1/products \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '[{
    "id": "addon-id",
    "name": "Engraving",
    "type": "addon",
    "category": "Add-on",
    "price": [{
        "currencyUnit": "SEK",
        "amount": 5000
    }],
  }]'

Get product

Swagger

curl --request GET \
  --url https://api.${env}.brinkcommerce.com/productv1/products/product-id

Get products

Swagger

curl --request GET \
  --url 'https://api.${env}.brinkcommerce.com/productv1/products?ids=product-id,product-variant-id,addon-id'

Update product(s)

Swagger

curl --request PUT \
  --url https://api.${env}.brinkcommerce.com/productv1/products \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '[
    {
      "id": "product-id",
      "slug": "/t-shirt"
    }
  ]'

Link add-ons to a products

Add-ons can be linked to products either by 1) supplying a list of compatible product id:s when creating/updating an add-on, or 2) by supplying a list of compatible add-ons when creating/updating a product. Choose the method that is most suitable for your product/add-on structure. Note! addon links to product, not productVariant.

Link add-ons to a product

Swagger

curl --request PUT \
  --url https://api.${env}.brinkcommerce.com/productv1/products \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '[{
    "id": "product-id",
    "compatibleAddons": [ "addon-id" ]
  }]'

It is also possible to link add-ons to a product when first creating the product by adding the compatibleAddons field, see Create product.

Link products to an add-on

Swagger

curl --request PUT \
  --url https://api.${env}.brinkcommerce.com/productv1/products \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '[{
    "id": "addon-id",
    "compatibleProducts": [ "product-id" ]
  }]'

It is also possible to link products to an add-on when first creating the add-on by adding the compatibleProducts field, see Create product.

Search

All product are indexed in Elasticsearch. We support Elasticsearch query DSL

Swagger

curl --request POST \
  --url https://api.${env}.brinkcommerce.com/productv1/products/search \
  --header 'content-type: application/json' \
  --header 'x-api-key: ${product api key}' \
  --data '{
    "query": {
      "match": {
        "name": "t-shirt"
      }
    }
  }'

flowchart TB subgraph River Code A[Front End] --> B[Newsletter Sign Up] B[Newsletter] -- YES --> C[Create Member] D[Checkout] --> B end

#Multiple Warehouse

  • Products exist in Brink for processing orders and transaction purposes only,

  • Recommended is to limit information in Brink to transactional necessary information only.

  • If extra infromation is needed to be stored in Brink this is recommended to be added and stored using the customerAttribute object.

  • Setting up a product is done using the product managenent API. Model Product has 5 different types:

{ "firstName": "John", "lastName": "Smith", "age": 25 }