last-mile-service-old

Same day package and prescription delivery
Operations
GET /api/delivery/v1/authenticate
POST /api/delivery/v1/createdelivery
POST /api/delivery/v1/canceldelivery
POST /api/delivery/v1/validateaddress
Get a API Key

Sign in to your Packetek Pharmacy Account here https://sandbox.packetek.nyc.
enter these credentials

username: pharmacy@bestrx.com
password: bestrx12345

click menu on top right menu, click corporate Information
Generate Keys if not created already
Copy the App key
To use the API key in a request header, specify the key in the HTTP_X_APP_KEY parameter in the request header.

Authenticate
GET /api/delivery/v1/authenticate

Use this API to Authenticate the Keys and get default values for specific to Pharmacy Client. This will return the default Pickup Location Address.

Request headers

X-APP-KEY
string optional

Authentication Appkey generated from Pharmacy Login

Example:
************************************
X-PROVIDER-KEY
string optional

Authentication key for integration provider issued by Packetek

Example:
994ba545ba9b619460899bfd0a28edb589acabd44136dd48887acccc7edc5a20

Responses

200 OK
Body
Object
Code
string

Http Status Code

Example:
200
ErrorCode
unknown nullable

Http Status Code description

Example:
Bad Request
Details
Object

Indicates the response Payload

pickup
Object
default_location_id
string

This can be used in createdelivery API to Identify the default pickup address for Pharmacy

Example:
88
name
string

Name of Pharmacy

Example:
New York City Pharmacy
contact_name
string

Name of contact person in the Pharmacy

Example:
Pharmacy Contact Person Name
contact_phone
string
Example:
7186632000
address
Object
address_line_1
string

Complete Address of Pharmacy Pickup Location

Example:
Butterfield Rd Suite 200S Oak Brook IL 60523 60523
address_line_2
string

Street Address Line 2 of the pharmacy.

city
string

City of the pharmacy.

state
string

State of the pharmacy.

zip_code
unknown nullable

Zipcode of the pharmacy.

longitude
unknown nullable

Map coordinates of the pharmacy.

latitude
unknown nullable

Map coordinates of the pharmacy.

is_default_location
string

Confirmation bit for default address

Example:
1
Msg
string

Customized description

Status
string

Indicates request validity

Example:
true
404 Location Not Found
Body
Object
Code
string
Example:
404
ErrorCode
string
Example:
404
Details
Array of unknown
Msg
string
Example:
No location found!
Status
string
Example:
false
Create Delivery
POST /api/delivery/v1/createdelivery

Use this API to create a delivery order.
You have to pass all the required params at the minimum to create a delivery order. You can add additional parameters as per your preference.

Request headers

X-PROVIDER-KEY
string optional

Authentication key for integration provider issued by Packetek

Example:
************************************
X-APP-KEY
string optional

Authentication Appkey generated from Pharmacy Login

Example:
************************************

Request body

Object
bestrx_pharmacy_id
string required

Unique GUID representing the Provider client.

Example:
ef0a4740-0be9-44f7-b89d-9e66eeba0b9a
bestrx_unique_order_id
integer required

The Unique Order ID generated within the Provider Rx system for Identifying the Order. This should be unique across the system.

Example:
123213
refrigeration_needed
boolean

Set to true if item is a fridge medication.

Default:
false
signature_required
string

Indicates if the recipient’s signature is required at the time of delivery.

Default:
true
dob_required
boolean

Indicates if the recipient’s date of Birth verification is required at the time of delivery.

Default:
false
amount_to_collect
string

If greater than zero, copayment will be collected

Example:
25.20
sensitive_delivery
boolean

Set to true if item needs special Handling

Default:
false
delivery_notes
string
  1. Enter patient delivery date in square brackets if given patient dob will be verify at the time of drop off.
  2. Enter delivery notes inside colons.
Example:
[2023-12-28] :note text:
store
Object

object with details of Pharmacy and pickup Location

name
string

Name of Pharmacy

Example:
New York City Pharmacy
phone
string

Phone number of the pharmacy.

Example:
718-663-2000
address
Object
address_line_1
string

Complete address of Pharmacy Pickup Location

Example:
Butterfield Rd
address_line_2
string

Street Address Line 2 of the pharmacy.

Example:
Suite 200S
city
string

City of the pharmacy.

Example:
Oak Brook
state
string

State of the pharmacy.

Example:
IL
zip_code
string

Zip code of the pharmacy.

Example:
60523
recipient
Object

Object with details about the recipient of the delivery order.

entity_name
string
Example:
Doe Industries
last_name
string
Example:
Doe
first_name
string
Example:
Jane
middle_name
string
Example:
Joplin
address
Object
address_line_1
string
Example:
500 Second Ave
address_line_2
string
Example:
Suite 100
city
string
Example:
Bloomingdale
state
string
Example:
IL
zip_code
string
Example:
60108
home_phone
string
Example:
6305551111
work_phone
string
Example:
6305551111
mobile_phone
string
Example:
45678946785
fax
string
Example:
6305552222
email
string
Example:
jane.doe@doeind.com
customers
Array

List of customers/patients JSON object

Object
patient_unique_id
integer
Example:
111111
last_name
string
Example:
Doe
first_name
string
Example:
Jane
address
Object
address_line_1
string
Example:
123 Main St
address_line_2
string
Example:
Suite 10
city
string
Example:
Lombard
state
string
Example:
IL
zip_code
string
Example:
60523
prescriptions
Array

An array of objects containing information about the prescriptions that are in the delivery order.

Object
customer_unique_id
integer
Example:
111111
rx_number
integer
Example:
610011
fill_date
string
Example:
2022-05-31
amount_due
integer
Example:
10
partial_fill_seqno
integer
Example:
1
consents
Array

Some additional value can be provided in consents

Object
Example:
valid consent_headers: 1) today_rush 2) controlled_substance 3) physical_document_required
consent_header
string

Key name

Example:
today_rush
consent_text
string

Description

Example:
Rush Delivery
consent_inputs
boolean

Key value

Example:
true
consent_type
string
Example:
0

Responses

201 201

Delivery Created

Body
application/json
Object
Code
integer

Response Code

Example:
200
ErrorCode
string

Response Error code

Details
Object

Response Details

DeliveryId
string

Created delivery Id

Example:
126359
Msg
string

Response Message

Example:
Delivery created
Status
boolean

Success status

Example:
true
400 400

Missing Headers

Body
application/json
Object
Code
string

Response Code 1 for success

Example:
400
ErrorCode
string

Response Error code

Example:
400
Details
Array of unknown

Response Details

Msg
string

Response Message

Example:
Missing headers!
Status
boolean

Success status

Example:
false
403 403

Validation Error / Missing Field Data

Body
application/json
Object
Code
integer

Response Code

Example:
2
ErrorCode
unknown

Response Error code

Details
Object

Response Details

Name
string

Field name

Example:
customer_name
Value
unknown

Provided Value

Id
unknown

Field Id

Msg
string

Response Message

Example:
This information must be supplied.
Status
boolean

Success status

Example:
false
Cancel Delivery
POST /api/delivery/v1/canceldelivery

Cancel delivery or shipment

Request headers

X-PROVIDER-KEY
string optional

Authentication key for integration provider issued by Packetek

Example:
************************************
X-APP-KEY
string optional

Authentication Appkey generated from Pharmacy Login

Example:
************************************

Request body

Object
packetek_order_id
string required

Delivery Order Id within Packetek System

Example:
123456
provider_unique_order_id
string

Unique Order Id with in Provider System

Example:
12345678
notes
string

Cancellation note

Example:
Shipment Cancelled

Responses

200 Shipment Cancelled
Body
Object
Code
string
Example:
200
ErrorCode
unknown nullable
Details
Object
data
Object
provider_order_id
string
Example:
123213
provider_unique_pharmacy_id
string
Example:
ef0a4740-0be9-44f7-b89d-9e66eeba0b9a
packetek_order_id
string
Example:
126448
tracking_id
string
Example:
126448
status
string
Example:
true
status_reason
string
Example:
Success
request_is_valid
string
Example:
true
massages
Array of unknown
Msg
string
Status
boolean
Example:
true
403 Already canceled
Body
Object
Code
string
Example:
400
ErrorCode
string
Example:
400
Details
Array of unknown
Msg
string
Example:
The delivery status is already canceled
Status
string
Example:
false
404 Not Found
Body
Object
Code
string
Example:
404
ErrorCode
string
Example:
404
Details
Array of unknown
Msg
string
Example:
Delivery not found - mismatch data.
Status
string
Example:
false
Validate Address
POST /api/delivery/v1/validateaddress

Find nearest locations or landmark to the given address. Searching can be filtered by type.

Request headers

X-PROVIDER-KEY
string optional

Authentication key for integration provider issued by Packetek

Example:
************************************
X-APP-KEY
string optional

Authentication Appkey generated from Pharmacy Login

Example:
************************************

Request body

Object
address
string required

Address to be validate

Example:
1921 WALLACE AVE BRONX NY
city
string required

City

Example:
New york
state
string required

State

Example:
NY
zip_code
string required

Zip Code

Example:
10003
type
string

Search location by,

Enumeration:
address
street
area
city
Default:
address

Responses

200 Success
Body
Object
Details
Object
results
Array
Object
name
string
Example:
1921 Wallace Ave, Bronx, NY 10462-3459, United States
address
Object
address_line_1
string
Example:
1921
address_line_2
string
Example:
Wallace Ave
city
string
Example:
Bronx
state
string
Example:
New York
zip_code
string
Example:
10462-3459
longitude
number
Example:
-73.86466
latitude
number
Example:
40.84868
Msg
string
Example:
Near by suggested results fetched successfully!
Status
boolean
Example:
true
403 Unsupported Zip code
Body
Object
Details
Object
Name
string
Example:
zip_code
Value
string
Example:
104621
Msg
string
Example:
Invalid address. We do not facilitate this ZIP code.
Status
string
Example:
false
403 Unable to find address
Body
Object
Details
Object
Name
string
Example:
address
Value
string
Example:
11
Msg
string
Example:
Unable to fetch coords for address!
Status
string
Example:
false
403 Nearby suggestions not found
Body
Object
Details
Object
Name
string
Example:
address
Value
string
Example:
sdafasdffasdf
Msg
string
Example:
No nearby suggestions found for this address!
Status
boolean
X-PROVIDER-KEY
string optional

Authentication key for integration provider issued by Packetek

Example:
************************************
X-APP-KEY
string optional

Authentication Appkey generated from Pharmacy Login

Example:
************************************