Draft Narvar Notification Center Hipaa

Draft Narvar Notification Center Hipaa

Narvar Notification Center API for Hipaa clients

Base URL

https://ws-st01.narvar.qa/api/v1
Operations
POST /api/v1/auth/token
Introduction
string optional

The Narvar Notification Center API is implemented using the Narvar HIPAA stack. All PHI is stored in encrypted format at all times. Narvar Implementation consultant will send the keys for Staging. Production keys will be sent directly by the Narvar HIPAA team.

For HIPAA staging all calls will be made from the following host: https://hipaa-staging.narvar.com/api/v1 For HIPAA production all calls will be made from the following host: https://hipaa.narvar.com/api/v1

How this works: Step 1: Make the initial call to get tokens. These will be used for any subsequent calls to HIPAA endpoint. The tokens have a two hour lifespan which is also returned in the initial response. " Please only make one call per 2 hour session. There is no need to make a call for each HIPAA request"

Step 2: Using the response tokens as basic auth credentials for the HIPAA calls, you can now make POSTs, PUTs and GETs. All PHI data is encrypted.

The Postman collection for Notification Center API can be found here https://www.getpostman.com/collections/c8ac94a3455d6c8dd943

Authentication
POST /api/v1/auth/token

Authentication

basicAuth

Create tokens for the HIPAA auth call. This gives a set of credentials that lasts for two hours. The user can use this to make all subsequent HIPAA calls.

Request headers

Basic Auth
string optional
Example:
UUVWdVF3RUFUOHZDM2tLZ0JWcldhN2tRVjJPbzRaZ3BNM3hnQ01qNTZRL0hmckxmQjhKMHB6bWVtSWd4MENUYlliT0hQUlRkOlFFVnVRd0VBYytrVnhycisyQ0FqYWhKNmI1QjN2S1RQMHBnSEVqaWFtT2JXSyt1Y3hMdnlKQ3JDdjlMbHhIQzgwcnpCZS9ocA==

Responses

201 Created
Body
application/json
Object
username
string
Example:
QEVuQwEAT8vC3kKgBVrWa7kQV2Oo4ZgpM3xgCMj56Q/HfrLfB8J0pzmemIgx0CTbYbOHPRTd
password
string
Example:
QEVuQwEAc+kVxrr+2CAjahJ6b5B3vKTP0pgHEjiamObWK+ucxLvyJCrCv9LlxHC80rzBe/hp
expiry
integer
Example:
1566853758
Customer level opt in
GET /notify-preferences/customer-level/customer/{customer_id}
POST /notify-preferences/customer-level/customer/{customer_id}
PUT /notify-preferences/customer-level/customer/{customer_id}
Get Customer
GET /notify-preferences/customer-level/customer/{customer_id}

Authentication

basicAuth

Retrieve existing customer preferences using a customer ID for a customer. This method must be used prior to updating a customer preference. The modified_datetime value from the GET response must be provided in the PUT request.

Path variables

customer_id
string required

pass the customer id (case sensitive)

Responses

200 200

Returns customer preferences

Body
application/json
Object
status
string
Example:
OK
messages
Array
string
Example:
success
customer_preferences
Object
first_name
string

Customer first name

Example:
Vlad
last_name
string

Customer last name

Example:
Smith
locale
string

The customer locale; default is en_US

Example:
en_US
notification_pref_details
Array

Notification preferences for the user

Object
channel
string

The opt in channel

Example:
sms
contact
string

The contact information for the channel

Example:
777-777-7777
contact_detail_list
Array

List of contact details for the channel

Object
contact
string required

The contact information for the channel

Example:
777-777-7777
os_type
string

OS type

Enumeration:
android

Android device

ios

iOS device

device_id
string

Unique id for the device like IMEI etc

Example:
123456789
modified_datetime
string

The last time the record has been modified. All dates and times are expressed in ISO 8601, with a UTC offset (denoted by the Z)

Example:
2018-04-10T17:33:36.742Z
400 Bad Request

Bad Request

401 Unauthorized

Unauthorized

500 Internal Server Error

Internal Server Error

Example
GET https://ws-qa01.narvar.qa/api/v1/notify-preferences/customer-level/customer/1234 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "status": "OK",
    "messages": [
        "success"
    ],
    "customer_preferences": {
        "first_name": "Vlad",
        "last_name": "Smith",
        "locale": "en_US",
        "notification_pref_details": [
            {
                "channel": "sms",
                "contact": "777-777-7777"
            }
        ],
        "modified_datetime": "2018-04-10T17:33:36.742Z"
    }
}
Post Customer
POST /notify-preferences/customer-level/customer/{customer_id}

Authentication

basicAuth

Create a new customer and notification preference record for a customer. A customer notification preference is considered as an opt-in for notifications in the preferred channel for all new orders. It is very important that the customer id used for a customer, is not used to represent any other customer, or guest. This is to ensure Narvar can accurately display and update notification preferences.

Path variables

customer_id
string required

The unique identifier that represents the customer (case sensitive)

Request body

application/json

The customer’s notification preferences

Object
customer_preferences
Object required

The notifiation preferences for the customer

traffic_source
string required

Location where the user updated opt in preferences

Enumeration:
MY_ACCOUNT_PAGE

A retailer’s account or order history page

ORDER_CONFIRMATION_PAGE

A retailer’s page after an order has been placed

ORDER_CHECKOUT_PAGE

A retailer’s page during the checkout flow

first_name
string required

Customer first name

Example:
John
last_name
string required

Customer last name

Example:
Doe
notification_pref_details
Array required

Notification preferences for the user

Object
channel
string required

The opt in channel

Example:
sms
contact
string

The contact information for the channel

Example:
777-777-7777
contact_detail_list
Array

List of contact details for the channel

Object
contact
string required

The contact information for the channel

Example:
777-777-7777
os_type
string

OS type

Enumeration:
android

Android device

ios

iOS device

device_id
string

Unique id for the device like IMEI etc

Example:
123456789
locale
string

The customer locale; default is en_US

Example:
en_US

Responses

201 Created

ITEM CREATED

400 Bad Request

Bad request or invalid phone number

401 Unauthorized

Unauthorized

500 Internal Server Error

Internal Server Error

Example
POST https://ws-qa01.narvar.qa/api/v1/notify-preferences/customer-level/customer/1234 HTTP/1.1 

Content-Type: application/json

{
    "customer_preferences": {
        "traffic_source": "MY_ACCOUNT_PAGE",
        "first_name": "John",
        "last_name": "Doe",
        "notification_pref_details": [
            {
                "channel": "sms",
                "contact": "777-777-7777"
            }
        ],
        "locale": "en_US"
    }
}

HTTP/1.1 201 Created 
Put Customer
PUT /notify-preferences/customer-level/customer/{customer_id}

Authentication

basicAuth

Update an existing customer record to add or modify notification preferences for a customer. Modifications include changing preference details or opting out of notifications. In order to conform to REST, full resource representation is expected. For example, if an optional field (phone number) is blank in the request, the API will delete the existing phone number from the customer preferences.

Path variables

customer_id
string required

The unique identifier that represents the customer (case sensitive)

Request body

application/json

The customer’s notification preferences

Object
customer_preferences
Object required

The notifiation preferences for the customer

traffic_source
string required

Location where the user updated opt in preferences

Enumeration:
MY_ACCOUNT_PAGE

A retailer’s account or order history page

ORDER_CONFIRMATION_PAGE

A retailer’s page after an order has been placed

ORDER_CHECKOUT_PAGE

A retailer’s page during the checkout flow

first_name
string required

Customer first name

Example:
John
last_name
string required

Customer last name

Example:
Doe
notification_pref_details
Array required

Notification preferences for the user

Object
channel
string required

The opt in channel

Example:
sms
contact
string

The contact information for the channel

Example:
777-777-7777
contact_detail_list
Array

List of contact details for the channel

Object
contact
string required

The contact information for the channel

Example:
777-777-7777
os_type
string

OS type

Enumeration:
android

Android device

ios

iOS device

device_id
string

Unique id for the device like IMEI etc

Example:
123456789
locale
string

The customer locale; default is en_US

Example:
en_US
modified_datetime
string required

The most recent time when the user updated their preferences. All dates and times are expressed in ISO 8601, with a UTC offset (denoted by the Z)

Example:
2018-09-17T22:33:12.848Z

Responses

200 OK

OK

400 Bad Request

Bad request or invalid phone number

401 Unauthorized

Unauthorized

500 Internal Server Error

Internal Server Error

Example
PUT https://ws-st01.narvar.qa/api/v1/notify-preferences/customer-level/customer/1234 HTTP/1.1 

Content-Type: application/json

{
    "customer_preferences": {
        "traffic_source": "MY_ACCOUNT_PAGE",
        "first_name": "John",
        "last_name": "Doe",
        "notification_pref_details": [
            {
                "channel": "sms",
                "contact": "777-777-7777"
            }
        ],
        "locale": "en_US",
        "modified_datetime": "2017-12-21T23:34:06.114905"
    }
}

HTTP/1.1 200 OK 
Order level opt in
POST /notify-preferences/order-level/customer/{customer_id}/order/{order_id}
GET /notify-preferences/order-level/customer/{customer_id}
PUT /notify-preferences/order-level/customer/{customer_id}/order/{order_id}
Post Order
POST /notify-preferences/order-level/customer/{customer_id}/order/{order_id}

Authentication

basicAuth

Create a new order-level preference for a guest customer opt-in. The guest customer will receive notifications for the specific order. It is very important that the customer id used for a guest is unique, and will not be used again for any other opt-in. This is to ensure Narvar can accurately display and update notification preferences.

Path variables

customer_id
string required

The unique identifier that represents the customer (case sensitive)

order_id
string required

Order number

Request body

application/json

The customer’s notification preferences for the order

Object
order_preferences
Object required
traffic_source
string required

Location where the user updated opt in preferences

Enumeration:
MY_ACCOUNT_PAGE

A retailer’s account or order history page

ORDER_CONFIRMATION_PAGE

A retailer’s page after an order has been placed

ORDER_CHECKOUT_PAGE

A retailer’s page during the checkout flow

order_id
string required

Order number for the opt in

Example:
9876
first_name
string required

Customer first name

Example:
John
last_name
string required

Customer last name

Example:
Doe
notification_pref_details
Array required

Notification preferences for the user

Object
channel
string required

The opt in channel

Example:
sms
contact
string

The contact information for the channel

Example:
777-777-7777
contact_detail_list
Array

List of contact details for the channel

Object
contact
string required

The contact information for the channel

Example:
777-777-7777
os_type
string

OS type

Enumeration:
android

Android device

ios

iOS device

device_id
string

Unique id for the device like IMEI etc

Example:
123456789
locale
string

The customer locale; default is en_US

Example:
en_US
is_guest
boolean required

At this time only true should be passed in this field

Example:
true
is_active
string required

At this time only true should be passed in this field

Example:
true

Responses

201 201

ITEM CREATED

application/json
400 Bad Request

Bad request or invalid phone number

401 Unauthorized

Unauthorized

500 Internal Server Error

Internal Server Error

Example
POST https://ws-st01.narvar.qa/api/v1/notify-preferences/order-level/customer/1234/order/9876 HTTP/1.1 

Content-Type: application/json

{
    "order_preferences": {
        "traffic_source": "MY_ACCOUNT_PAGE",
        "order_id": "9876",
        "first_name": "John",
        "last_name": "Doe",
        "notification_pref_details": [
            {
                "channel": "sms",
                "contact": "777-777-7777"
            }
        ],
        "locale": "en_US",
        "is_guest": true,
        "is_active": true
    }
}

HTTP/1.1 201 Created 
Get Order
GET /notify-preferences/order-level/customer/{customer_id}

Authentication

basicAuth

Retrieve order preferences for a given customer ID for a guest customer.

Path variables

customer_id
string required

pass the customer id (case sensitive)

Request parameters

order_id
string optional

Pass in an order id to return results for one order

is_include_inactive
boolean optional

Default false, all active orders will be returned, set to true if inactive orders should be returned

Responses

200 200

Returns customer preferences

Body
application/json
Object
status
string
Example:
OK
messages
Array
string
Example:
success
order_preferences
Array
Object
order_id
string

Order to which the user has subscribed

Example:
9876
first_name
string

Customer first name

Example:
Nanda
last_name
string

Customer last name

Example:
Kumar
locale
string

The customer locale; default is en_US

Example:
en_US
is_guest
string
Example:
false
is_active
string

Informs whether the order is active or not

Example:
true
notification_pref_details
Array

Notification preferences for the user

Object
channel
string

The opt in channel

Example:
sms
contact
string

The contact information for the channel

Example:
777-777-7777
contact_detail_list
Array

List of contact details for the channel

Object
contact
string required

The contact information for the channel

Example:
777-777-7777
os_type
string

OS type

Enumeration:
android

Android device

ios

iOS device

device_id
string

Unique id of device like IMEI etc

Example:
123456789
modified_datetime
string

The last time the record was modified. All dates and times are expressed in ISO 8601, with a UTC offset (denoted by the Z)

Example:
2018-04-10T22:02:41.349Z
400 Bad Request

Bad Request

401 Unauthorized

Unauthorized

500 Internal Server Error

Internal Server Error

Example
GET https://ws-qa01.narvar.qa/api/v1/notify-preferences/order-level/customer/1234?order_id=9876&is_include_inactive=true HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "status": "OK",
    "messages": [
        "success"
    ],
    "order_preferences": [
        {
            "order_id": "9876",
            "first_name": "Nanda",
            "last_name": "Kumar",
            "locale": "en_US",
            "is_guest": false,
            "is_active": true,
            "notification_pref_details": [
                {
                    "channel": "sms",
                    "contact": "777-777-7777"
                }
            ],
            "modified_datetime": "2018-04-10T22:02:41.349Z"
        }
    ]
}
Put Order
PUT /notify-preferences/order-level/customer/{customer_id}/order/{order_id}

Authentication

basicAuth

Update an existing customer order-level record to add or modify notification preferences for a customer. Modifications include changing preference details or opting out of notifications. In order to conform to REST, full resource representation is expected. For example, if an optional field (phone number) is blank in the request, the API will delete the existing phone number from the customer preferences.

Path variables

customer_id
string required

The unique identifier that represents the customer (case sensitive)

order_id
string required

Order number

Request body

application/json

The customer’s notification preferences

Object
order_preferences
Object required
traffic_source
string required

Location where the user updated opt in preferences

Enumeration:
ORDER_CONFIRMATION_PAGE

A retailer’s page after an order has been placed

MY_ACCOUNT_PAGE

A retailer’s account or order history page

ORDER_CHECKOUT_PAGE

A retailer’s page during the checkout flow

order_id
string required
Example:
9876
first_name
string required
Example:
John
last_name
string required

Customer last name

Example:
Doe
notification_pref_details
Array required

Notification preferences for the user

Object
channel
string required

The opt in channel

Example:
sms
contact
string

The contact information for the channel

Example:
777-777-7777
contact_detail_list
Array

List of contact details for the channel

Object
contact
string required

The contact information for the channel

Example:
777-777-7777
os_type
string

OS type

Enumeration:
android

Android device

ios

iOS device

device_id
string

Unique id for the device like IMEI etc

Example:
123456789
locale
string

The customer locale; default is en_US

Example:
en_US
is_guest
boolean required

At this time only true should be passed in this field

Example:
true
is_active
string required

At this time only true should be passed in this field

Example:
true
modified_datetime
string required

The most recent time when the user updated their preferences. All dates and times are expressed in ISO 8601, with a UTC offset (denoted by the Z)

Example:
2018-09-17T22:33:12.848Z

Responses

200 OK
400 Bad Request

Bad request or invalid phone number

401 Unauthorized

Unauthorized

500 Internal Server Error

Internal Server Error

Example
PUT https://ws-st01.narvar.qa/api/v1/notify-preferences/order-level/customer/1234/order/9876 HTTP/1.1 

Content-Type: application/json

{
    "order_preferences": {
        "traffic_source": "MY_ACCOUNT_PAGE",
        "order_id": "9876",
        "first_name": "John",
        "last_name": "Doe",
        "notification_pref_details": [
            {
                "channel": "sms",
                "contact": "777-777-7777"
            }
        ],
        "locale": "en_US",
        "is_guest": true,
        "is_active": true,
        "modified_datetime": "2018-09-17T22:33:12.848Z"
    }
}

HTTP/1.1 200 OK