{"openapi":"3.0.1","info":{"title":"AGR Profile Service API","description":"AGR Profile Service API for managing Amtrak Guest Rewards customer profiles, loyalty information, trips, and wallet.","version":"1.0.0","contact":{"name":"AGR Team","email":"agr-team@amtrak.com"},"license":{"name":"Proprietary","url":"https://www.amtrak.com"}},"servers":[{"url":"https://{dev-host}/{basePath}","description":"Development environment","variables":{"dev-host":{"default":"dev-host","description":"Development API host — substituted at runtime"},"basePath":{"default":"","description":"API base path (e.g. v1, soap/trainstatusv2)"}}},{"url":"https://{stage-host}/{basePath}","description":"Stage environment","variables":{"stage-host":{"default":"stage-host","description":"Stage API host — substituted at runtime"},"basePath":{"default":"","description":"API base path (e.g. v1, soap/trainstatusv2)"}}},{"url":"https://{prod-host}/{basePath}","description":"Production environment","variables":{"prod-host":{"default":"prod-host","description":"Production API host — substituted at runtime"},"basePath":{"default":"","description":"API base path (e.g. v1, soap/trainstatusv2)"}}}],"paths":{"/consumers/profile":{"get":{"tags":["Profile Management"],"summary":"Get customer profile","description":"Retrieves the AGR customer profile by AGR number","operationId":"getProfile","parameters":[{"name":"agrNumber","in":"query","required":false,"schema":{"type":"string"},"description":"AGR loyalty program number"}],"responses":{"200":{"description":"Profile retrieved successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Profile not found"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"put":{"tags":["Profile Management"],"summary":"Update customer profile","description":"Fully updates the AGR customer profile","operationId":"updateProfile","parameters":[{"name":"agrNumber","in":"query","required":false,"schema":{"type":"string"}},{"name":"partialUpdate","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Profile updated successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Profile not found"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"patch":{"tags":["Profile Management"],"summary":"Partially update customer profile","description":"Partially updates the AGR customer profile","operationId":"patchProfile","parameters":[{"name":"agrNumber","in":"query","required":false,"schema":{"type":"string"}},{"name":"partialUpdate","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Profile partially updated successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/profiles":{"get":{"tags":["Profile Management"],"summary":"Search customer profiles","description":"Searches for AGR customer profiles by various criteria","operationId":"searchProfiles","parameters":[{"name":"agrNumber","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"reservationNumber","in":"query","required":false,"schema":{"type":"string"}},{"name":"firstName","in":"query","required":false,"schema":{"type":"string"}},{"name":"lastName","in":"query","required":false,"schema":{"type":"string"}},{"name":"zip","in":"query","required":false,"schema":{"type":"string"}},{"name":"pnrCreateDt","in":"query","required":false,"schema":{"type":"string"}},{"name":"ticketNumber","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Profiles found successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/profile/loyalty-info":{"get":{"tags":["Loyalty Management"],"summary":"Get loyalty information","description":"Retrieves the AGR customer loyalty information","operationId":"getLoyaltyInfo","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"},"description":"AGR loyalty program number"}],"responses":{"200":{"description":"Loyalty info retrieved successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"put":{"tags":["Loyalty Management"],"summary":"Update loyalty information","description":"Updates the AGR customer loyalty information","operationId":"updateLoyaltyInfo","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyUpdateRequest"}}}},"responses":{"200":{"description":"Loyalty info updated successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/profile/loyalty-info/authorizeduserinfo":{"get":{"tags":["Loyalty Management"],"summary":"Get authorized user information","description":"Retrieves authorized user information for the AGR account","operationId":"getAuthorizedUserInfo","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Authorized user info retrieved successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/profile/loyalty-info/accountStatus":{"put":{"tags":["Loyalty Management"],"summary":"Update account status","description":"Updates the customer AGR account status","operationId":"updateAccountStatus","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountStatusRequest"}}}},"responses":{"200":{"description":"Account status updated successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/profile/loyalty-info/cardInfo":{"post":{"tags":["Loyalty Management"],"summary":"Create card information","description":"Creates new loyalty card information for the customer","operationId":"createCardInfo","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Card info created successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"put":{"tags":["Loyalty Management"],"summary":"Update card information","description":"Updates existing loyalty card information for the customer","operationId":"updateCreditCard","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Card info updated successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/mytrips":{"get":{"tags":["Trip Management"],"summary":"Get customer trips","description":"Retrieves the trip history for an AGR customer","operationId":"getMyTrips","parameters":[{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"},"description":"AGR loyalty program number"}],"responses":{"200":{"description":"Trips retrieved successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/mytrips/pnrs":{"post":{"tags":["Trip Management"],"summary":"Get trips by PNR","description":"Retrieves trip information based on PNR numbers","operationId":"getTripsByPnr","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Trips retrieved successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/my-wallet":{"get":{"tags":["Wallet Management"],"summary":"Get customer wallet","description":"Retrieves the AGR customer wallet including payment cards","operationId":"getWallet","parameters":[{"name":"agrNumber","in":"query","required":false,"schema":{"type":"string"},"description":"AGR loyalty program number"}],"responses":{"200":{"description":"Wallet retrieved successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/my-wallet/{cardType}":{"post":{"tags":["Wallet Management"],"summary":"Add payment card","description":"Adds a new payment card to the customer wallet","operationId":"addPaymentCard","parameters":[{"name":"cardType","in":"path","required":true,"schema":{"type":"string"},"description":"Card type (credit-card, digital-wallet, gift-card)"},{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Card added successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"put":{"tags":["Wallet Management"],"summary":"Update payment card","description":"Updates an existing payment card in the customer wallet","operationId":"updatePaymentCard","parameters":[{"name":"cardType","in":"path","required":true,"schema":{"type":"string"},"description":"Card type (credit-card, digital-wallet, gift-card)"},{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Card updated successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"delete":{"tags":["Wallet Management"],"summary":"Delete payment card","description":"Removes a payment card from the customer wallet","operationId":"deletePaymentCard","parameters":[{"name":"cardType","in":"path","required":true,"schema":{"type":"string"},"description":"Card type (credit-card, digital-wallet, gift-card)"},{"name":"agrNumber","in":"query","required":true,"schema":{"type":"string"}},{"name":"number","in":"query","required":true,"schema":{"type":"string"},"description":"Card number to remove"}],"responses":{"200":{"description":"Card deleted successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/consumers/unsubscribe":{"post":{"tags":["Unsubscribe Management"],"summary":"Process unsubscribe request","description":"Processes a customer unsubscribe request for communication preferences","operationId":"processUnsubscribe","parameters":[{"name":"agrNumber","in":"query","required":false,"schema":{"type":"string"},"description":"AGR loyalty program number"},{"name":"custID","in":"query","required":false,"schema":{"type":"string"},"description":"Customer ID (alternative to agrNumber)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Unsubscribe processed successfully"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}}},"components":{"schemas":{"LoyaltyUpdateRequest":{"type":"object","description":"Loyalty information update request","properties":{"pointBalance":{"type":"integer","example":0},"qualifyingPointsYTD":{"type":"integer","example":0},"enrollmentDate":{"type":"string","example":"2020-12-18T17:13:29.417Z"},"tierInfo":{"type":"object"},"cardInfo":{"type":"array","items":{"type":"object"}}}},"AccountStatusRequest":{"type":"object","description":"Account status update request","properties":{"accountStatus":{"type":"string","example":"ACTIVE","enum":["ACTIVE","INACTIVE","SUSPENDED","CLOSED"]},"reason":{"type":"string","example":"Customer request"},"effectiveDate":{"type":"string","example":"2024-01-15"},"notifyCustomer":{"type":"boolean","example":true}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Azure AD OAuth2 JWT token. Pass as 'Authorization: Bearer <token>'."}}}}