# Batch add or update transactions

- Operation ID: `BatchAddOrUpdateTransactions`
- HTTP method: `POST`
- Path: `/v4/transactions/batch`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/BatchAddOrUpdateTransactions)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /v4/transactions/batch:
    post:
      summary: Batch add or update transactions
      description: |
        Enqueue a number of add/update operations in the Synerise
        application database. 

        For each transaction, a `transaction.charge` event is generated automatically. In addition, each item in the `products` array produces a `product.buy` event.

        If you don't have some information about a transaction, don't insert a null-value parameter - omit the parameter entirely. Sending a null value <strong>deletes an attribute</strong> (if it's a custom attribute) or <strong>sets it to null/default value</strong> (if the attribute is Synerise-native).



        The body contains an array of objects to update. The objects are
        the same as in the *Update transaction* and *Create transaction*
        endpoints.



        All monetary values must use the same currency and be greater
        than or equal to zero. `discountAmount` must be greater than zero
        or omitted.


        ---

        **API consumer:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `API_BATCH_TRANSACTION_CREATE`
      operationId: BatchAddOrUpdateTransactions
      parameters:
        - name: Api-Version
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - "4.4"
      requestBody:
        description: An array of transactions to post or update
        content:
          application/json:
            schema:
              type: array
              items:
                required:
                  - client
                  - orderId
                  - paymentInfo
                  - products
                  - revenue
                  - value
                  - source
                type: object
                properties:
                  client:
                    type: object
                    description: |
                      You must provide at least one of those profile identifiers.

                      **Upcoming breaking change (effective July 6, 2026):** Synerise is introducing changes to how user identifiers and UUIDs are handled. These changes may affect profiles with accented or diacritical characters in identifiers, profiles with leading or trailing whitespace in identifiers, and profiles with duplicate UUIDs. For details and recommended actions, see [Upcoming changes to identifier and UUID handling](https://hub.synerise.com/docs/settings/configuration/identifier-standardization/).
                    properties:
                      customId:
                        type: string
                        description: |
                          A custom ID for the Profile. It is a unique identifier.

                          The value can't include any characters that match the pattern (ECMA flavor): `/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\r\n\u2028\u2029\u00AD]|[\uFE00-\uFE0F]|[\u0000])/`

                          **Upcoming breaking change (effective July 6, 2026):** Synerise is introducing changes to how user identifiers and UUIDs are handled. These changes may affect profiles with accented or diacritical characters in identifiers, profiles with leading or trailing whitespace in identifiers, and profiles with duplicate UUIDs. For details and recommended actions, see [Upcoming changes to identifier and UUID handling](https://hub.synerise.com/docs/settings/configuration/identifier-standardization/).
                      id:
                        description: |
                          Unique ID. This ID is generated by the system during profile creation.

                          **Upcoming breaking change (effective July 6, 2026):** Synerise is introducing changes to how user identifiers and UUIDs are handled. These changes may affect profiles with accented or diacritical characters in identifiers, profiles with leading or trailing whitespace in identifiers, and profiles with duplicate UUIDs. For details and recommended actions, see [Upcoming changes to identifier and UUID handling](https://hub.synerise.com/docs/settings/configuration/identifier-standardization/).
                        type: integer
                        format: int64
                        example: 433230297
                      uuid:
                        type: string
                        description: |
                          UUID of the Profile. It is a unique identifier.

                          The value can't include any characters that match the pattern (ECMA flavor): `/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\r\n\u2028\u2029\u00AD]|[\uFE00-\uFE0F]|[\u0000])/`

                          **Upcoming breaking change (effective July 6, 2026):** Synerise is introducing changes to how user identifiers and UUIDs are handled. These changes may affect profiles with accented or diacritical characters in identifiers, profiles with leading or trailing whitespace in identifiers, and profiles with duplicate UUIDs. For details and recommended actions, see [Upcoming changes to identifier and UUID handling](https://hub.synerise.com/docs/settings/configuration/identifier-standardization/).
                        example: 07243772-008a-42e1-ba37-c3807cebde8f
                      email:
                        type: string
                        description: |
                          The profile's e-mail address. 

                          - Must match the pattern (ECMA flavor): `/^(([^<>()[\]\\.,;:\s@\\"]+(\.[^<>()[\]\\.,;:\s@\\"]+)*)|(\\".+\\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/`  
                          - The value can't include any characters that match the pattern (ECMA flavor): `/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\r\n\u2028\u2029\u00AD]|[\uFE00-\uFE0F]|[\u0000])/`

                          By default, email is a unique identifier.

                          If [non-unique emails](https://hub.synerise.com/docs/settings/configuration/non-unique-emails/) are enabled, this field should not be used. It is no longer an identifier. The configuration of non-unique emails includes creating an email parameter for communication.

                          **Upcoming breaking change (effective July 6, 2026):** Synerise is introducing changes to how user identifiers and UUIDs are handled. These changes may affect profiles with accented or diacritical characters in identifiers, profiles with leading or trailing whitespace in identifiers, and profiles with duplicate UUIDs. For details and recommended actions, see [Upcoming changes to identifier and UUID handling](https://hub.synerise.com/docs/settings/configuration/identifier-standardization/).
                  discountAmount:
                    description: How much the total cost decreased
                    type: object
                    nullable: true
                    properties:
                      amount:
                        type: number
                        description: The discount amount
                        minimum: 0
                      currency:
                        type: string
                        description: The currency of the transaction in ISO 4217
                        example: USD
                  metadata:
                    type: object
                    description: |
                      Any custom parameters.   
                      If you want to send `promotionCode` and `quantityToRedeem`, contact the Synerise support to enable it for your workspace.   
                      Include these parameters in the `metadata` object, so Synerise can redeem it automatically.
                    additionalProperties: true
                    properties:
                      promotionCode:
                        type: string
                        description: |
                          Unique promotion ID.  
                          If you want to send `promotionCode` and `quantityToRedeem`, contact the Synerise support to enable it for your workspace.  
                          Include these parameters in the metadata object, so Synerise can redeem it automatically.
                      quantityToRedeem:
                        type: integer
                        description: |
                          The number of items to which the promotion has been applied.  
                          If you want to send `promotionCode` and `quantityToRedeem`, contact the Synerise support to enable it for your workspace.  
                          Include these parameters in the metadata object, so Synerise can redeem it automatically.
                  orderId:
                    type: string
                    description: |-
                      ID of the transaction.
                      If you want to be able to overwrite this transaction in the future, you use `eventSalt`. If you send a transaction with the same `orderId` multiple times, the system generates multiple transaction events.
                    example: be466362-71e9-4bdd-ad11-bfacead5276b
                  paymentInfo:
                    description: Payment details
                    required:
                      - method
                    type: object
                    properties:
                      method:
                        description: Payment method
                        type: string
                        example: CASH
                  products:
                    type: array
                    items:
                      required:
                        - finalUnitPrice
                        - quantity
                        - sku
                      type: object
                      additionalProperties:
                        description: Additional, free-form properties of the item
                      properties:
                        finalUnitPrice:
                          description: Total final price of the item per unit, including tax and discounts
                          required:
                            - amount
                            - currency
                          type: object
                          properties:
                            amount:
                              type: number
                              minimum: 0
                              description: The price of the items
                              example: 3.25
                            currency:
                              type: string
                              description: The currency of the transaction in ISO 4217
                              example: USD
                        name:
                          type: string
                          example: Soft drink
                          description: Name of the item
                        sku:
                          type: string
                          example: "189784563455"
                          description: SKU of the item
                        categories:
                          type: array
                          description: A list of the item's categories
                          items:
                            type: string
                        image:
                          type: string
                          description: URL of the item's image
                        url:
                          type: string
                          description: URL of the item's page
                        netUnitPrice:
                          required:
                            - amount
                            - currency
                          type: object
                          description: Price before taxation (before or after discounts, depending on your implementation and discount type)
                          properties:
                            amount:
                              type: number
                              minimum: 0
                              description: The amount of money
                              example: 3.25
                            currency:
                              type: string
                              description: The currency of the transaction in ISO 4217
                              example: USD
                        tax:
                          type: number
                          format: float
                          description: Tax as a percentage
                        quantity:
                          type: number
                          example: 2.5
                          description: The number or amount of purchased items
                        regularPrice:
                          description: Regular price of the item after taxation, before discounts
                          required:
                            - amount
                            - currency
                          type: object
                          properties:
                            amount:
                              type: number
                              minimum: 0
                              description: The amount of money
                              example: 3.25
                            currency:
                              type: string
                              description: The currency of the transaction in ISO 4217
                              example: USD
                        discountPrice:
                          description: Discount as an amount. For example, if the regular price is 500, and the final price is 450, the discount amount is 50.
                          type: object
                          required:
                            - amount
                            - currency
                          properties:
                            amount:
                              type: number
                              minimum: 0
                              description: The amount of money
                              example: 15.5
                            currency:
                              type: string
                              description: The currency of the transaction in ISO 4217
                              example: USD
                        discountPercent:
                          type: number
                          format: float
                          description: Discount as a percentage
                    description: |
                      A list of items in the transaction.

                      Each item creates a `product.buy` event. The UUID of that event is generated from a combination of:
                        - the UUID of the `transaction.charge` event created by the transaction
                        - the position of the item in this array. This has an effect on updating transaction events. 

                      This means that when you update a transaction (a transaction can only be updated if it has an `eventSalt` and the same timestamp as the original), you must keep the original order of items in the array. Otherwise, you may accidentally overwrite a `product.buy` event with another item's event. The system does NOT recognize the item by SKU in this case.

                      **Example**:
                        1. You create a transaction with items A, B and C (in that order).
                        2. You update the transaction and the items are now A, B, D, and C (in that order).
                        3. Because item D took the position of C in the event, it has the same UUID as C had earlier. The event of D overwrites the event of C, and C is generated as a new event.

                      Additionally, because events can't be deleted from the database, cancelled items remain as events in a Profile's history. You can use a custom free-form property to tag items as cancelled. This way, you can keep cancelled items in `products` when updating a transaction without breaking the order of items. You can also use the property to filter cancelled items out in Analytics.
                  recordedAt:
                    type: string
                    description: |
                      Time when the event occurred, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601). 

                      This time isn't affected and doesn't affect the timezone of your workspace - you can send events with a timezone different than that of the workspace. Synerise calculates the times into UTC standard when saving events in the database.

                      If not defined, the backend inserts the time of receiving the event.

                      A time with a "Z" at the end (for example, `2022-10-14T12:02:06Z`) denotes a time in the UTC standard.

                      If you want to send time in a different timezone, you can do this by appending `{+|-}hh:mm` at the end of the string.  

                      Note that if the timezone is ahead (+) of UTC, the UTC time is calculated by subtraction. When the timezone is behind (-) UTC, the UTC time is calculated by addition.  
                      For example:
                        - if your timezone is UTC+1, append `+01:00`. When you send `2022-10-14T15:00:000+01:00`, it is saved in the database as `2022-10-14T14:00:000Z`
                        - if your timezone is UTC-8, append `-08:00`. When you send `2022-10-14T22:00:000-08:00`, it is saved in the database as `2022-10-15T06:00:000Z` (note that the date also changes between timezones in this example)

                      **IMPORTANT**: If you send an event with a future time, the parameter is rejected and the time of receiving the event is saved as the occurrence time. For example, if your timezone is UTC+1 and you send the event at 15:00 local time, future times are:  
                      - later than 15:00 local time
                      - later than 14:00 UTC

                      When you retrieve an event, its time is always shown as UTC. The original time string that you sent (even if it was a future time and was rejected) can be retrieved with the [activities](https://developers.synerise.com/DataManagement/DataManagement.html#tag/Activities) endpoints, as `snr-original-time`.
                    example: 2019-02-07T09:53:56.999+00:00
                  revenue:
                    required:
                      - amount
                      - currency
                    type: object
                    description: Transaction revenue (amount after taxation). This field is not calculated automatically by the backend, you must provide the value by summing up the results of `finalUnitPrice * quantity` from all items in the `products` array.
                    properties:
                      amount:
                        type: number
                        minimum: 0
                        description: The total amount
                        example: 64.25
                      currency:
                        type: string
                        description: The currency of the transaction in ISO 4217
                        example: USD
                  value:
                    required:
                      - amount
                      - currency
                    type: object
                    description: If you want to display the price before taxation, use this object. If you only want to display the price after taxation, set the values to the same as in `revenue`.
                    properties:
                      amount:
                        type: number
                        minimum: 0
                        description: The total amount
                        example: 112.25
                      currency:
                        type: string
                        description: The currency of the transaction in ISO 4217
                        example: USD
                  source:
                    type: string
                    enum:
                      - WEB_DESKTOP
                      - WEB_MOBILE
                      - MOBILE_APP
                      - POS
                      - MOBILE
                      - DESKTOP
                    description: |
                      Source of the event. 
                    example: MOBILE
                  eventSalt:
                    type: string
                    example: 972346context.action2019-02-07T09:53:56.999+00:00
                    description: |
                      When an event has an `eventSalt`, it can be overwritten by sending another event. The event's UUID stays the same.

                      `eventSalt` must be unique in a workspace. An example of creating a salt is by generating a UUID or concatenating the profile ID, event's name, and timestamp, including milliseconds. This creates a value whose possibility of being duplicated is practically zero.

                      To overwrite an event with another one, the new event MUST:
                      - have the same `eventSalt` as the original event
                      - have the same date and time as the original event (If the date and time don't match the original event, event salt doesn't have any effect.)
                      - belong to the same `clientId` as the original event
                      - have the same action (event name) as the original event

                      ------
                      **IMPORTANT**:  
                      - DO NOT send the same `eventSalt` to different profiles!
                      - DO NOT send the same `eventSalt` with a different action!
                      - Pay attention to timezones - more details in the description of the `time` property (in v4/transactions events, it's called `recordedAt`).
                      - If you send a future time in an event, it is rejected and the current time is assigned automatically. This means it's impossible to use event salt with future times.
                      - An event without an `eventSalt` can't be overwritten. The parameter cannot be added to an event at a later time.
                      - The parameter can't be retrieved later. You must keep track of the values that you send.  
                      - In Automations that use the overwritten event as a trigger, the **automation is triggered if the new event is sent more than 72 hours after the original**. This is because the event UUID stays the same, and Automation treats events with the same UUID within 72 hours as duplicates that were sent due to an error.
              description: ""
        required: true
      responses:
        "202":
          description: Accepted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  path:
                    type: string
                    description: URL of the requested resource
                  message:
                    type: string
                    description: Description of the problem
                  errors:
                    type: array
                    description: Additional details of the errors, if applicable
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                          format: int32
                          example: 12082
                          description: A numeric identifier of the error type
                        field:
                          type: string
                          example: countryCode
                          description: Field in the request body that caused the error
                        message:
                          type: string
                          example: Country Code must have 0 or 3 characters as per ISO format.
                          description: A detailed description of the problem
                        rejectedValue:
                          type: string
                          example: Poland
                          description: The value that caused the error
              example:
                error: Bad Request
                status: 400
                timestamp: 2020-10-28T12:24:24.444Z
                path: /transactions
                message: Some fields did not pass validation
                errors:
                  - code: 14191
                    field: client
                    message: Client cannot have null value
        "401":
          description: "Unauthorized: wrong consumer scope; token missing/expired/invalid; invalid API key; etc."
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  path:
                    type: string
                    description: URL of the requested resource
                  message:
                    type: string
                    description: Description of the problem
                  errors:
                    type: array
                    description: Additional details of the errors, if applicable
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                          format: int32
                          example: 12082
                          description: A numeric identifier of the error type
                        field:
                          type: string
                          example: countryCode
                          description: Field in the request body that caused the error
                        message:
                          type: string
                          example: Country Code must have 0 or 3 characters as per ISO format.
                          description: A detailed description of the problem
                        rejectedValue:
                          type: string
                          example: Poland
                          description: The value that caused the error
              example:
                error: Bad Request
                status: 400
                timestamp: 2020-10-29T13:08:16.235Z
                path: /exampleEndpoint
                message: Some fields did not pass validation
                errors:
                  - code: 120
                    field: exampleField
                    message: "120"
                    rejectedValue: exampleValue
        "403":
          description: Forbidden; insufficient permissions (when PII protection is enabled, PII permissions are required in addition to the permissions listed in the method description)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  path:
                    type: string
                    description: URL of the requested resource
                  message:
                    type: string
                    description: Description of the problem
                  errors:
                    type: array
                    description: Additional details of the errors, if applicable
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                          format: int32
                          example: 12082
                          description: A numeric identifier of the error type
                        field:
                          type: string
                          example: countryCode
                          description: Field in the request body that caused the error
                        message:
                          type: string
                          example: Country Code must have 0 or 3 characters as per ISO format.
                          description: A detailed description of the problem
                        rejectedValue:
                          type: string
                          example: Poland
                          description: The value that caused the error
              example:
                timestamp: 2018-06-07T07:29:27.489+00:00
                status: 403
                error: Forbidden
                message: Forbidden
                path: /path_of_the_endpoint
        "415":
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  path:
                    type: string
                    description: URL of the requested resource
                  message:
                    type: string
                    description: Description of the problem
                  errors:
                    type: array
                    description: Additional details of the errors, if applicable
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                          format: int32
                          example: 12082
                          description: A numeric identifier of the error type
                        field:
                          type: string
                          example: countryCode
                          description: Field in the request body that caused the error
                        message:
                          type: string
                          example: Country Code must have 0 or 3 characters as per ISO format.
                          description: A detailed description of the problem
                        rejectedValue:
                          type: string
                          example: Poland
                          description: The value that caused the error
              example:
                timestamp: 2018-06-07T07:27:23.136+00:00
                status: 415
                error: Unsupported Media Type
                message: Content type 'application/xml' not supported
                path: /path_of_the_endpoint
      deprecated: false
      security:
        - JWT: []
      tags:
        - Events
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Events/operation/BatchAddOrUpdateTransactions
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/v4/transactions/batch \
              --header 'Api-Version: SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '[{"client":{"customId":"string","id":433230297,"uuid":"07243772-008a-42e1-ba37-c3807cebde8f","email":"string"},"discountAmount":{"amount":0,"currency":"USD"},"metadata":{"promotionCode":"string","quantityToRedeem":0},"orderId":"be466362-71e9-4bdd-ad11-bfacead5276b","paymentInfo":{"method":"CASH"},"products":[{"finalUnitPrice":{"amount":3.25,"currency":"USD"},"name":"Soft drink","sku":"189784563455","categories":["string"],"image":"string","url":"string","netUnitPrice":{"amount":3.25,"currency":"USD"},"tax":0.1,"quantity":2.5,"regularPrice":{"amount":3.25,"currency":"USD"},"discountPrice":{"amount":15.5,"currency":"USD"},"discountPercent":0.1,"property1":null,"property2":null}],"recordedAt":"2019-02-07T09:53:56.999+00:00","revenue":{"amount":64.25,"currency":"USD"},"value":{"amount":112.25,"currency":"USD"},"source":"MOBILE","eventSalt":"972346context.action2019-02-07T09:53:56.999+00:00"}]'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "[{\"client\":{\"customId\":\"string\",\"id\":433230297,\"uuid\":\"07243772-008a-42e1-ba37-c3807cebde8f\",\"email\":\"string\"},\"discountAmount\":{\"amount\":0,\"currency\":\"USD\"},\"metadata\":{\"promotionCode\":\"string\",\"quantityToRedeem\":0},\"orderId\":\"be466362-71e9-4bdd-ad11-bfacead5276b\",\"paymentInfo\":{\"method\":\"CASH\"},\"products\":[{\"finalUnitPrice\":{\"amount\":3.25,\"currency\":\"USD\"},\"name\":\"Soft drink\",\"sku\":\"189784563455\",\"categories\":[\"string\"],\"image\":\"string\",\"url\":\"string\",\"netUnitPrice\":{\"amount\":3.25,\"currency\":\"USD\"},\"tax\":0.1,\"quantity\":2.5,\"regularPrice\":{\"amount\":3.25,\"currency\":\"USD\"},\"discountPrice\":{\"amount\":15.5,\"currency\":\"USD\"},\"discountPercent\":0.1,\"property1\":null,\"property2\":null}],\"recordedAt\":\"2019-02-07T09:53:56.999+00:00\",\"revenue\":{\"amount\":64.25,\"currency\":\"USD\"},\"value\":{\"amount\":112.25,\"currency\":\"USD\"},\"source\":\"MOBILE\",\"eventSalt\":\"972346context.action2019-02-07T09:53:56.999+00:00\"}]"

            headers = {
                'Api-Version': "SOME_STRING_VALUE",
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/v4/transactions/batch", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify([
              {
                "client": {
                  "customId": "string",
                  "id": 433230297,
                  "uuid": "07243772-008a-42e1-ba37-c3807cebde8f",
                  "email": "string"
                },
                "discountAmount": {
                  "amount": 0,
                  "currency": "USD"
                },
                "metadata": {
                  "promotionCode": "string",
                  "quantityToRedeem": 0
                },
                "orderId": "be466362-71e9-4bdd-ad11-bfacead5276b",
                "paymentInfo": {
                  "method": "CASH"
                },
                "products": [
                  {
                    "finalUnitPrice": {
                      "amount": 3.25,
                      "currency": "USD"
                    },
                    "name": "Soft drink",
                    "sku": "189784563455",
                    "categories": [
                      "string"
                    ],
                    "image": "string",
                    "url": "string",
                    "netUnitPrice": {
                      "amount": 3.25,
                      "currency": "USD"
                    },
                    "tax": 0.1,
                    "quantity": 2.5,
                    "regularPrice": {
                      "amount": 3.25,
                      "currency": "USD"
                    },
                    "discountPrice": {
                      "amount": 15.5,
                      "currency": "USD"
                    },
                    "discountPercent": 0.1,
                    "property1": null,
                    "property2": null
                  }
                ],
                "recordedAt": "2019-02-07T09:53:56.999+00:00",
                "revenue": {
                  "amount": 64.25,
                  "currency": "USD"
                },
                "value": {
                  "amount": 112.25,
                  "currency": "USD"
                },
                "source": "MOBILE",
                "eventSalt": "972346context.action2019-02-07T09:53:56.999+00:00"
              }
            ]);

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/v4/transactions/batch");
            xhr.setRequestHeader("Api-Version", "SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/v4/transactions/batch",
              "headers": {
                "Api-Version": "SOME_STRING_VALUE",
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify([
              {
                client: {
                  customId: 'string',
                  id: 433230297,
                  uuid: '07243772-008a-42e1-ba37-c3807cebde8f',
                  email: 'string'
                },
                discountAmount: {amount: 0, currency: 'USD'},
                metadata: {promotionCode: 'string', quantityToRedeem: 0},
                orderId: 'be466362-71e9-4bdd-ad11-bfacead5276b',
                paymentInfo: {method: 'CASH'},
                products: [
                  {
                    finalUnitPrice: {amount: 3.25, currency: 'USD'},
                    name: 'Soft drink',
                    sku: '189784563455',
                    categories: ['string'],
                    image: 'string',
                    url: 'string',
                    netUnitPrice: {amount: 3.25, currency: 'USD'},
                    tax: 0.1,
                    quantity: 2.5,
                    regularPrice: {amount: 3.25, currency: 'USD'},
                    discountPrice: {amount: 15.5, currency: 'USD'},
                    discountPercent: 0.1,
                    property1: null,
                    property2: null
                  }
                ],
                recordedAt: '2019-02-07T09:53:56.999+00:00',
                revenue: {amount: 64.25, currency: 'USD'},
                value: {amount: 112.25, currency: 'USD'},
                source: 'MOBILE',
                eventSalt: '972346context.action2019-02-07T09:53:56.999+00:00'
              }
            ]));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/v4/transactions/batch');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Api-Version' => 'SOME_STRING_VALUE',
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('[{"client":{"customId":"string","id":433230297,"uuid":"07243772-008a-42e1-ba37-c3807cebde8f","email":"string"},"discountAmount":{"amount":0,"currency":"USD"},"metadata":{"promotionCode":"string","quantityToRedeem":0},"orderId":"be466362-71e9-4bdd-ad11-bfacead5276b","paymentInfo":{"method":"CASH"},"products":[{"finalUnitPrice":{"amount":3.25,"currency":"USD"},"name":"Soft drink","sku":"189784563455","categories":["string"],"image":"string","url":"string","netUnitPrice":{"amount":3.25,"currency":"USD"},"tax":0.1,"quantity":2.5,"regularPrice":{"amount":3.25,"currency":"USD"},"discountPrice":{"amount":15.5,"currency":"USD"},"discountPercent":0.1,"property1":null,"property2":null}],"recordedAt":"2019-02-07T09:53:56.999+00:00","revenue":{"amount":64.25,"currency":"USD"},"value":{"amount":112.25,"currency":"USD"},"source":"MOBILE","eventSalt":"972346context.action2019-02-07T09:53:56.999+00:00"}]');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/v4/transactions/batch")
              .header("Api-Version", "SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("[{\"client\":{\"customId\":\"string\",\"id\":433230297,\"uuid\":\"07243772-008a-42e1-ba37-c3807cebde8f\",\"email\":\"string\"},\"discountAmount\":{\"amount\":0,\"currency\":\"USD\"},\"metadata\":{\"promotionCode\":\"string\",\"quantityToRedeem\":0},\"orderId\":\"be466362-71e9-4bdd-ad11-bfacead5276b\",\"paymentInfo\":{\"method\":\"CASH\"},\"products\":[{\"finalUnitPrice\":{\"amount\":3.25,\"currency\":\"USD\"},\"name\":\"Soft drink\",\"sku\":\"189784563455\",\"categories\":[\"string\"],\"image\":\"string\",\"url\":\"string\",\"netUnitPrice\":{\"amount\":3.25,\"currency\":\"USD\"},\"tax\":0.1,\"quantity\":2.5,\"regularPrice\":{\"amount\":3.25,\"currency\":\"USD\"},\"discountPrice\":{\"amount\":15.5,\"currency\":\"USD\"},\"discountPercent\":0.1,\"property1\":null,\"property2\":null}],\"recordedAt\":\"2019-02-07T09:53:56.999+00:00\",\"revenue\":{\"amount\":64.25,\"currency\":\"USD\"},\"value\":{\"amount\":112.25,\"currency\":\"USD\"},\"source\":\"MOBILE\",\"eventSalt\":\"972346context.action2019-02-07T09:53:56.999+00:00\"}]")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Events
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
