Create Delivery

Create Delivery
POST /ApiCorporate/CreateDelivery

This API is used to create delivery for corporate using uniquely assigned APP Key to that particular corporate.

Request headers

HTTP_X_APP_KEY
string required

Corporate App key

Example:
123adfe3e5df3df3df3fd3dfd3dfed3a804106aaec1d
HTTP_X_APP_SIGNATURE
string required

Request Signature, “URL-encoded query string” signed with corporate app secret key with sha256. “query string” should be sort alphbetically before making hash/signature.

Here is the example code in PHP to create signature using coporate app secret.

function CreateSignature($form_data){
    $app_secret = USER_APP_SECRET; // replace with your app secret 
    
    $data = $form_data; 
    ksort($data);   // sort form data keys alphabatically
    $queryString = http_build_query($data); // Generate URL-encoded query string  
    $signature = hash_hmac("sha256", $queryString, $app_secret); // create hash/signature
    return $signature;
}
Example:
f47fa526ec602123adfe3e5df3df3df3fd3dfd3dfed3e

Request body

Object
customer_name
string required

First name of customer

Example:
Frances
customer_last_name
string nullable

Last name of customer

Example:
Giuffre
customer_address
string required

Address of customer

Example:
1921 WALLACE AVE BRONX NY
customer_postal_code
string required

Zip Code / Postal Code of customer

Example:
10462
patient_birth_date
string required

Birthdate of patient, default patient is same as customer

Example:
03/21/1990
provider_id
integer required

Provider’s id in pharmacy / corporate.

Min: 1
Example:
123
drug_info
Array required

Drug info array, each entity containing “rx”, “fill_date” and “copayment”

Example:
drug_info[0][["rx"]=>"123456",["fill_date"]=>"12/23/2010",["copayment"]=>"5"]],
drug_info[1][["rx"]=>"789012",["fill_date"]=>"05/19/1998",["copayment"]=>"5"]]
Object
rx
string required

RX number

Example:
123456
fill_date
string required

Fill date of rx

Pattern: mm/dd/yyyy
Example:
12/25/2010
copayment
integer required

Copayment amount in dollars

Example:
5
expected_date_option
integer required

Expected day to deliver your delivery, integer value

Enumeration:
1

Tomorrow

2

Today

3

Rush Delivery

4

Day after tomorrow

5

Second Day after tomorrow

6

Third Day after tomorrow

Example:
2
delivery_items
integer required

Number of deliveries

Min: 1
Example:
1
delivery_preferred_time
string required

Preffered time to deliver the delivery.

Enumeration:
anytime

any time between 12:00pm and 19:00

before

“before_time_selector” parameter is required if “before” is selected, before_time_selector value must be in between 13 and 19.

after

“after_time_selector” parameter is required if “after” is selected, after_time_selector value must be in between 12 and 18.

Example:
anytime
before_time_selector
integer nullable

Required if “delivery_preferred_time” is “before”, value must be in 13 and 19.

Min: 13
Max: 19
Example:
16
after_time_selector
integer nullable

Required if selected value for “delivery_preferred_time” is “after”, value must be in 12 and 18.

Min: 12
Max: 18
Example:
16
package_type
integer required

Type of package from Prescription, Envelope or Small Package, Medium Package, Large Package

Enumeration:
1

Prescription

2

Envelope or Small Package

3

Medium Package

4

Large Package

Example:
1
package_description
string

Provide description of package/delivery

Example:
ZTLIDO 1.8% PATCH, ZOLPIDEM,TRAZODONE,SYMBICORT,XARELTO,OMEPRAZOLE
delivery_options_list
Object nullable

How to deliver the parcel, array index is used to set the value, value of index 2 and 3 can be setable to “true”, index 2 = “Leave with doorman” and index 3 = “Leave near the patient’s door with the Patient’s authorization”

Example:
delivery_options_list[2]=true
delivery_pick_special_notes
string nullable

Delivery Pickup Note

delivery_future_date
string date nullable

Next delivery in future, if given: must be a future date. Can be null. Default false.

Pattern: mm/dd/yyyy
Example:
08/23/2052
is_controlled_substance
boolean nullable

Set to true if item is a controlled substance. Can be null. Default false.

Default:
false
collect_copayment
boolean nullable

Set to true if you want to collect copayment. Can be null. Default false.

Default:
false
is_fridge_medication
boolean nullable

Set to true if item is a fridge medication. Can be null. Default false.

Default:
false
require_patients_dob
boolean nullable

Set to true if you want signature of patient at the time of delivery. Can be null. Default false.

Default:
false
require_document_signature
boolean nullable

Set to true if document signature required while delivering. Can be null.

Default:
false
sensitive_delivery
boolean nullable

Set to true if item is sensitive. Can be null. Default false.

Default:
false

Responses

201 Created

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 Missing Headers

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
401 Unauthorized

Invalid app key

Body
application/json
Object
Code
string

Response Code 1 for success

Example:
401
ErrorCode
string

Response Error code

Example:
401
Details
Array of unknown

Response Details

Msg
string

Response Message

Example:
Unauthorized - Invalid app key!
Status
boolean

Success status

Example:
false
401 Unauthorized / Invalid Signature

Invalid Signature

Body
application/json
Object
Code
string

Response Code

Example:
401
ErrorCode
string

Response Error code

Example:
401
Details
Array of unknown

Response Details

Msg
string

Response Message

Example:
Unauthorized - Invalid signature!
Status
boolean

Success status

Example:
false
403 Forbidden - Provider not found

Missing Provider

Body
application/json
Object
Code
string

Response Code

Example:
403
ErrorCode
string

Response Error code

Example:
403
Details
Array of unknown

Response Details

Msg
string

Response Message

Example:
Provider not found!
Status
boolean

Success status

Example:
false
403 Invalid data / option provided
Body
Object
Code
integer

Response Code

Example:
2
ErrorCode
unknown nullable

Response Error code

Details
Object

Response Details

Name
string

Field name

Example:
expected_date_option
Value
string

Provided Value

Example:
8
Id
unknown nullable

Field Id

Msg
string

Response Message

Example:
Please select a valid option
Status
boolean

Success status

Example:
false
403 Validation Error / Missing Field Data
Body
Object
Code
integer

Response Code

Example:
2
ErrorCode
unknown nullable

Response Error code

Details
Object

Response Details

Name
string

Field name

Example:
customer_name
Value
unknown nullable

Provided Value

Id
unknown nullable

Field Id

Msg
string

Response Message

Example:
This information must be supplied.
Status
boolean

Success status

Example:
false