# Create/Update resources

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/programs/{programId}/integrations/api:
    post:
      summary: Create/Update resources
      deprecated: false
      description: ''
      operationId: ApiController_listenToChanges_v1
      tags:
        - API Integration
        - Integration
      parameters:
        - name: programId
          in: path
          description: ''
          required: true
          example: '{{slug-or-program-id}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/WebhookPayload'
            examples:
              '1':
                value:
                  - email: carlo61@gmail.com
                    feature: user
                    payload:
                      externalCustomerId: '4455885'
                      firstName: Carlo
                      lastName: Passadati
                      phone: '0035987454128'
                      emailVerified: true
                      email: carlo61@gmail.com
                summary: Update customer user data
                description: >-
                  Update or create customer user data using the external ID from
                  another service where the user information is stored
              '2':
                value:
                  - email: john.peter@gmail.com
                    feature: loyalty
                    payload:
                      loyaltyCustomerId: '155445'
                      balance: '155'
                      memberSince: 12-12-2025
                      tierStatus: Gold
                summary: Update customer loyalty
                description: >-
                  Update or create a loyalty information form for this customer
                  based on the information found in other databases or systems
              '3':
                value:
                  - email: carlo61@gmail.com
                    feature: user
                    payload:
                      externalCustomerId: '4455885'
                      firstName: Carlo
                      lastName: Passadati
                      phone: '0035987454128'
                      emailVerified: true
                      email: carlopassadati@gmail.com
                summary: Change the customer's email
                description: >-
                  Update the email for a customer who has changed their email
                  address in JeriCommerce. Use the old email as the key and
                  include the new email in the payload. The old email will no
                  longer exist in the next request
              '4':
                value:
                  - email: john.peter@gmail.com
                    feature: loyalty
                    payload:
                      loyaltyCustomerId: '155445'
                      balance: '155'
                      memberSince: 12-12-2025
                      tierStatus: Gold
                  - email: john.peter@gmail.com
                    feature: user
                    payload:
                      externalCustomerId: '4455885'
                      firstName: Carlo
                      lastName: Passadati
                      phone: '0035987454128'
                      emailVerified: true
                      email: carlo61@gmail.com
                summary: Update/Create user and loyalty information
                description: >-
                  You can update the same user loyalty and user data by adding
                  multiple objects in a single API call
      responses:
        '201':
          description: ''
          headers: {}
          x-apidog-name: Success
      security:
        - api-key: []
          x-apidog:
            schemeGroups:
              - id: VK6lXqeiFQW9WSwUlYBHb
                schemeIds:
                  - api-key
            required: true
            use:
              id: VK6lXqeiFQW9WSwUlYBHb
            scopes:
              VK6lXqeiFQW9WSwUlYBHb:
                api-key: []
      x-apidog-folder: API Integration
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1139723/apis/api-24902232-run
components:
  schemas:
    WebhookPayload:
      type: object
      properties:
        email:
          type: string
        feature:
          type: string
          enum:
            - devices
            - download-wallet-pass-url
            - events
            - loyalty
            - multi-pass
            - rewards
            - segments
            - users
            - custom-fields
        payload:
          oneOf:
            - $ref: '#/components/schemas/CustomerWebhookPayload'
            - $ref: '#/components/schemas/LoyaltyWebhookPayload'
      required:
        - email
        - feature
        - payload
      x-apidog-orders:
        - email
        - feature
        - payload
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    LoyaltyWebhookPayload:
      type: object
      properties:
        loyaltyCustomerId:
          type: string
        balance:
          type: number
        memberSince:
          type: string
        tierStatus:
          type: string
      required:
        - loyaltyCustomerId
        - balance
        - tierStatus
      x-apidog-orders:
        - loyaltyCustomerId
        - balance
        - memberSince
        - tierStatus
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    CustomerWebhookPayload:
      type: object
      properties:
        externalCustomerId:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        phone:
          type: string
        emailVerified:
          type: boolean
        email:
          type: string
      required:
        - externalCustomerId
      x-apidog-orders:
        - externalCustomerId
        - firstName
        - lastName
        - phone
        - emailVerified
        - email
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: jwt
    api-key:
      type: apikey
      in: header
      name: api-key
servers:
  - url: https://api.jericommerce.com
    description: Entorno producción
  - url: ''
    description: Mock Nube
security: []

```
