syntax = "proto3";

package com.wix.ecommerce.catalog_spi.api.v1;

import "google/protobuf/wrappers.proto";
import "wix/api/annotations.proto";
import "wix/api/validations.proto";

// Buyer Info
message BuyerInfo {
  // Contact ID. For more information, see [Contacts API](https://dev.wix.com/api/rest/contacts/contacts/introduction).
  google.protobuf.StringValue contact_id = 1 [(.wix.api.format) = GUID, (.wix.api.referenced_entity) = "wix.contacts.v4.contact"];

  // Buyer email address.
  google.protobuf.StringValue email = 5 [(.wix.api.format) = EMAIL, (.wix.api.pii) = true];

  // Visitor, Wix member ID or User
  oneof id {
    // Visitor ID - if the buyer is **not** a site member.
    string visitor_id = 2 [(.wix.api.format) = GUID, (.wix.api.readOnly) = true];
    // Member ID - if the buyer is a site member.
    string member_id = 3 [(.wix.api.format) = GUID, (.wix.api.referenced_entity) = "wix.members.v1.member", (.wix.api.readOnly) = true];
    // User ID - if the buyer (or cart owner) is a Wix user.
    string user_id = 4 [(.wix.api.format) = GUID, (.wix.api.readOnly) = true];
  }
}