> ## Documentation Index
> Fetch the complete documentation index at: https://developers.partoo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get diffusion errors for a business

> Get diffusion errors for a given business.

This endpoint returns diffusion errors grouped by publisher. Diffusion errors are classified into two types:

- **Pre-check errors**: errors detected *before* sending data to partners, based on the current business data.
- **Post-check errors**: errors detected *after* sending data to partners, based on partner responses.

### Behavior
- If no input parameters are provided:
  - Returns the **existing** pre-check and post-check errors stored in the database.
- If input parameters are provided:
  - Applies the provided fields as an in-memory update on the business (without persisting).
  - Recalculates pre-check errors based on these changes.
  - Post-check errors are **not** recalculated in this case.

### Example Use Case
Use this endpoint during a business edit form to validate which publishers would be affected by a change, without saving it yet.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /diffusion_errors/{business_id}
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /diffusion_errors/{business_id}:
    post:
      tags:
        - Presence
      summary: Get diffusion errors for a business
      description: >
        Get diffusion errors for a given business.


        This endpoint returns diffusion errors grouped by publisher. Diffusion
        errors are classified into two types:


        - **Pre-check errors**: errors detected *before* sending data to
        partners, based on the current business data.

        - **Post-check errors**: errors detected *after* sending data to
        partners, based on partner responses.


        ### Behavior

        - If no input parameters are provided:
          - Returns the **existing** pre-check and post-check errors stored in the database.
        - If input parameters are provided:
          - Applies the provided fields as an in-memory update on the business (without persisting).
          - Recalculates pre-check errors based on these changes.
          - Post-check errors are **not** recalculated in this case.

        ### Example Use Case

        Use this endpoint during a business edit form to validate which
        publishers would be affected by a change, without saving it yet.
      operationId: getDiffusionErrorsForBusiness
      parameters:
        - $ref: '#/components/parameters/business_id'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              description: Partial business update for simulating changes
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/BusinessName'
                org_id:
                  $ref: '#/components/schemas/OrgId'
                country:
                  $ref: '#/components/schemas/BusinessCountry'
                zipcode:
                  $ref: '#/components/schemas/BusinessZipcode'
                city:
                  $ref: '#/components/schemas/BusinessCity'
                region:
                  $ref: '#/components/schemas/BusinessRegion'
                categories:
                  $ref: '#/components/schemas/BusinessCategories'
                code:
                  $ref: '#/components/schemas/BusinessCode'
                status:
                  $ref: '#/components/schemas/BusinessStatus'
                address_full:
                  $ref: '#/components/schemas/AddressFull'
                address2:
                  $ref: '#/components/schemas/Address2'
                manual_lat:
                  $ref: '#/components/schemas/BusinessLatitude'
                manual_long:
                  $ref: '#/components/schemas/BusinessLongitude'
                lat:
                  $ref: '#/components/schemas/BusinessLatitude'
                long:
                  $ref: '#/components/schemas/BusinessLongitude'
                website_url:
                  $ref: '#/components/schemas/BusinessWebsite'
                facebook_url:
                  $ref: '#/components/schemas/BusinessFacebookPage'
                twitter_url:
                  $ref: '#/components/schemas/BusinessTwitter'
                description_short:
                  $ref: '#/components/schemas/BusinessShortDescription'
                description_long:
                  $ref: '#/components/schemas/BusinessLongDescription'
                open_hours:
                  $ref: '#/components/schemas/OpenHours'
                specific_hours:
                  $ref: '#/components/schemas/SpecificHours'
                contacts:
                  $ref: '#/components/schemas/BusinessContactsCreate'
                photos:
                  $ref: '#/components/schemas/Photos'
                national_identification_number:
                  $ref: '#/components/schemas/BusinessNationalIdentificationNumber'
            examples:
              empty request body:
                description: Returns already stored pre-check and post-check errors
                value: {}
              filled request body:
                description: Simulates changes and recalculates pre-check errors
                value:
                  name: Corner Shop
                  country: US
                  zipcode: '90210'
                  city: Beverly Hills
                  region: CA
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                description: Diffusion errors grouped by section and field
                properties:
                  address:
                    type: object
                    description: Errors in the address section
                    additionalProperties:
                      type: array
                      items:
                        type: object
                        properties:
                          publisher:
                            type: string
                            example: google
                            description: The publisher associated with the error
                          errors:
                            type: array
                            items:
                              type: string
                              example: ABC_NAME_ENTIRELY_NUMERIC
                            description: A list of error keys
                          context:
                            type: object
                            description: Optional context for the error
                            nullable: true
                  infos:
                    type: object
                    description: Errors in the infos section
                    additionalProperties:
                      type: array
                      items:
                        type: object
                        properties:
                          publisher:
                            type: string
                          errors:
                            type: array
                            items:
                              type: string
                          context:
                            type: object
                            nullable: true
                  advanced-settings:
                    type: object
                    description: Errors in the advanced settings section
                    additionalProperties:
                      type: array
                      items:
                        type: object
                        properties:
                          publisher:
                            type: string
                          errors:
                            type: array
                            items:
                              type: string
                          context:
                            type: object
                            nullable: true
              examples:
                no errors:
                  value: {}
                with errors:
                  value:
                    infos:
                      name:
                        - publisher: google
                          errors:
                            - ABC_NAME_ENTIRELY_NUMERIC
                            - ABC_TOO_SHORT
                          context: null
                    advanced-settings:
                      national_identification_number:
                        - publisher: apple
                          errors:
                            - ABC_INVALID_ID
                          context:
                            id: '456'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
components:
  parameters:
    business_id:
      in: path
      name: business_id
      required: true
      schema:
        type: string
      description: >
        Business id.      


        It may be replaced by `c-{code}` where code is the store code, which
        should be unique per organization. This can be used only for
        `ORG_ADMIN`, `GROUP_MANAGER` and `BUSINESS_MANAGER` users.
  schemas:
    BusinessName:
      description: >-
        The name of the business (POI) as it will appear on the publishing
        platforms
      type: string
      minLength: 1
      example: Corner shop
    OrgId:
      description: Unique identifier of an organization in Partoo.
      type: integer
      example: 42
    BusinessCountry:
      description: >-
        Business country - In the ISO 3166 alpha2 code format (i.e. use “FR” for
        France instead of "fr")
      type: string
      example: FR
    BusinessZipcode:
      description: >-
        Zipcode (or postal code) for the business address. Can be empty if the
        business' country does not require one.
      type:
        - string
        - 'null'
      example: '75019'
    BusinessCity:
      description: The city where the business is located
      type:
        - string
        - 'null'
      example: Paris
    BusinessRegion:
      description: >-
        The region where the business is located. Can be empty, it is only
        useful for some countries like Italy or Spain among others.
      type:
        - string
        - 'null'
      example: Ile-de-France
    BusinessCategories:
      minItems: 1
      description: >
        A list of category ids mapped to the business. At least one category
        needs to be provided. For more information see [Categories
        section](/api-reference/categories/)
      type: array
      items:
        type: string
      example:
        - gcid:restaurant
        - gcid:fast_food_restaurant
        - gcid:hamburger_restaurant
    BusinessCode:
      description: >-
        The unique store code of the business. If not provided, it will be
        automatically generated
      type: string
      example: CS-75019
    BusinessStatus:
      description: >
        Defines the current status of the business. `open` indicates the
        business is up and running. `closed` means that the business has
        definitely closed. `closed_temporarily` means that the business is
        temporarily closed, it is advised when your business is closed for more
        than one week, otherwise use the `specific_hours`
      type: string
      enum:
        - open
        - closed
        - closed_temporarily
      default: open
      example: open
    AddressFull:
      description: |
        Full address of the business.

        For example : `130 Rue du Mont-Cenis`.
      type:
        - string
        - 'null'
      example: 12 bis rue du coquelicot
    Address2:
      description: >-
        Complement of address. Any additional information that could help better
        find the business location
      type:
        - string
        - 'null'
    BusinessLatitude:
      description: Latitude. Decimals are separated by a dot and not by a comma.
      type: number
      format: double
      example: -3.585993
    BusinessLongitude:
      description: Longitude. Decimals are separated by a dot and not by a comma.
      type: number
      format: double
      example: 47.870341
    BusinessWebsite:
      description: The business own website url or the main url of the company.
      type: string
      format: uri
      example: https://www.corner-shop.co/
    BusinessFacebookPage:
      description: Business Facebook page url
      type: string
      format: uri
      example: https://www.facebook.com/the-corner-shop
    BusinessTwitter:
      description: Business twitter page url
      type: string
      format: uri
      example: https://www.twitter.com/the-corner-shop
    BusinessShortDescription:
      description: |
        A short description of the business.    

        ⚠️ It is limited to 80 characters
      type: string
      example: lorem ipsum
    BusinessLongDescription:
      description: |
        A more detailed description of the business.    

        ⚠️ It is limited to 750 characters
      type: string
      example: lorem ipsum dolor sit amet
    OpenHours:
      description: >
        The opening hours of the business (in its timezone).


        Opening hours are specified per weekday. This is done by supplying an
        object mapping weekdays ("monday", "tuesday", etc.) to a list of
        strings. These strings in turn represent time slots during which the
        business is open.


        For example, the following value would set the opening hours to between
        08:00-15:00 in the afternoon and 18:00-23:00 in the evening on
        Mondays:  

        `{"monday": ["08:00-15:00", "18:00-23:00"]}`


        To indicate that a business is open 24 hours for a specific weekday, use
        the value `["00:00-23:59"]`.


        ❗ This field is not mandatory, but if not provided then the business
        will not be pushed on some platforms (example: Google).  

        If provided, then a schedule needs to be sent for each day in
        particular.
      type: object
      required:
        - monday
        - tuesday
        - wednesday
        - thursday
        - friday
        - saturday
        - sunday
      properties:
        monday:
          $ref: '#/components/schemas/Day'
        tuesday:
          $ref: '#/components/schemas/Day'
        wednesday:
          $ref: '#/components/schemas/Day'
        thursday:
          $ref: '#/components/schemas/Day'
        friday:
          $ref: '#/components/schemas/Day'
        saturday:
          $ref: '#/components/schemas/Day'
        sunday:
          $ref: '#/components/schemas/Day'
    SpecificHours:
      description: >
        Exceptional opening or closing times for the business (in its timezone).


        All exceptional days of the year, including temporarily closed, can be
        specified beforehand or on the go. For example:


        - Beforehand: bank holidays (like Christmas or Labor Day)  

        - Unpredicted: COVID-19 exceptional situation


        Specific hours are defined by two values:


        - `open`, containing a list of days with exceptional *opening* hours  

        - `close`, containing a list of days where the business is exceptionally
        closed all day


        These values in turn contain:


        - `starts_at` indicating the first date for which the exceptional hours
        are valid  

        - `ends_at` indicating the last date (inclusive) for which the
        exceptional hours are valid  

        - `open_hours` (only used for days with exceptional *opening* hours)
        indicating the actual time slots for the given period, following the
        same pattern as the time slots in `open_hours`
      type: object
      required:
        - open
        - close
      properties:
        open:
          type: array
          items:
            type: object
            properties:
              starts_at:
                type: string
                pattern: date
                example: '2020-01-20'
              ends_at:
                type: string
                pattern: date
                example: '2020-01-20'
              open_hours:
                type: array
                items:
                  $ref: '#/components/schemas/TimeWindow'
        close:
          type: array
          items:
            type: object
            properties:
              starts_at:
                type: string
                pattern: date
                example: '2020-01-20'
              ends_at:
                type: string
                pattern: date
                example: '2020-01-22'
    BusinessContactsCreate:
      description: >-
        Specify how the clients can reach the persons in charge of the business
        in case they have questions.
      type: array
      items:
        $ref: '#/components/schemas/Contact'
    Photos:
      description: |
        Business photos   

        Each business can have one or more photos associated
      type: object
      properties:
        LOGO:
          description: >-
            The logo image of the brand. On Google, for example, for businesses
            that have their basic information (phone number, hours, etc.), the
            Business Profile will highlight the logo.
          type: string
          format: uri
        primary:
          description: >-
            The business's main photo URL. On Google, for example, it represents
            the cover photo on the top of the profile.
          type: string
          format: uri
        secondary:
          description: Additional photos that can highlight the features of the business.
          type: array
          items:
            type: string
            format: uri
    BusinessNationalIdentificationNumber:
      description: >
        The National Identification Number of the business.


        It describes a unique number for which the business is registered in a
        specific country.  

        For example, in France, it's the SIRET code, or for Ireland, it's the
        CRO.
      type: string
    Day:
      description: >-
        Open in the morning and in the evening `[10:00-14:00, 18:00-00:00]`.
        Closed the whole day `[]`
      type: array
      items:
        $ref: '#/components/schemas/TimeWindow'
      example:
        - 10:00-14:00
    TimeWindow:
      description: Time window
      type: string
      pattern: ^([0-1][0-9]|2[0-3]):([0-5][0-9])-([0-1][0-9]|2[0-3]):([0-5][0-9])$
      example: 10:00-14:00
    Contact:
      description: Business contact
      type: object
      properties:
        name:
          description: Contact full name
          type: string
          example: Hubert Bonisseur de la Bath
        email:
          description: Contact email
          type: string
          format: email
          example: hubert@oss117.fr
        phone_numbers:
          description: >-
            Contact phone numbers - Preferably in the format E.164
            ('+33302060628' instead of '0302060628')
          type: array
          items:
            type: string
          example:
            - '+33302060628'
        fax:
          description: Contact fax
          type: string
          example: '+33302060629'
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````