### GET /api/program/{programId}/catalog Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Searches the product catalog for a given program. Supports basic pagination and advanced filtering by category, price range, SKU, name, and brand. ```APIDOC ## GET /api/program/{programId}/catalog ### Description Searches the product catalog for a given program. Supports basic pagination and advanced filtering by category, price range, SKU, name, and brand. ### Method GET ### Endpoint `/api/program/{programId}/catalog` ### Parameters #### Path Parameters - **programId** (string) - Required - The unique identifier for the program. #### Query Parameters - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **limit** (integer) - Optional - The number of items per page. Defaults to 30. - **filter[sku]** (string) - Optional - Filter by SKU. - **filter[name]** (string) - Optional - Filter by product name. - **filter[category]** (string) - Optional - Filter by category ID. - **filter[brand]** (string) - Optional - Filter by brand ID. - **filter[price][min]** (number) - Optional - Minimum price for filtering. - **filter[price][max]** (number) - Optional - Maximum price for filtering. - **filter[ranged]** (boolean) - Optional - Whether to filter by price range. ### Request Example ```bash # Basic catalog search with pagination curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/catalog?page=1&limit=30" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." # Advanced filtering curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/catalog?filter[category]=gift-cards&filter[price][min]=25&filter[price][max]=100&filter[ranged]=false" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ### Response #### Success Response (200 OK) - **page** (integer) - The current page number. - **page_size** (integer) - The number of items on the current page. - **total_count** (integer) - The total number of items available. - **total_page_count** (integer) - The total number of pages. - **data** (array) - An array of product objects. - **sku** (string) - The product's SKU. - **digital** (boolean) - Indicates if the product is digital. - **price_ranged** (boolean) - Indicates if the price is ranged. - **price** (number) - The product's price. - **category** (object) - The product's category information. - **brand** (object) - The product's brand information. - **name** (array) - The product's name in different locales. - **inventory** (integer) - The available inventory count. - **tax_exempt** (boolean) - Indicates if the product is tax-exempt. #### Response Example ```json { "page": 1, "page_size": 30, "total_count": 156, "total_page_count": 6, "data": [ { "sku": "AMAZON-GC-25", "digital": true, "price_ranged": false, "price": 25.00, "category": { "unique_id": "cat-001", "name": [{ "locale": "en_US", "value": "Gift Cards" }] }, "brand": { "unique_id": "brand-001", "name": [{ "locale": "en_US", "value": "Amazon" }] }, "name": [{ "locale": "en_US", "value": "Amazon Gift Card $25" }], "inventory": 9999, "tax_exempt": false } ] } ``` ``` -------------------------------- ### GET /api/program/{programId}/metrics Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Fetch basic metrics for a program including participant count, transaction total, and adjustment total. ```APIDOC ## Program Metrics ### Description Fetch basic metrics for a program including participant count, transaction total, and adjustment total. ### Method GET ### Endpoint `/api/program/{programId}/metrics` ### Parameters #### Path Parameters - **programId** (string) - Required - The unique identifier of the program. ### Request Example ```bash curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/metrics" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ### Response #### Success Response (200) - **participant_total** (integer) - The total number of participants in the program. - **transaction_total** (integer) - The total value of transactions in the program. - **adjustment_total** (integer) - The total value of adjustments made in the program. #### Response Example ```json { "participant_total": 1500, "transaction_total": 8432, "adjustment_total": 12567 } ``` ``` -------------------------------- ### Client API Get Participant PII - Bash Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Client systems must implement this endpoint to provide participant information including balance and shipping address. ADR sends a GET request to the client system's endpoint. ```bash # Client system receives this request from ADR # GET https://your-client-system.com/api/participants/{uuid}/pii curl -X GET "https://your-client-system.com/api/participants/jfp1/pii?lang=en_US" \ -H "api-key: your-api-key" # Expected Response (200): # { # "email_address": "jhoughtelin@alldigitalrewards.com", # "unique_id": "jfp1", # "credit": "1484999.99", # "firstname": "Josh", # "lastname": "Houghtelin", # "phone": "1234567890", # "language": "en_US", # "address": { # "firstname": "Josh", # "lastname": "Houghtelin", # "address1": "12345 Chaparral Rd", # "address2": "", # "city": "Scottsdale", # "state": "AZ", # "zip": "85250", # "country": "840", # "country_code": "US" # }, # "program": "josh-favorite-program" # } ``` -------------------------------- ### GET /api/program/{programId}/participant/{participantId} Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieve full participant details including credit balance, address, and metadata. ```APIDOC ## Participant Management - Get Participant ### Description Retrieve full participant details including credit balance, address, and metadata. ### Method GET ### Endpoint `/api/program/{programId}/participant/{participantId}` ### Parameters #### Path Parameters - **programId** (string) - Required - The unique identifier of the program. - **participantId** (string) - Required - The unique identifier of the participant. ### Request Example ```bash curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ### Response #### Success Response (200) - **unique_id** (string) - The unique identifier for the participant. - **email_address** (string) - The email address of the participant. - **credit** (string) - The current credit balance of the participant. - **firstname** (string) - The first name of the participant. - **lastname** (string) - The last name of the participant. - **phone** (string) - The phone number of the participant. - **birthdate** (string) - The birthdate of the participant (YYYY-MM-DD). - **active** (integer) - Flag indicating if the participant is active. - **status** (string) - The status of the participant. - **created_at** (string) - Timestamp of participant creation. - **updated_at** (string) - Timestamp of last participant update. - **address** (object) - The address details of the participant. - **firstname** (string) - The first name for the address. - **lastname** (string) - The last name for the address. - **address1** (string) - The primary street address. - **address2** (string) - The secondary address line. - **city** (string) - The city. - **state** (string) - The state or province. - **zip** (string) - The postal code. - **country** (string) - The country. - **program** (string) - The program ID the participant belongs to. - **organization** (string) - The organization ID. - **meta** (array) - An array of key-value pairs for custom metadata. - **key** (string) - The metadata key. - **value** (string) - The metadata value. #### Response Example ```json { "unique_id": "EMP-12345", "email_address": "employee@acme.com", "credit": "5000.00", "firstname": "Michael", "lastname": "Johnson", "phone": "555-987-6543", "birthdate": "1985-03-15", "active": 1, "status": "1", "created_at": "2024-01-15 10:30:00", "updated_at": "2024-01-20 14:22:00", "address": { "firstname": "Michael", "lastname": "Johnson", "address1": "456 Oak Avenue", "address2": "Apt 3B", "city": "Chicago", "state": "IL", "zip": "60601", "country": "US" }, "program": "660e8400-e29b-41d4-a716-446655440000", "organization": "550e8400-e29b-41d4-a716-446655440000", "meta": [ { "key": "department", "value": "Engineering" } ] } ``` ``` -------------------------------- ### Program Management - Get Program Details Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieves detailed information for a specific rewards program, including contact details, criteria, and settings. ```APIDOC ## GET /api/program/{program_id} ### Description Retrieve complete program information including contacts, product criteria, auto-redemption settings, and actions. ### Method GET ### Endpoint /api/program/{program_id} ### Parameters #### Header Parameters - **Authorization** (string) - Required - Bearer token for authentication. #### Path Parameters - **program_id** (string) - Required - The unique ID of the program to retrieve. ### Request Example ```bash curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ### Response #### Success Response (200 OK) - **unique_id** (string) - The unique ID of the program. - **name** (string) - The name of the program. - **published** (integer) - The published status of the program. - **collect_ssn** (integer) - Flag indicating if SSN is collected. - **is_avs** (integer) - Flag indicating AVS is enabled. - **point** (integer) - The base point value. - **url** (string) - The URL associated with the program. - **domain_id** (integer) - The domain ID. - **start_date** (string) - Program start date. - **end_date** (string) - Program end date. - **grace_period** (integer) - Grace period in days. #### Response Example ```json { "unique_id": "660e8400-e29b-41d4-a716-446655440000", "name": "Employee Recognition 2024", "published": 1, "collect_ssn": 0, "is_avs": 1, "point": 100, "url": "employee-rewards", "domain_id": 1, "start_date": "2024-01-01", "end_date": "2024-12-31 23:59:59", "grace_period": 30 } ``` ``` -------------------------------- ### Get Transaction List for Participant Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieves a list of all transactions for a participant, with optional filtering by year. Requires program ID and participant ID. ```bash # Get all transactions curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345/transaction" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." # Filter by year curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345/transaction?year=2024" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` -------------------------------- ### Get Participant Details Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieves comprehensive information for a specific participant, including their unique ID, contact details, credit balance, address, and associated metadata. This is useful for viewing individual participant status. ```bash curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` -------------------------------- ### Program Participant Client API - Get Participant PII Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Client systems must implement this endpoint to provide participant information including balance and shipping address. ```APIDOC ## GET /api/participants/{uuid}/pii ### Description Client systems must implement this endpoint to provide participant information including balance and shipping address. ### Method GET ### Endpoint /api/participants/{uuid}/pii ### Parameters #### Path Parameters - **uuid** (string) - Required - The unique identifier of the participant. #### Query Parameters - **lang** (string) - Optional - The language code for the response (e.g., 'en_US'). ### Response #### Success Response (200) - **email_address** (string) - The email address of the participant. - **unique_id** (string) - The unique identifier of the participant. - **credit** (string) - The current credit balance of the participant. - **firstname** (string) - The first name of the participant. - **lastname** (string) - The last name of the participant. - **phone** (string) - The phone number of the participant. - **language** (string) - The language preference of the participant. - **address** (object) - The shipping address of the participant. - **firstname** (string) - First name. - **lastname** (string) - Last name. - **address1** (string) - Address line 1. - **address2** (string) - Address line 2. - **city** (string) - City. - **state** (string) - State/Province. - **zip** (string) - Postal code. - **country** (string) - Country code (numeric). - **country_code** (string) - Country code (alpha-2). - **program** (string) - The program associated with the participant. #### Response Example ```json { "email_address": "jhoughtelin@alldigitalrewards.com", "unique_id": "jfp1", "credit": "1484999.99", "firstname": "Josh", "lastname": "Houghtelin", "phone": "1234567890", "language": "en_US", "address": { "firstname": "Josh", "lastname": "Houghtelin", "address1": "12345 Chaparral Rd", "address2": "", "city": "Scottsdale", "state": "AZ", "zip": "85250", "country": "840", "country_code": "US" }, "program": "josh-favorite-program" } ``` ``` -------------------------------- ### Batch Create Multiple Participants - Bash Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Create multiple participants in a single API call for bulk onboarding. Requires organization and program IDs, and a collection of participant data including unique ID, email, name, and active status. ```bash curl -X POST "https://admin.alldigitalrewards.com/api/batch/participant" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "organization": "550e8400-e29b-41d4-a716-446655440000", "program": "660e8400-e29b-41d4-a716-446655440000", "collection": [ { "unique_id": "EMP-001", "email_address": "emp001@acme.com", "firstname": "Alice", "lastname": "Smith", "active": 1 }, { "unique_id": "EMP-002", "email_address": "emp002@acme.com", "firstname": "Bob", "lastname": "Jones", "active": 1 } ] }' ``` -------------------------------- ### Transactions - Get Transaction List Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieve all transactions for a participant with optional filtering by transaction IDs or year. ```APIDOC ## GET /api/program/{programId}/participant/{participantId}/transaction ### Description Retrieve all transactions for a participant with optional filtering by transaction IDs or year. ### Method GET ### Endpoint `/api/program/{programId}/participant/{participantId}/transaction` ### Parameters #### Path Parameters - **programId** (string) - Required - The unique identifier for the program. - **participantId** (string) - Required - The unique identifier for the participant. #### Query Parameters - **year** (integer) - Optional - Filter transactions by the specified year. - **transaction_ids** (string) - Optional - A comma-separated list of transaction IDs to filter by. #### Request Body None ### Request Example ```bash # Get all transactions curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345/transaction" # Filter by year curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345/transaction?year=2024" ``` ### Response #### Success Response (200 OK) - **id** (integer) - The unique identifier for the transaction. - **unique_id** (string) - A globally unique identifier for the transaction. - **wholesale** (string) - The wholesale cost of the transaction. - **subtotal** (string) - The subtotal cost of the transaction. - **total** (string) - The total cost of the transaction. - **points** (string) - The total points redeemed in the transaction. - **email_address** (string) - The email address associated with the participant. - **locale** (string) - The locale of the transaction. - **created_at** (string) - Timestamp when the transaction was created. - **shipping** (object) - Shipping details for the transaction. - **firstname** (string) - **lastname** (string) - **address1** (string) - **city** (string) - **state** (string) - **zip** (string) - **products** (array) - An array of products included in the transaction. - **name** (string) - The name of the product. - **sku** (string) - The SKU of the product. - **quantity** (integer) - The quantity of the product. - **total** (number) - The total cost for this product line item. - **points** (number) - The total points redeemed for this product line item. - **guid** (string) - The GUID of the product. - **is_digital** (integer) - Indicates if the product is digital (1) or physical (0). #### Response Example ```json [ { "id": 98765, "unique_id": "770e8400-e29b-41d4-a716-446655440000", "wholesale": "45.00", "subtotal": "100.00", "total": "100.00", "points": "10000.00", "email_address": "employee@acme.com", "locale": "en_US", "created_at": "2024-01-20 14:30:00", "shipping": { "firstname": "Michael", "lastname": "Johnson", "address1": "456 Oak Avenue", "city": "Chicago", "state": "IL", "zip": "60601" }, "products": [ { "name": "Amazon Gift Card $25", "sku": "AMAZON-GC-25", "quantity": 2, "total": 50.00, "points": 5000.00, "guid": "880e8400-e29b-41d4-a716-446655440000", "is_digital": 1 } ] } ] ``` ``` -------------------------------- ### Create Webhook Configuration Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Configures a new webhook to receive real-time notifications for specific events, such as transaction creation. Requires organization ID and details like the notification URL, event type, and authentication credentials. ```bash curl -X POST "https://admin.alldigitalrewards.com/api/organization/550e8400-e29b-41d4-a716-446655440000/webhooks" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "title": "Transaction Notifications", "url": "https://myapp.com/webhooks/adr-transactions", "event": "Transaction.create", "username": "webhook_user", "password": "webhook_secret", "active": 1, "immutable": 0 }' ``` -------------------------------- ### POST /api/batch/participant Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Create multiple participants in a single API call for bulk onboarding. ```APIDOC ## POST /api/batch/participant ### Description Create multiple participants in a single API call for bulk onboarding. ### Method POST ### Endpoint /api/batch/participant ### Parameters #### Request Body - **organization** (string) - Required - The organization ID. - **program** (string) - Required - The program ID. - **collection** (array) - Required - A list of participant objects to create. - **unique_id** (string) - Required - Unique identifier for the participant. - **email_address** (string) - Required - Email address of the participant. - **firstname** (string) - Required - First name of the participant. - **lastname** (string) - Required - Last name of the participant. - **active** (integer) - Required - Status of the participant (1 for active, 0 for inactive). ### Request Example ```json { "organization": "550e8400-e29b-41d4-a716-446655440000", "program": "660e8400-e29b-41d4-a716-446655440000", "collection": [ { "unique_id": "EMP-001", "email_address": "emp001@acme.com", "firstname": "Alice", "lastname": "Smith", "active": 1 }, { "unique_id": "EMP-002", "email_address": "emp002@acme.com", "firstname": "Bob", "lastname": "Jones", "active": 1 } ] } ``` ### Response #### Success Response (201 Created) - **message** (string) - Confirmation message. #### Response Example (No specific example provided in source, typically a success confirmation) ``` -------------------------------- ### Transactions - Add/Update Transaction Metadata Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Add or update metadata on an existing transaction using either transaction ID or item GUID. ```APIDOC ## PATCH /api/program/{programId}/participant/{participantId}/transaction/{transactionId}/meta ### Description Add or update metadata on an existing transaction using either transaction ID or item GUID. ### Method PATCH ### Endpoint `/api/program/{programId}/participant/{participantId}/transaction/{transactionId}/meta` ### Parameters #### Path Parameters - **programId** (string) - Required - The unique identifier for the program. - **participantId** (string) - Required - The unique identifier for the participant. - **transactionId** (string) - Required - The unique identifier for the transaction. #### Query Parameters None #### Request Body - **metadata** (array) - Required - An array of metadata objects to add or update. - **key** (string) - Required - The key of the metadata field. - **value** (string) - Required - The value of the metadata field. ### Request Example ```json [ { "key": "fulfillment_status", "value": "shipped" }, { "key": "tracking_number", "value": "1Z999AA10123456784" } ] ``` ### Response #### Success Response (202 Accepted) Returns an empty response upon successful update. #### Response Example (No response body for success) ``` -------------------------------- ### Search Product Catalog Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Searches the product catalog for items. Supports basic pagination and advanced filtering by category, price range, and other attributes. Requires program ID. Returns a paginated list of products matching the criteria. ```bash # Basic catalog search with pagination curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/catalog?page=1&limit=30" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." # Advanced filtering curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/catalog?filter[category]=gift-cards&filter[price][min]=25&filter[price][max]=100&filter[ranged]=false" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` -------------------------------- ### Create Participant Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Adds a new participant to a specified program. It requires essential contact and address details, with optional fields for metadata. The response indicates successful creation. ```bash curl -X POST "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "unique_id": "EMP-12345", "email_address": "employee@acme.com", "firstname": "Michael", "lastname": "Johnson", "phone": "555-987-6543", "birthdate": "03/15/1985", "password": "SecurePass123!", "active": 1, "status": "1", "address": { "firstname": "Michael", "lastname": "Johnson", "address1": "456 Oak Avenue", "address2": "Apt 3B", "city": "Chicago", "state": "IL", "zip": "60601", "country": "US" }, "meta": [ { "key": "department", "value": "Engineering" }, { "key": "hire_date", "value": "2022-06-01" } ] }' ``` -------------------------------- ### POST /api/batch/adjustment Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Issue points to many participants at once for bulk crediting scenarios. ```APIDOC ## POST /api/batch/adjustment ### Description Issue points to many participants at once for bulk crediting scenarios. ### Method POST ### Endpoint /api/batch/adjustment ### Parameters #### Request Body - **organization** (string) - Required - The organization ID. - **program** (string) - Required - The program ID. - **collection** (array) - Required - A list of adjustment objects. - **participant** (string) - Required - The unique ID of the participant. - **amount** (integer) - Required - The number of points to adjust. - **type** (string) - Required - The type of adjustment (e.g., 'credit', 'debit'). - **reference** (string) - Optional - A reference ID for the adjustment. - **description** (string) - Optional - A description for the adjustment. ### Request Example ```json { "organization": "550e8400-e29b-41d4-a716-446655440000", "program": "660e8400-e29b-41d4-a716-446655440000", "collection": [ { "participant": "EMP-001", "amount": 1000, "type": "credit", "reference": "ANNUAL-BONUS-2024", "description": "Annual bonus award" }, { "participant": "EMP-002", "amount": 1500, "type": "credit", "reference": "ANNUAL-BONUS-2024", "description": "Annual bonus award" } ] } ``` ### Response #### Success Response (201 Created) - **message** (string) - Confirmation message. #### Response Example (No specific example provided in source, typically a success confirmation) ``` -------------------------------- ### Batch Create Multiple Point Adjustments - Bash Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Issue points to multiple participants simultaneously for bulk crediting. Requires organization and program IDs, and a collection of adjustment data including participant ID, amount, type, reference, and description. ```bash curl -X POST "https://admin.alldigitalrewards.com/api/batch/adjustment" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "organization": "550e8400-e29b-41d4-a716-446655440000", "program": "660e8400-e29b-41d4-a716-446655440000", "collection": [ { "participant": "EMP-001", "amount": 1000, "type": "credit", "reference": "ANNUAL-BONUS-2024", "description": "Annual bonus award" }, { "participant": "EMP-002", "amount": 1500, "type": "credit", "reference": "ANNUAL-BONUS-2024", "description": "Annual bonus award" } ] }' ``` -------------------------------- ### Program Management - Create Program Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Creates a new rewards program under a specified organization. Configurable with point ratios, URL, and date settings. ```APIDOC ## POST /api/program ### Description Create a new rewards program under an organization with point ratio, URL configuration, and date settings. ### Method POST ### Endpoint /api/program ### Parameters #### Header Parameters - **Authorization** (string) - Required - Bearer token for authentication. - **Content-Type** (string) - Required - `application/json` #### Request Body - **unique_id** (string) - Required - Unique identifier for the program. - **name** (string) - Required - Name of the program. - **organization** (string) - Required - Unique ID of the organization this program belongs to. - **point** (integer) - Required - The base point value for the program. - **url** (string) - Optional - The URL associated with the program. - **phone** (string) - Optional - Phone number for the program. - **active** (integer) - Optional - Status of the program (e.g., 1 for active). - **start_date** (string) - Optional - Program start date (YYYY-MM-DD). - **end_date** (string) - Optional - Program end date (YYYY-MM-DD HH:MM:SS). - **grace_period** (integer) - Optional - Grace period in days after the end date. - **timezone** (string) - Optional - Timezone for the program (e.g., "America/New_York"). - **enable_email_login** (integer) - Optional - Flag to enable email login (e.g., 1 for enabled). ### Request Example ```bash curl -X POST "https://admin.alldigitalrewards.com/api/program" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "unique_id": "660e8400-e29b-41d4-a716-446655440000", "name": "Employee Recognition 2024", "organization": "550e8400-e29b-41d4-a716-446655440000", "point": 100, "url": "employee-rewards.alldigitalrewards.com", "phone": "1-800-REWARDS", "active": 1, "start_date": "2024-01-01", "end_date": "2024-12-31 23:59:59", "grace_period": 30, "timezone": "America/New_York", "enable_email_login": 1 }' ``` ### Response #### Success Response (201 Created) - **unique_id** (string) - The unique ID of the created program. - **name** (string) - The name of the program. - **point** (integer) - The base point value. - **active** (integer) - The active status of the program. - **published** (integer) - The published status of the program. #### Response Example ```json { "unique_id": "660e8400-e29b-41d4-a716-446655440000", "name": "Employee Recognition 2024", "point": 100, "active": 1, "published": 0 } ``` ``` -------------------------------- ### Batch Create Multiple Transactions - Bash Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Process multiple reward redemptions in a single request. Requires organization and program IDs, and a collection of transaction data including participant ID, whether to issue points, and product details. ```bash curl -X POST "https://admin.alldigitalrewards.com/api/batch/transaction" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "organization": "550e8400-e29b-41d4-a716-446655440000", "program": "660e8400-e29b-41d4-a716-446655440000", "collection": [ { "participant": "EMP-001", "issue_points": true, "products": [{ "sku": "AMAZON-GC-25", "quantity": 1 }] }, { "participant": "EMP-002", "issue_points": true, "products": [{ "sku": "STARBUCKS-GC-10", "quantity": 2 }] } ] }' ``` -------------------------------- ### GET /api/organization/{organizationId}/webhooks Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieves a list of all configured webhooks for an organization. This endpoint can also be used to fetch webhook logs, optionally filtered by HTTP status code. ```APIDOC ## GET /api/organization/{organizationId}/webhooks ### Description Retrieves a list of all configured webhooks for an organization. This endpoint can also be used to fetch webhook logs, optionally filtered by HTTP status code. ### Method GET ### Endpoint `/api/organization/{organizationId}/webhooks` ### Parameters #### Path Parameters - **organizationId** (string) - Required - The unique identifier for the organization. #### Query Parameters - **status_code** (integer) - Optional - Filter webhook logs by HTTP status code. ### Request Example ```bash # List all webhooks curl -X GET "https://admin.alldigitalrewards.com/api/organization/550e8400-e29b-41d4-a716-446655440000/webhooks" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." # Get webhook logs filtered by status code curl -X GET "https://admin.alldigitalrewards.com/api/organization/550e8400-e29b-41d4-a716-446655440000/webhooks/123/logs?status_code=500" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ### Response #### Success Response (200 OK) - **webhookLogs** (array) - An array of webhook log objects. - **_id** (object) - The unique identifier for the log entry. - **request_time** (string) - The timestamp of the webhook request. - **http_status** (integer) - The HTTP status code of the response. - **request** (object) - Details of the webhook request. - **responses** (array) - An array of responses received for the webhook. #### Response Example ```json { "webhookLogs": [ { "_id": { "$oid": "65a1b2c3d4e5f6a7b8c9d0e1" }, "request_time": "2024-01-20T14:30:00Z", "http_status": 500, "request": { "headers": { "Content-Type": "application/json" }, "body": "{\"event\":\"Transaction.create\",\"data\":{...}}" }, "responses": [ { "http_status": 500, "body": "Internal Server Error" } ] } ] } ``` ``` -------------------------------- ### GET /api/program/{programId}/participant/{participantId}/sso Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Validates an SSO token and retrieves participant information. This endpoint is used to confirm the authenticity of an SSO token and fetch details about the associated participant. ```APIDOC ## GET /api/program/{programId}/participant/{participantId}/sso ### Description Validates an SSO token and retrieves participant information. This endpoint is used to confirm the authenticity of an SSO token and fetch details about the associated participant. ### Method GET ### Endpoint `/api/program/{programId}/participant/{participantId}/sso` ### Parameters #### Path Parameters - **programId** (string) - Required - The unique identifier for the program. - **participantId** (string) - Required - The unique identifier for the participant. #### Query Parameters - **token** (string) - Required - The SSO token to validate. ### Request Example ```bash curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345/sso?token=sso_abc123def456" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ### Response #### Success Response (200 OK) - **unique_id** (string) - The unique identifier of the participant. - **email_address** (string) - The email address of the participant. - **firstname** (string) - The first name of the participant. - **lastname** (string) - The last name of the participant. - **credit** (string) - The available credit for the participant. #### Response Example ```json { "unique_id": "EMP-12345", "email_address": "employee@acme.com", "firstname": "Michael", "lastname": "Johnson", "credit": "5000.00" } ``` ``` -------------------------------- ### Fetch Program Metrics Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Retrieves key performance indicators for a given program, including the total number of participants, total transactions, and total adjustments. This endpoint is useful for monitoring program health and activity. ```bash curl -X GET "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/metrics" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` -------------------------------- ### Create New Rewards Program Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Creates a new rewards program associated with an organization. This endpoint allows configuration of program-specific settings like point ratios, URLs, dates, and contact information. Requires an active JWT for authentication. ```bash curl -X POST "https://admin.alldigitalrewards.com/api/program" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "unique_id": "660e8400-e29b-41d4-a716-446655440000", "name": "Employee Recognition 2024", "organization": "550e8400-e29b-41d4-a716-446655440000", "point": 100, "url": "employee-rewards.alldigitalrewards.com", "phone": "1-800-REWARDS", "active": 1, "start_date": "2024-01-01", "end_date": "2024-12-31 23:59:59", "grace_period": 30, "timezone": "America/New_York", "enable_email_login": 1 }' # Response (201 Created): # { # "unique_id": "660e8400-e29b-41d4-a716-446655440000", # "name": "Employee Recognition 2024", # "point": 100, # "active": 1, # "published": 0 # } ``` -------------------------------- ### Add/Update Transaction Metadata Source: https://context7.com/alldigitalrewards/rewardstack-api-docs/llms.txt Adds or updates metadata for an existing transaction using either the transaction ID or item GUID. Requires program ID, participant ID, transaction identifier, and an array of key-value metadata pairs. ```bash curl -X PATCH "https://admin.alldigitalrewards.com/api/program/660e8400-e29b-41d4-a716-446655440000/participant/EMP-12345/transaction/770e8400-e29b-41d4-a716-446655440000/meta" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '[ { "key": "fulfillment_status", "value": "shipped" }, { "key": "tracking_number", "value": "1Z999AA10123456784" } ]' ```