title: Ios Server-to-Server Notifications
body: <p>I am trying to implement the Server-to-Server Notifications for IOS subscriptions. I have went through the <a href="https://developer.apple.com/documentation/storekit/in-app_purchase/enabling_server-to-server_notifications" rel="nofollow noreferrer">Server-to-Server Notifications</a> documentation and followed all the necessary steps. My server is in the GCM.</p>
  <p>Now when i do a purchase in the app i am getting the notification in my server, but the response is totally different from the which is defined in the above link.</p>
  <p>The response which i am getting contains only one field that is <strong>latest_receipt</strong> . But in the documentation they have mentioned various parameters. So, i thought i have to verify the receipt by send a post message to this <a href="http://%20https://sandbox.itunes.apple.com/verifyReceipt" rel="nofollow noreferrer">endpoint</a> . Now i am getting a json body which contains lot of information, but still i am not getting the json which is mentioned in the documentation.</p>
  <p>The response body i am getting after verifying the purchase ( <a href="https://sandbox.itunes.apple.com/verifyReceipt" rel="nofollow noreferrer">https://sandbox.itunes.apple.com/verifyReceipt</a>)</p>
  <pre><code>{
    &quot;auto_renew_status&quot;: 1,
    &quot;status&quot;: 0,
    &quot;auto_renew_product_id&quot;: &quot; &quot;,
    &quot;receipt&quot;: {
      &quot;original_purchase_date_pst&quot;: &quot;2019-01-09 01:26:35 America/Los_Angeles&quot;,
      &quot;quantity&quot;: &quot;1&quot;,
      &quot;unique_vendor_identifier&quot;: &quot; &quot;,
      &quot;bvrs&quot;: &quot;56&quot;,
      &quot;expires_date_formatted&quot;: &quot;2019-07-18 06:19:17 Etc/GMT&quot;,
      &quot;is_in_intro_offer_period&quot;: &quot;false&quot;,
      &quot;purchase_date_ms&quot;: &quot;1563430577000&quot;,
      &quot;expires_date_formatted_pst&quot;: &quot;2019-07-17 23:19:17 America/Los_Angeles&quot;,
      &quot;is_trial_period&quot;: &quot;false&quot;,
      &quot;item_id&quot;: &quot;1298435177&quot;,
      &quot;unique_identifier&quot;: &quot; &quot;,
      &quot;original_transaction_id&quot;: &quot;1000000492823158&quot;,
      &quot;expires_date&quot;: &quot;1563430757000&quot;,
      &quot;transaction_id&quot;: &quot;1000000548145129&quot;,
      &quot;web_order_line_item_id&quot;: &quot;1000000045717939&quot;,
      &quot;version_external_identifier&quot;: &quot;0&quot;,
      &quot;bid&quot;: &quot; &quot;,
      &quot;product_id&quot;: &quot; &quot;,
      &quot;purchase_date&quot;: &quot;2019-07-18 06:16:17 Etc/GMT&quot;,
      &quot;original_purchase_date&quot;: &quot;2019-01-09 09:26:35 Etc/GMT&quot;,
      &quot;purchase_date_pst&quot;: &quot;2019-07-17 23:16:17 America/Los_Angeles&quot;,
      &quot;original_purchase_date_ms&quot;: &quot;1547025995000&quot;
    },
    &quot;latest_receipt_info&quot;: {
      &quot;original_purchase_date_pst&quot;: &quot;2019-01-09 01:26:35 America/Los_Angeles&quot;,
      &quot;unique_identifier&quot;: &quot; &quot;,
      &quot;original_transaction_id&quot;: &quot;1000000492823158&quot;,
      &quot;expires_date&quot;: &quot;1563430757000&quot;,
      &quot;transaction_id&quot;: &quot;1000000548145129&quot;,
      &quot;quantity&quot;: &quot;1&quot;,
      &quot;product_id&quot;: &quot; &quot;,
      &quot;bvrs&quot;: &quot;56&quot;,
      &quot;bid&quot;: &quot; &quot;,
      &quot;unique_vendor_identifier&quot;: &quot; &quot;,
      &quot;web_order_line_item_id&quot;: &quot;1000000045717939&quot;,
      &quot;original_purchase_date_ms&quot;: &quot;1547025995000&quot;,
      &quot;expires_date_formatted&quot;: &quot;2019-07-18 06:19:17 Etc/GMT&quot;,
      &quot;purchase_date&quot;: &quot;2019-07-18 06:16:17 Etc/GMT&quot;,
      &quot;is_in_intro_offer_period&quot;: &quot;false&quot;,
      &quot;purchase_date_ms&quot;: &quot;1563430577000&quot;,
      &quot;expires_date_formatted_pst&quot;: &quot;2019-07-17 23:19:17 America/Los_Angeles&quot;,
      &quot;is_trial_period&quot;: &quot;false&quot;,
      &quot;purchase_date_pst&quot;: &quot;2019-07-17 23:16:17 America/Los_Angeles&quot;,
      &quot;original_purchase_date&quot;: &quot;2019-01-09 09:26:35 Etc/GMT&quot;,
      &quot;item_id&quot;: &quot;1298435177&quot;
    }
  }
  </code></pre>
  <p>But in the documentation they have mentioned :</p>
  <pre><code> environment
   notification_type
   password
   cancellation_date
   cancellation_date_pst
   cancellation_date_ms
   web_order_line_item_id
   latest_receipt
   latest_receipt_info
   latest_expired_receipt
   latest_expired_receipt_info
   auto_renew_status
   auto_renew_product_id
   auto_renew_status_change_date
   auto_renew_status_change_date_pst
   auto_renew_status_change_date_ms
  </code></pre>
  <p>I am not getting the main fields such as <strong>environment and  notification_type</strong>.</p>
  <p>Whats wrong in it ?</p>
  <p>For the first time this is the response i am getting</p>
  <pre><code>{ latest_receipt: 'ewoJInNpZ25hdHVyZ'}
  </code></pre>
  <p>The response which i am getting from the server 2 server notification is on the second time (once its renewed):</p>
  <pre><code>{ environment: 'Sandbox',
    auto_renew_status: 'false',
    latest_expired_receipt: 'ewoJIn'
  }
  </code></pre>