/
NUTRINTG Webhook monitoring

NUTRINTG Webhook monitoring

Overview

Service name: p-webhook-monitoring(-test, -stage)

Service is monitoring if Shopify webhook works fine.

Schedulers

  • Customer

  • Order

Schedulers run twice a day and send each webhook status object to queue, then queue is subscribed in db-proxy service where the service save message in “webhook” collection.

Webhook status object

Name

Type

Description

Required

Name

Type

Description

Required

accountSource

string

Account Source of the shop integration in Middleware

true

domain

string

Shopify domain

true

operation

string

Const value: WEBHOOK_STATUS_INSERT

true

dateTime

datetime as string

Current date time with Europe/Warsaw timezone

true

webhook

string

Webhook name

true

isWorking

boolean

Webhook status (true|false)

true

cause

string

Error label

false

{ accountSource: "ACCOUNT_SOURCE", domain: "www.shopifydomain.test", operation: "WEBHOOK_STATUS_INSERT", dateTime: "2022-07-18T13:58:27.74531+02:00", webhook: "customers/update", isWorking: false, cause: "SOME_ERROR" }

REST endpoints

Application has following endpoints:

  • GET webhooks

  • POST webhook

  • DELETE webhook

  • UPDATE webhook

  • UPDATE webhook async

Endpoints are both private an requires application to be in the same network and public which requires Okta token.

GET webhooks

HTTP Method

GET

Public Endpoint

/shopify/webhook-monitoring

Private Endpoint

/shopify/webhook

Headers

token

string

Okta token. Required for public endpoint.

true

Query params

domain

string

 

true

accountSource

string

 

true

Name

Type

Description

Required

Name

Type

Description

Required

token

string

header

true

domain

string

query param

true

accountSource

string

query param

true

curl --location --request GET 'https://api.cdp-rb.com/test/shopify/webhook-monitoring?domain=durex-uk-test-store.myshopify.com&accountSource=POLDURECOMCUST' \ --header 'token: oktaTokenValue'
{ "webhooks": [ { "id": 1049024987194, "address": "https://api.cdp-rb.com/test/shopify/customer", "topic": "customers/create", "created_at": "2022-07-14T15:38:51+01:00", "updated_at": "2022-07-14T15:38:51+01:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "2019-07", "private_metafield_namespaces": [] }, { "id": 1049025019962, "address": "https://api.cdp-rb.com/test3/shopify/customer", "topic": "customers/create", "created_at": "2022-07-14T15:38:56+01:00", "updated_at": "2022-07-14T15:39:09+01:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "2019-07", "private_metafield_namespaces": [] }, { "id": 1049067454522, "address": "https://api.cdp-rb.com/test2/shopify/customer", "topic": "customers/create", "created_at": "2022-07-15T08:43:49+01:00", "updated_at": "2022-07-15T08:43:49+01:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "2019-07", "private_metafield_namespaces": [] } ] }

POST webhook

HTTP Method

POST

Public Endpoint

/shopify/webhook-monitoring

Private Endpoint

/shopify/webhook

Headers

token

string

Okta token. Required for public endpoint.

true

Body

domain

string

 

true

accountSource

string

 

true

webhookAddress

string

 

true

webhookName

string

 

true

DELETE webhook

HTTP Method

DELETE

Public Endpoint

/shopify/webhook-monitoring

Private Endpoint

/shopify/webhook

Headers

token

string

Okta token. Required for public endpoint.

true

Body

domain

string

 

true

accountSource

string

 

true

webhookAddress

string

 

true

webhookName

string

 

true

UPDATE webhook

HTTP Method

PUT

Public Endpoint

/shopify/webhook-monitoring

Private Endpoint

/shopify/webhook

Headers

token

string

Okta token. Required for public endpoint.

true

Body

domain

string

 

true

accountSource

string

 

false

newWebhookAddress

string

 

true

oldWebhookAddress

string

 

true

webhookName

string

 

true

UPDATE webhook async

HTTP Method

PUT

Public Endpoint

/shopify/webhook-monitoring/async

Private Endpoint

/shopify/webhook/async

Headers

token

string

Okta token. Required for public endpoint.

true

Body

domain

string

 

true

accountSource

string

 

false

newWebhookAddress

string

 

true

oldWebhookAddress

string

 

true

webhookName

string

 

true

Environments