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

# Event Object

<div class="prose dark:prose-invert custom-html">
  <h2 id="events-create-request-body">Events Create Request Body</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            event

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>
            Event name. This is the same name that you used to define a custom event in the
            <strong>Dashboard</strong>

            >

            <strong>Project Settings</strong>

            >

            <strong>Event Schema</strong>.
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>customer</p>
        </td>

        <td>
          <p>Customer's information.</p>
          <a href="#customer">Customer</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            referral

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>
            If a
            <strong>conversion event</strong>
            for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event.
          </p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    code

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>A code through which a new visitor has been referred to a service.</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    referrer\_id

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>
                    Unique ID of the referring person - it is optional and not required if the referral
                    <strong>code</strong>
                    is provided.
                  </p>

                  <p>
                    <strong>Example:</strong>
                    cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            loyalty

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    code

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>
                    Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the
                    <code>event</code>
                    parameter of the request payload gets sent along with this loyalty card code.
                  </p>

                  <p>
                    <strong>Example:</strong>
                    L-CARD-BUHuH6g
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            metadata

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>
            The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the
            <strong>Dashboard</strong>

            >

            <strong>Project Settings</strong>

            >

            <strong>Event Schema</strong>

            >

            <strong>Edit particular event</strong>

            >

            <strong>Metadata property definition</strong>.
          </p>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="customer">Customer</h2>
  <p>All of:</p>

  <ol>
    <li>
      <h3>Customer Id And Source Id</h3>

      <table>
        <thead>
          <tr>
            <th>Attributes</th>
            <th>Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>
              <p>
                id

                <br />

                <code>string</code>
              </p>
            </td>

            <td>
              <p>The ID of an existing customer.</p>
            </td>
          </tr>

          <tr>
            <td>
              <p>
                source\_id

                <br />

                <code>string</code>
              </p>
            </td>

            <td>
              <p>A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.</p>
            </td>
          </tr>
        </tbody>
      </table>
    </li>

    <li>
      <a href="#customer-base">Customer Base</a>
    </li>
  </ol>

  <h2 id="customer-base">Customer Base</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            name

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Customer's first and last name.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            description

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>An arbitrary string that you can attach to a customer object.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            email

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Customer's email address.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            phone

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            birthday

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>
            <code>Deprecated</code>.
            <s>Customer's birthdate; format YYYY-MM-DD</s>.
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            birthdate

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Customer's birthdate; format YYYY-MM-DD.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            address

            <br />

            <code>object</code>,
            <code>null</code>
          </p>
        </td>

        <td>
          <p>Customer's address.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    city

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>City</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    state

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>State</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    line\_1

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>First line of address.</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    line\_2

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Second line of address.</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    country

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Country.</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    postal\_code

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Postal code.</p>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            metadata

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.</p>
        </td>
      </tr>
    </tbody>
  </table>
</div>
