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

# Create or update a price list

> One price list per request (up to 1000 prices), matched by your external_id. Prices are excl. VAT in each product's currency. By default listed products are added or updated; with replace: true products not listed are removed from the list. Products that cannot be found are returned in unmatched_products and the rest is saved.

Requires the `pricing:write` scope.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/price_lists
openapi: 3.1.0
info:
  title: BrandGate API
  version: 1.0.0
  description: >-
    Connect your ERP or software to BrandGate: read orders, products, customers
    and invoices; acknowledge orders and set their shipping status; create and
    update products, price lists and customers; set stock. Writes are batch
    upserts keyed by your own `external_id`, safe to repeat, and accept an
    `Idempotency-Key` header. Authenticate with an organization API key or an
    OAuth access token as `Authorization: Bearer <token>`.
servers:
  - url: https://api.brandgate.dev
security:
  - apiKey: []
  - oauth2: []
tags:
  - name: orders
    description: Orders placed by resellers.
  - name: products
    description: The product catalogue.
  - name: price_lists
    description: Customer price lists.
  - name: inventory
    description: Stock levels per SKU.
  - name: customers
    description: Resellers buying from the organization.
  - name: invoices
    description: Invoices sent to resellers.
  - name: webhook_endpoints
    description: Where BrandGate sends events.
paths:
  /v1/price_lists:
    post:
      tags:
        - price_lists
      summary: Create or update a price list
      description: >-
        One price list per request (up to 1000 prices), matched by your
        external_id. Prices are excl. VAT in each product's currency. By default
        listed products are added or updated; with replace: true products not
        listed are removed from the list. Products that cannot be found are
        returned in unmatched_products and the rest is saved.


        Requires the `pricing:write` scope.
      operationId: price_listsUpsert
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                external_id:
                  type: string
                  minLength: 1
                  maxLength: 100
                  pattern: ^[\p{L}\p{N} ._\-/#:+]+$
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      product_external_id:
                        type: string
                        minLength: 1
                        maxLength: 100
                        pattern: ^[\p{L}\p{N} ._\-/#:+]+$
                      sku:
                        type: string
                        minLength: 1
                        maxLength: 200
                      unit_price:
                        type: string
                        pattern: ^\d{1,10}(\.\d{1,2})?$
                    required:
                      - unit_price
                    additionalProperties: false
                  maxItems: 1000
                replace:
                  type: boolean
                source_updated_at:
                  type: string
                  format: date-time
              required:
                - external_id
              additionalProperties: false
      responses:
        '200':
          description: Success.
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    const: price_list_sync
                  id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  external_id:
                    type: string
                    maxLength: 100
                  result:
                    type: string
                    enum:
                      - created
                      - updated
                      - unchanged
                      - error
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - stale_write
                          - missing_field
                          - sku_conflict
                          - name_taken
                          - customer_exists
                          - unknown_product
                          - unknown_price_list
                          - invalid_value
                          - plan_limit_reached
                      message:
                        type: string
                        maxLength: 300
                    required:
                      - code
                      - message
                    additionalProperties: false
                  items:
                    type: object
                    properties:
                      added:
                        type: integer
                      updated:
                        type: integer
                      unchanged:
                        type: integer
                      removed:
                        type: integer
                    required:
                      - added
                      - updated
                      - unchanged
                      - removed
                    additionalProperties: false
                  unmatched_products:
                    type: array
                    items:
                      type: string
                required:
                  - object
                  - id
                  - external_id
                  - result
                  - items
                  - unmatched_products
                additionalProperties: false
        '400':
          description: The request is invalid. `error.message` says which field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, unknown, expired or revoked credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The credentials lack the scope this operation needs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited. Wait until `X-RateLimit-Reset` (or `Retry-After`
            seconds).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
        - oauth2:
            - pricing:write
components:
  headers:
    RequestId:
      description: Quote this when contacting support.
      schema:
        type: string
        format: uuid
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An organization API key (`bg_live_…`), created in BrandGate under
        Settings → API & MCP.
    oauth2:
      type: oauth2
      description: >-
        For partner apps acting for many organizations. Authorization code with
        PKCE (S256).
      flows:
        authorizationCode:
          authorizationUrl: https://api.brandgate.dev/oauth/authorize
          tokenUrl: https://api.brandgate.dev/oauth/token
          refreshUrl: https://api.brandgate.dev/oauth/token
          scopes:
            orders:read: Read orders and their lines
            orders:write: Acknowledge orders and set their shipping status and tracking
            products:read: Read products and prices
            products:write: Create and update products and their base prices
            pricing:read: Read price lists
            pricing:write: Create and update price lists and their prices
            inventory:read: Read stock levels
            inventory:write: Update stock levels by SKU
            customers:read: Read customers (resellers), including contact details
            customers:write: Create and update customers and assign their price list
            invoices:read: Read invoices
            webhooks:read: List webhook endpoints
            webhooks:write: Create and delete webhook endpoints

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.