> ## 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.

# Claim write-backs

> Lease pending price write-backs for this connector to apply.

<Warning>
  Claiming leases real work. Every task you claim carries a `leaseUntil`, and your live connector
  will not receive those write-backs until the lease expires. The interactive playground is turned
  off here so reading the docs can never take work away from a running connector.
</Warning>


## OpenAPI

````yaml POST /api/v1/writebacks/claim
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/writebacks/claim:
    post:
      tags:
        - writebacks
      summary: Lease pending price write-backs for this connector
      description: >-
        Requires a connector-scope key. Each task carries leaseUntil; acks after
        the lease are counted as expired, never applied.
      operationId: claimWritebacks
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaimWritebacksRequest'
      responses:
        '200':
          description: Leased tasks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimWritebacksResponse'
        '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'
        '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:
    ClaimWritebacksRequest:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        limit:
          default: 100
          type: integer
          exclusiveMinimum: 0
          maximum: 500
    ClaimWritebacksResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      readOnly: true
      type: object
      properties:
        tasks:
          type: array
          items:
            readOnly: true
            type: object
            properties:
              id:
                type: string
              productSku:
                type: string
              productExternalId:
                type: string
              priceCents:
                type: number
              currency:
                type: string
              exchangeRateToBase:
                anyOf:
                  - type: number
                  - type: 'null'
              reasonSummary:
                anyOf:
                  - type: string
                  - type: 'null'
              pricingDecisionId:
                anyOf:
                  - type: string
                  - type: 'null'
              leaseUntil:
                type: string
              target:
                type: object
                propertyNames:
                  type: string
                additionalProperties: {}
            required:
              - id
              - productSku
              - productExternalId
              - priceCents
              - currency
              - leaseUntil
              - target
      required:
        - tasks
    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.

````