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

# Imports personal offers to Promotion DB

> Used with external offer allocation imports. This endpoint can work directly through YARP integration layer of a client and via data import service if client choses to use file uploads.
All imported offers are expected to have the same start and end dates. Dates from the first row will be used for other offers.
If no dates are provided, dates from the campaign from the first row will be used. 

Imported offers will not be available in app unless finish-bulk endpoint is called for current JobId. 

If import of a bulk failed, this bulk will be reverted fully, other bulks with same JobId will not be reverted.
To revert the whole import, call DELETE api/v1/personaloffers endpoint. 

We do not recommend running multiple imports at the same time, as it can cause performance degradation. 

Idempotent if we receive the exact same request, coupons from it will not be imported again. First (OfferId, MemberId) and last (OfferId, MemberId) of the batch are used as idempotency key.



## OpenAPI

````yaml openapi/promotion-v3.json POST /v3/personaloffers/bulk
openapi: 3.0.4
info:
  title: Offer Api
  version: v3
servers:
  - url: https://{host}/promotion
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - Bearer: []
paths:
  /v3/personaloffers/bulk:
    post:
      tags:
        - PersonalOffers
      summary: Imports personal offers to Promotion DB
      description: >-
        Used with external offer allocation imports. This endpoint can work
        directly through YARP integration layer of a client and via data import
        service if client choses to use file uploads.

        All imported offers are expected to have the same start and end dates.
        Dates from the first row will be used for other offers.

        If no dates are provided, dates from the campaign from the first row
        will be used. 


        Imported offers will not be available in app unless finish-bulk endpoint
        is called for current JobId. 


        If import of a bulk failed, this bulk will be reverted fully, other
        bulks with same JobId will not be reverted.

        To revert the whole import, call DELETE api/v1/personaloffers endpoint. 


        We do not recommend running multiple imports at the same time, as it can
        cause performance degradation. 


        Idempotent if we receive the exact same request, coupons from it will
        not be imported again. First (OfferId, MemberId) and last (OfferId,
        MemberId) of the batch are used as idempotency key.
      parameters:
        - name: JobId
          in: header
          description: ''
          schema:
            type: string
      requestBody:
        description: ''
        content:
          application/json-patch+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ImportMemberCouponRequest'
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ImportMemberCouponRequest'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ImportMemberCouponRequest'
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ImportMemberCouponRequest'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ImportResult'
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
            text/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ImportResult'
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
            text/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
components:
  schemas:
    ImportMemberCouponRequest:
      type: object
      properties:
        offerId:
          type: string
          nullable: true
        memberId:
          type: string
          nullable: true
        preActivated:
          type: boolean
        visibleFrom:
          type: string
          format: date-time
          nullable: true
        pickUpEndDate:
          type: string
          format: date-time
          nullable: true
        rule1Value:
          type: number
          format: double
          nullable: true
        storeId:
          type: string
          nullable: true
      additionalProperties: false
    ImportResult:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/WebServiceError'
          nullable: true
      additionalProperties: false
    WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        Opaque Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````