Order API

Write Call

UpdateEntities1

Creates or updates entities in a specified entity set.

Kind Write API call
Method POST
URL https://app.bubblehouse.com/api/v20230601/<shop>/UpdateEntities1
Authentication Shop Token

Entities are flexible, low-overhead objects used to store domain-specific data like authorized sellers, store locations, or partner lists. Each entity belongs to an entity set, which defines the type and purpose of the entities within it.

Entity lookup: When processing each entity in the request, Bubblehouse uses a dual-lookup strategy to find existing entities: by id (if provided), and by title.

When replace_entities is true, any entities in the entity set that are not mentioned in this request will be marked as deleted. This is useful for full synchronization scenarios where you want the entity set to exactly match your source data.

This func will not return an error unless the entity set is not found or the request is malformed. Specific entity data does not undergo validation.

Input

  • entity_set string required

    API name of the target entity set.

    Entity sets are configured by the Bubblehouse team and define the type of entities they contain. Each entity set has a unique API name that you use to reference it.

  • entities array of Entity1 required

    Entities to create or update.

  • replace_entities boolean optional

    Delete any entities not mentioned in this call.

    When true, entities in the target set that are not included in this request will be deleted. Use this for full synchronization where the provided list should be the complete set of active entities.

    When false (default), entities not in this request are left unchanged.

  • debug boolean optional

    True to make it easier to debug this call

    Normally, we do not guarantee that updates are processed synchronously. We might do that, or we might return success from this function immediately and queue processing until a later time. Passing "debug": true ensures that processing is immediate and synchronous, and will also fail the call on any warnings, making it easier to diagnose problems.

    Please ensure to never enable debug mode in production, or even during high-volume testing.

Output

A successful response has no meaningful properties and only contains an ok property always set to true:
{"ok": true}

Usage Examples

Creating Authorized Dealers

Create a list of authorized dealers for receipt validation. Each dealer has a title and alternative titles that can be matched against receipt data.

Request

{
  "entities": [
    {
      "alt_titles": [
        "Wal-Mart",
        "Walmart Supercenter"
      ],
      "id": "dealer-001",
      "title": "Walmart"
    },
    {
      "alt_titles": [
        "Target Store"
      ],
      "id": "dealer-002",
      "title": "Target"
    }
  ],
  "entity_set": "authorized-dealers"
}

Response

{
  "ok": true
}

Full Sync with Replace Mode

Replace all entities in the set with the provided list. Any existing entities not in this request will be marked as deleted.

Request

{
  "entities": [
    {
      "id": "dealer-001",
      "title": "Walmart"
    },
    {
      "id": "dealer-003",
      "title": "Best Buy"
    }
  ],
  "entity_set": "authorized-dealers",
  "replace_entities": true
}

Response

{
  "ok": true
}

After this call, dealer-002 (Target) from the previous example would be marked as deleted, while dealer-001 is preserved and dealer-003 is created.

Market-Filtered Entities

Create entities that are only visible in specific markets. Useful for region-specific dealers or partners.

Request

{
  "entities": [
    {
      "id": "dealer-uk-001",
      "markets": [
        "en-GB"
      ],
      "title": "Tesco"
    },
    {
      "id": "dealer-us-001",
      "markets": [
        "en-US"
      ],
      "title": "Kroger"
    }
  ],
  "entity_set": "authorized-dealers"
}

Response

{
  "ok": true
}

Localized Entity Titles

Provide localized titles for entities that need to appear differently in different markets.

Request

{
  "entities": [
    {
      "id": "dealer-global-001",
      "localizations": {
        "de-DE": {
          "alt_titles": [
            "GM Deutschland"
          ],
          "title": "Global Markt"
        },
        "en-GB": {
          "alt_titles": [
            "GM UK"
          ],
          "title": "Global Mart UK"
        }
      },
      "title": "Global Mart"
    }
  ],
  "entity_set": "authorized-dealers"
}

Response

{
  "ok": true
}

Specific Errors

Status Error Reason & Examples
400 entity_set_not_found

The entity set API name you've specified does not match any configured entity sets.

Global Errors

Status Error Reason & Examples
429 rate_limit_exceeded

Your usage is over the rate limit. Ensure that you're not making duplicate calls, and contact our team for a rate limit increase.

400 invalid_global_api_version

The global API version you are trying to use has never existed.

400 obsolete_global_api_version

The global API version you are trying to use is no longer supported.

400 inaccessible_global_api_version

The global API version you are trying to use is not enabled on your account.

401 invalid_token

The provided authentication token is invalid or has expired.

Previous
UpdateCustomers3