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:
- Neostore Platform Activated: Your Neostore account and platform should be active.
- API Key Generated: Generate an API key from the Neostore admin console (API Key Generation Guide).
- Pass Type Template Configured: Create and configure a pass type template in the Neostore Wallet.
- 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
-
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.
-
Define Variables:
- Map variables to the pass type fields. These variables will be populated by the API calls.
- Generate an API Key:
- Access the API settings in the admin console and generate a key for authentication.
Step 2: Access the API
-
Connect to Swagger UI or Postman Collection:
- Swagger URL: Neostore Swagger UI
- Import the Postman collection (link here).
-
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)
- Add the API key to the
Step 3: Create a Pass via API
- 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:
- Endpoint:
- Example:
- Successful Response:
- You will receive a
passId
in the response. Example:
- You will receive a
Step 4: View or Download the Pass
- Admin Console:
- Go to the Wallet section and filter by
passId
to view, edit, or download the pass.
- Go to the Wallet section and filter by
- 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.
Tips and Best Practices
-
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"} }
- Loyalty Card:
-
Testing:
- Always test API calls in a staging environment before going live.
- Staging url: https://admin-qa.neostore.cloud/
-
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.