RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
545 stars 132 forks source link

Special instructions support #46

Closed reanimus closed 8 years ago

reanimus commented 9 years ago

So I'd like to be able to tell the driver how to buzz into my building, which requires access to the "special instructions" field that the app/website have. Any chance of adding support for that?

RIAEvangelist commented 9 years ago

if it is supported on the validate or place order yes.

I bet it is actually on the address portion.

@reanimus could you create an order on the site with some special instructions and review the api request in dev tools? If you share where the request we can figure out how to integrate it into the appropriate request.

RIAEvangelist commented 9 years ago

There will be several api requests made, you shouldn't actually have to order a pizza. Just watch the network tab for XHR requests.

reanimus commented 9 years ago

The option for custom instructions is directly on the order page. There's no way to send the request without ordering as far as I can tell.

reanimus commented 9 years ago

Nevermind, I turned off wifi and "submitted".

{
    "Address": {
        "DeliveryInstructions": "[special instructions here]"
    },
    "Addresses": [
        {
            "AddressLine1": "",
            "AddressLine2": "###",
            "AddressLine3": "",
            "AddressLine4": "",
            "AddressType": "Apartment",
            "BuildingID": "",
            "CampusID": "",
            "City": "SEATTLE",
            "Coordinates": {
                "Latitude": 0,
                "Longitude": 0
            },
            "DeliveryInstructions": "[special instructions here]",
            "IsDefault": true,
            "LocationName": "[REDACTED]",
            "Name": "[REDACTED]",
            "Neighborhood": "",
            "PlaceType": "",
            "PostalCode": "[REDACTED]",
            "PropertyNumber": "",
            "PropertyType": "",
            "Region": "[REDACTED]",
            "Street": "[REDACTED]",
            "StreetAddress2": "",
            "StreetField1": "",
            "StreetName": "[REDACTED]",
            "StreetNumber": "",
            "StreetRange": "",
            "UnitNumber": "[REDACTED]",
            "UnitType": "APT",
            "UpdateTime": ""
        }
    ],
    "Age13OrOlder": true,
    "AgreeToTermsOfUse": false,
    "AlternateExtension": "",
    "AlternatePhone": "",
    "AsOfTime": "",
    "BirthDate": "",
    "CreditCards": [
    ],
    "CustomerID": "[REDACTED]",
    "Email": "[REDACTED]",
    "EmailOptIn": "",
    "EmailOptInTime": "2015-08-26 21:50:32",
    "Extension": "",
    "FirstName": "Daniel",
    "LastName": "Guzman",
    "Loyalty": {
        "AccountStatus": "ACTIVE",
        "BasePointExpirationDate": "2016-03-29",
        "EnrollDate": "2015-08-26",
        "History": [
        ],
        "LastActivityDate": "2015-10-01",
        "LoyaltyCoupons": [
            {
                "BaseCoupon": true,
                "CouponCode": "LTY001",
                "LimitPerOrder": "5",
                "PointValue": 60
            }
        ],
        "PendingPointBalance": 10,
        "PointExpirationDate": "",
        "VestedPointBalance": 50
    },
    "Market": "UNITED_STATES",
    "PasswordHash": "[REDACTED]",
    "PasswordSalt": "[REDACTED]",
    "PastItems": [
    ],
    "Phone": "[REDACTED]",
    "PhonePrefix": "",
    "Session": {
        "Address": {
            "AddressLine1": "",
            "AddressLine2": "",
            "AddressLine3": "",
            "AddressLine4": "",
            "BuildingID": "",
            "CampusID": "",
            "City": "",
            "Coordinates": {
                "Latitude": "",
                "Longitude": ""
            },
            "DeliveryInstructions": "",
            "IsDefault": "",
            "LocationName": "",
            "Name": "",
            "Neighborhood": "",
            "PlaceType": "",
            "PostalCode": "",
            "PropertyNumber": "",
            "PropertyType": "",
            "Region": "",
            "Street": "",
            "StreetAddress2": "",
            "StreetField1": "",
            "StreetName": "",
            "StreetNumber": "",
            "StreetRange": "",
            "Type": "",
            "UnitNumber": "",
            "UnitType": "",
            "UpdateTime": ""
        },
        "AddressSelection": "",
        "DeliveryAvailable": false,
        "ServiceMethod": "Delivery",
        "StoreID": ""
    },
    "SmsOptIn": false,
    "SmsOptInTime": "2015-08-26 21:50:32",
    "SmsPhone": "",
    "UpdateTime": "2015-08-26 21:50:32"
}