Articles in this section
Category / Section

How to Create Passes via API in Neostore

Published:
Updated:

How to Create Passes via API in Neostore

Introduction

This article will guide you through the steps to configure Neostore and create passes via API. It includes Swagger & Postman examples and detailed instructions to ensure successful integration.


Prerequisites

Before proceeding, ensure you have the following:

  1. Neostore Platform Activated: Your Neostore account and platform should be active.
  2. API Key Generated: Generate an API key from the Neostore admin console (API Key Generation Guide).
  3. Pass Type Template Configured: Create and configure a pass type template in the Neostore Wallet.
  4. Variables Assigned: Assign variables in the pass type to match wallet fields in Apple and Google Wallet that will be populated via the API call.

Step-by-Step Guide

Step 1: Configure Neostore

  1. Create a Pass Type Template:

    • Navigate to the Pass Type section in the admin console.
    • Define a new pass type and configure fields as required.
  2. Define Variables:

    • Map variables to the pass type fields. These variables will be populated by the API calls.

1.png

  1. Generate an API Key:

Step 2: Access the API

  1. Connect to Swagger UI or Postman Collection:

  2. Authenticate Using the API Key:

    • Add the API key to the Authorization header of your requests.
    • Clic Authorize, then enter your API key (eg. in Swagger)

2.png

Step 3: Create a Pass via API

  1. Test the POST Method:
    • Endpoint: /api/passes
    • Required Parameters:
      • tenantId: Name of your tenant.
      • passType: Name of the pass type configured.
    • Request Body:
    • Select application/json format:

3.png

  • Example:

4.png

  1. Successful Response:
    • You will receive a passId in the response. Example:

5.png

Step 4: View or Download the Pass

  1. Admin Console:
    • Go to the Wallet section and filter by passId to view, edit, or download the pass.

6.png

  1. Pass URL:
    • Retrieve the download URL for the pass via the API response or admin console.
    • Use the QR code to add the pass to your mobile wallet.

7.png


Tips and Best Practices

  1. Examples for Different Pass Types:

    • Loyalty Card:
      {
        "identifiers": {"customerId": "12345"},
        "additionalData": {"points": "150"}
      }
      
    • Event Ticket:
      {
        "identifiers": {"eventId": "concert2024"},
        "additionalData": {"seat": "A12"}
      }
      
    • Coupon:
      {
        "extensions": {"couponCode": "DISCOUNT10"}
      }
      
  2. Testing:

  3. Error Handling:

    • Ensure proper handling of API errors, such as authentication failures or invalid parameters.

Conclusion

Creating passes via the Neostore API enables seamless integration with third-party systems and enhances the user experience. By following this guide, you can configure Neostore, create and manage passes, and retrieve them efficiently. For more advanced use cases, explore additional articles in the Knowledge Base.

Access denied
Access denied