Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

Stock Update API Endpoint

Purpose:

Allow to update stock level real time.

API Endpoint Details:

Method

Endpoint

POST

/api/customwebhook/stock/update

Request Headers:

Header

Required

Description

Content-Type

Yes

application/json

X-API-KEY

Yes

API key for authentication

Request Payload (JSON):

{
  "id": "1622203826274",
  "variantId": "14607116304482",
  "stock": 1,
  "shopDomain": "https://www.jbhifi.com.au"
}

Field Description:

  • id (string, required) - The product id.

  • variantId (string, required) - The variant id.

  • stock (integer, required) - The new stock count..

  • shopDomain (string, required) - The shop domain, use to get tenant details in db.

Response:

  • Status code 200 (Automatically send the response if API key is valid and process the update in queue).

  • Status code 401 Unauthorised

{
  "error": "Invalid API Key"
}
  • Status code 400 Validation Error

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "$": [
      "JSON deserialization for type 'Preezie.Greenback.Importer.Application.ProductWebhook.Commands.CustomPriceUpdateCommand' was missing required properties including: 'shopDomain'."
    ],
    "command": [
      "The command field is required."
    ]
  },
  "traceId": "00-a63adea0f8289d1b82789107de0bbdf4-888ae9d6b5273ae5-01"
}

Product Delete API Endpoint

Purpose:

Allow to delete product real time.

API Endpoint Details:

Method

Endpoint

POST

/api/customwebhook/product/delete

Request Headers:

Header

Required

Description

Content-Type

Yes

application/json

X-API-KEY

Yes

API key for authentication

Request Payload (JSON):

{
  "id": "1622203826274",
  "shopDomain": "https://www.jbhifi.com.au"
}

Field Description:

  • id (string, required) - The product id.

  • shopDomain (string, required) - The shop domain, use to get tenant details in db.

Response:

  • Status code 200 (Automatically send the response if API key is valid and process the update in queue).

  • Status code 401 Unauthorised

{
  "error": "Invalid API Key"
}
  • Status code 400 Validation Error

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "$": [
      "JSON deserialization for type 'Preezie.Greenback.Importer.Application.ProductWebhook.Commands.CustomPriceUpdateCommand' was missing required properties including: 'shopDomain'."
    ],
    "command": [
      "The command field is required."
    ]
  },
  "traceId": "00-a63adea0f8289d1b82789107de0bbdf4-888ae9d6b5273ae5-01"
}

Price Update API Endpoint

Purpose:

Allow to update product variant price real time.

API Endpoint Details:

Method

Endpoint

POST

/api/customwebhook/price/update

Request Headers:

Header

Required

Description

Content-Type

Yes

application/json

X-API-KEY

Yes

API key for authentication

Request Payload (JSON):

{
  "id": "1622203826274",
  "variantId": "14607116304482",
  "price": 500.32,
  "originalPrice": 700.53,
  "shopDomain": "https://www.jbhifi.com.au"
}

Field Description:

  • id (string, required) - The product id.

  • variantId (string, required) - The variant id.

  • Price (decimal, required) - The new variant price.

  • OriginalPrice (decimal, required) - The new original price for sale.

  • shopDomain (string, required) - The shop domain, use to get tenant details in db.

Response:

  • Status code 200 (Automatically send the response if API key is valid and process the update in queue).

  • Status code 401 Unauthorised

{
  "error": "Invalid API Key"
}
  • Status code 400 Validation Error

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "$": [
      "JSON deserialization for type 'Preezie.Greenback.Importer.Application.ProductWebhook.Commands.CustomPriceUpdateCommand' was missing required properties including: 'shopDomain'."
    ],
    "command": [
      "The command field is required."
    ]
  },
  "traceId": "00-a63adea0f8289d1b82789107de0bbdf4-888ae9d6b5273ae5-01"
}

Product Create API Endpoint

Purpose:

Allow to create product real time.

API Endpoint Details:

Method

Endpoint

POST

/api/customwebhook/product/create

Request Headers:

Header

Required

Description

Content-Type

Yes

application/json

X-API-KEY

Yes

API key for authentication

Request Payload (JSON):

{
  "product": {
    "id": "string",
    "title": "string",
    "body_html": "string"
    ...
  },
  "shopDomain": "string"
}

Field Description:

  • product (object, required) - The product object, Can receive different product JSON schema.

  • shopDomain (string, required) - The shop domain, use to get tenant details in db.

Response:

  • Status code 200 (Automatically send the response if API key is valid and process the update in queue).

  • Status code 401 Unauthorised

{
  "error": "Invalid API Key"
}
  • Status code 400 Validation Error

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "$": [
      "JSON deserialization for type 'Preezie.Greenback.Importer.Application.ProductWebhook.Commands.CustomPriceUpdateCommand' was missing required properties including: 'shopDomain'."
    ],
    "command": [
      "The command field is required."
    ]
  },
  "traceId": "00-a63adea0f8289d1b82789107de0bbdf4-888ae9d6b5273ae5-01"
}

Authentication & Security

  • API Key Authentication - Clients must send a valid X-API-KEY header.

  • Tenant-Level Isolation - Each tenant has a unique web hook API key for security

  • No labels