উপহার কার্ড ফিড

ব্যবসায়ীরা Google-এ তাদের তালিকায় উপহার কার্ড কেনার লিঙ্ক যোগ করতে পারবে। সমস্ত উপহার কার্ডের আগের দিনের ফলাফলের মেট্রিক্স পাঠাতে উপহার কার্ড প্ল্যাটফর্মের জন্য উপহার কার্ড ফিড ব্যবহার করা হয়। গিফট কার্ড ফিড বর্ণনাকারী ফাইলের 'নাম' মান সহ জেনেরিক ড্রপবক্স ব্যবহার করবে যা 'fundraising.giftcard'-এ সেট করা হয়েছে। জেনেরিক ড্রপবক্স কীভাবে ব্যবহার করবেন তার নির্দেশের জন্য, এই টিউটোরিয়ালটি দেখুন । প্রোটো স্পেসিকেটন নীচে পাওয়া যায় সেইসাথে একটি নমুনা JSON ফিড।

প্রোটো স্পেসিফিকেশন

নীচের স্পেসিফিকেশন প্রোটো বিন্যাসে উপলব্ধ. এটি ফিডে উপলব্ধ সমস্ত ক্ষেত্র সংজ্ঞায়িত করতে ব্যবহৃত হয়। জেনেরিক ড্রপবক্সে আপলোড করার সময় আপনি JSON নমুনায় প্রদর্শিত হিসাবে JSON ফর্ম্যাটিং ব্যবহার করতেও সক্ষম হন৷

উপহার কার্ড ফিড সংজ্ঞা

message GiftCardFeed {
  repeated GiftCard data = 1;
}

উপহার কার্ড সংজ্ঞা

message GiftCard {
  // Unique identifier for the gift card. (required)
  // (Note: could be the same as the gift card url if that's the only unique
  // identifier the partner uses. This will mainly be used for identification
  // when Google and partners communicate issues for a particular gift card
  // entry.)
  string gift_card_id = 1;

  // Whether this gift card entry is active (i.e. able to be purchased) or
  // inactive. (required)
  GiftCardStatus gift_card_status = 2;

  // The gift card url on the platform. (required)
  string gift_card_url = 3;

  // The date in YYYY-MM-DD format indicates when the
  // amount_contributed_previous_day and num_of_transactions_previous_day data
  // below are retrieved. Should always be one day after the date which the
  // stats in xxx_previous_day corresponds to. UTC timezone should be used to
  // delineate which transactions fall on which dates.
  //  E.g. if the amount_contributed_previous_day corresponds to the amount
  //  contributed yesterday, then the data_retrieval_date here should be set as
  //  today's date. (required)
  // The feed must include all gift card entries for the given date (no partial
  // uploads). (required)
  string data_retrieval_date = 4;

  // Previous day's monetary amount contributed through the Enhanced User
  // Referral Feature(s) to this gift card program. (required)
  MonetaryAmount amount_contributed_previous_day = 5;

  // Previous day's number of transactions through the Enhanced User Referral
  // Feature(s) for this gift card program. (required)
  int32 num_transactions_previous_day = 6;

  // Information about the merchant that initiated the campaign. (required)
  MerchantInfo merchant_info = 7;
}

উপহার কার্ড স্থিতি সংজ্ঞা

message GiftCardStatus {
  enum Status {
    // Unused.
    STATUS_UNSPECIFIED = 0;

    // Able to be purchased.
    ACTIVE = 1;

    // Unable to be purchased.
    INACTIVE = 2;
  }

  Status status = 1;
}

বণিক সংজ্ঞা

message MerchantInfo {
  // Unique identifier for the merchant.
  // (recommended for Campaign feed, required for others)
  string merchant_id = 1;

  // Name of the merchant that initiated the campaign.
  // (recommended for Campaign feed, required for others)
  string merchant_name = 2;

  // Unstructured address of the merchant that initiated the gift card.
  // (optional)
  // E.g. "1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043"
  string merchant_address_unstructured = 3;

  // Structured address of the merchant that initiated the gift card. (required)
  PostalAddress merchant_postal_address = 4;

  // Business category of the merchant, e.g. restaurant. (optional)
  // See https://developers.google.com/places/supported_types for possible
  // categories.
  string merchant_category = 5;
}

আর্থিক পরিমাণ সংজ্ঞা

message MonetaryAmount {
  // The monetary amount in centi-units of the currency.
  // For example: 1.95 USD is 195 in centi-units.
  // If your amount contains fractions of the smallest currency unit, then it
  // will be rounded using nearest even rounding (e.g. 2.5 cents rounded
  // to 2 cents, 3.5 cents rounded to 4 cents, 0.5 cents rounded to 0 cents,
  // 2.51 cents rounded to 3 cents). (required)
  int64 monetary_amount_centi = 1;

  // The currency of the price that is defined in ISO 4217. (required)
  string currency_code = 2;
}

ডাক ঠিকানা সংজ্ঞা

// The postal address for a merchant.
message PostalAddress {
  // The country, e.g. "US". (required)
  string country = 1;

  // The locality/city, e.g. "Mountain View". (required)
  string locality = 2;

  // The region/state/province, e.g. "CA". This field is only required in
  // countries where region is commonly a part of the address. (optional)
  string region = 3;

  // The postal code, e.g. "94043". (required)
  string postal_code = 4;

  // The street address, e.g. "1600 Amphitheatre Pkwy". (optional)
  string street_address = 5;
}

উপহার কার্ডের উদাহরণ (JSON ফর্ম্যাটে)

নীচের JSON উদাহরণে Jetters Pizza বিক্রির জন্য একটি সক্রিয় উপহার কার্ড উপলব্ধ রয়েছে৷ আগের দিন Google ব্যবহারকারীদের কাছ থেকে মোট $50.00 বিক্রির জন্য দুটি উপহার কার্ড বিক্রি হয়েছিল৷ এই ফাইলটি ছাড়াও, 'fundraising.giftcard'-এ সেট করা বর্ণনাকারী ফাইলের 'নাম' মান সহ জেনেরিক ড্রপবক্সে একটি বর্ণনাকারী ফাইলও আপলোড করতে হবে। জেনেরিক ড্রপবক্সটি কীভাবে ব্যবহার করবেন সে সম্পর্কে আরও তথ্যের জন্য এই টিউটোরিয়ালটি দেখুন।

{
  "data": [
    {
      "gift_card_id": "1",
      "gift_card_status": {
        "status": "ACTIVE"
      },
      "gift_card_url": "www.example.com/jetterspizza",
      "data_retrieval_date": "2020-04-24",
      "amount_contributed_previous_day": {
        "monetary_amount_centi": 5000,
        "currency_code": "USD"
      },
      "num_of_transactions_previous_day": 2,
      "merchant_info": {
        "merchant_id": "A",
        "merchant_name": "Jetters Pizza",
        "merchant_address_unstructured": "1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043",
        "merchant_postal_address": {
          "country": "United States",
          "region": "CA",
          "postal_code": "94043",
          "street_address": "1600 Amphitheatre Pkwy",
          "locality": "Mountain View"
        },
        "merchant_category": "restaurant"
      }
    }
  ]
}