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

# Price lines

> Price up to 100 lines in one idempotent call, each with the reason stack that produced it.



## OpenAPI

````yaml POST /api/v1/prices
openapi: 3.1.0
info:
  title: Elastly API
  version: 1.0.0
  description: >-
    Elastly public API v1: price serving, canonical ingest, write-back claims
    and webhooks. Authenticate every request with an API key: Authorization:
    Bearer elastly_live_...
  contact:
    name: Elastly
    url: https://elastly.io
    email: support@elastly.io
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://app.elastly.io
security:
  - apiKey: []
tags:
  - name: prices
    description: 'Price serving: batch, idempotent, explainable.'
  - name: ingest
    description: Staged canonical ingest drained by the sync engine.
  - name: writebacks
    description: Claim and acknowledge approved price write-backs.
paths:
  /api/v1/prices:
    post:
      tags:
        - prices
      summary: Price up to 100 lines in one idempotent call
      description: >-
        Requires an erp-scope key. Every response line is either a priced output
        (ok: true) or a typed per-line error (ok: false); a single bad line
        never fails the batch.
      operationId: getPrices
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Unique key for this logical request. Retries must reuse the same
            key; a replay returns the stored response.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PricesRequest'
      responses:
        '200':
          description: Per-line results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricesResponse'
        '401':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '402':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Error envelope with a stable machine-readable code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    PricesRequest:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        lines:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              customerId:
                type: string
                minLength: 1
              customerExternalId:
                type: string
                minLength: 1
              productSku:
                type: string
                minLength: 1
              productExternalId:
                type: string
                minLength: 1
              quantity:
                default: 1
                type: number
                exclusiveMinimum: 0
                maximum: 1000000
              orderValueCents:
                type: integer
                minimum: 0
                maximum: 1000000000000
              orderTotalQuantity:
                type: integer
                minimum: 0
                maximum: 100000000
              urgency:
                type: string
                enum:
                  - standard
                  - expedited
                  - rush
      required:
        - lines
    PricesResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        lines:
          type: array
          items:
            oneOf:
              - readOnly: true
                type: object
                properties:
                  priceCents:
                    type: number
                  currency:
                    type: string
                  pricingDecisionId:
                    anyOf:
                      - type: string
                      - type: 'null'
                  reason:
                    type: array
                    items:
                      readOnly: true
                      type: object
                      properties:
                        param:
                          type: string
                        marginDeltaBps:
                          type: number
                        label:
                          type: string
                        scope:
                          type: string
                      required:
                        - param
                        - marginDeltaBps
                  reasonSummary:
                    type: string
                  explanation:
                    readOnly: true
                    type: object
                    properties:
                      short:
                        type: string
                      drivers:
                        type: array
                        items:
                          readOnly: true
                          type: object
                          properties:
                            param:
                              type: string
                            label:
                              type: string
                            points:
                              type: number
                            direction:
                              type: string
                              enum:
                                - up
                                - down
                          required:
                            - param
                            - label
                            - points
                            - direction
                      stance:
                        type: string
                        enum:
                          - hold_firm
                          - at_floor
                          - held_near_last
                          - flexible
                          - standard
                      marginPct:
                        type: number
                      targetMarginPct:
                        type: number
                      confidence:
                        type: string
                        enum:
                          - high
                          - medium
                          - low
                    required:
                      - short
                      - drivers
                      - stance
                      - marginPct
                      - targetMarginPct
                      - confidence
                  guardrailsApplied:
                    type: array
                    items:
                      type: string
                  confidence:
                    type: string
                    enum:
                      - high
                      - medium
                      - low
                  confidenceScore:
                    type: number
                  ok:
                    type: boolean
                required:
                  - priceCents
                  - currency
                  - pricingDecisionId
                  - reason
                  - reasonSummary
                  - explanation
                  - guardrailsApplied
                  - confidence
                  - confidenceScore
                  - ok
              - readOnly: true
                type: object
                properties:
                  ok:
                    type: boolean
                  code:
                    default: internal_error
                    type: string
                    enum:
                      - unauthorized
                      - forbidden
                      - feature_not_enabled
                      - subscription_inactive
                      - rate_limited
                      - monthly_volume_exceeded
                      - invalid_request
                      - invalid_json
                      - unknown_product
                      - unknown_customer
                      - no_cost_basis
                      - fx_rate_unavailable
                      - fx_rate_stale
                      - idempotency_key_reused
                      - idempotency_key_in_flight
                      - batch_not_found
                      - batch_already_committed
                      - batch_entity_order_violation
                      - entity_not_supported
                      - writeback_lease_expired
                      - internal_error
                  message:
                    type: string
                  param:
                    type: string
                required:
                  - ok
                  - message
      required:
        - lines
    ApiError:
      $schema: https://json-schema.org/draft/2020-12/schema
      readOnly: true
      type: object
      properties:
        error:
          readOnly: true
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - feature_not_enabled
                - subscription_inactive
                - rate_limited
                - monthly_volume_exceeded
                - invalid_request
                - invalid_json
                - unknown_product
                - unknown_customer
                - no_cost_basis
                - fx_rate_unavailable
                - fx_rate_stale
                - idempotency_key_reused
                - idempotency_key_in_flight
                - batch_not_found
                - batch_already_committed
                - batch_entity_order_violation
                - entity_not_supported
                - writeback_lease_expired
                - internal_error
            message:
              type: string
            param:
              type: string
            requestId:
              type: string
          required:
            - code
            - message
            - requestId
      required:
        - error
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Elastly API key. Scopes: erp (price serving), connector (ingest +
        write-backs), storefront.

````