drip-nodejs icon indicating copy to clipboard operation
drip-nodejs copied to clipboard

The URL generated by createUpdateOrder is incorrect

Open ranajyotic1973 opened this issue 4 years ago • 2 comments

Here is the response object. This is with the latest version of the library

    "statusCode": 202,
    "body": {},
    "headers": {
        "content-type": "application/json; charset=utf-8",
        "content-length": "2",
        "connection": "close",
        "date": "Sun, 27 Jun 2021 02:26:04 GMT",
        "x-amzn-requestid": "5dca6177-1b40-4248-8355-0c44c9d47527",
        "referrer-policy": "strict-origin-when-cross-origin",
        "x-permitted-cross-domain-policies": "none",
        "x-xss-protection": "1; mode=block",
        "x-runtime": "0.033977",
        "strict-transport-security": "max-age=31536000; includeSubDomains",
        "x-amzn-remapped-content-length": "2",
        "x-frame-options": "SAMEORIGIN",
        "x-amzn-remapped-connection": "keep-alive",
        "x-download-options": "noopen",
        "x-request-id": "0077775e-2668-4377-bfbd-881d81ada366",
        "x-ratelimit-remaining": "3596",
        "x-amz-apigw-id": "BkA1hFlpoAMFvPw=",
        "cache-control": "no-cache",
        "x-amzn-remapped-server": "nginx",
        "x-ratelimit-limit": "3600",
        "x-content-type-options": "nosniff",
        "x-amzn-remapped-date": "Sun, 27 Jun 2021 02:26:04 GMT",
        "x-cache": "Miss from cloudfront",
        "via": "1.1 fc2f37d7003b9d84c9f65e09b5236c1e.cloudfront.net (CloudFront)",
        "x-amz-cf-pop": "YTO50-C3",
        "x-amz-cf-id": "YqoHuRhQ1BxAlwK3Qnae3CxdIO6ml-RMEevTMH8UJfd4EnA4hBfiuw=="
    },
    "request": {
        "uri": {
            "protocol": "https:",
            "slashes": true,
            "auth": null,
            "host": "api.getdrip.com",
            "port": 443,
            "hostname": "api.getdrip.com",
            "hash": null,
            "search": null,
            "query": null,
            "pathname": "/v2/XXXXXXX/orders",
            "path": "/v2/XXXXXXX/orders",
            "href": "https://api.getdrip.com/v2/XXXXXXX/orders"
        },
        "method": "POST",
        "headers": {
            "Content-Type": "application/json",
            "authorization": "Basic XXXXXXXXX",
            "User-Agent": "Drip NodeJS Wrapper 3.1.0",
            "accept": "application/json",
            "content-length": 765
        }
    }
}```

ranajyotic1973 avatar Jun 27 '21 04:06 ranajyotic1973

Yeah I'm having the same issue - the URL should be:

https://api.getdrip.com/v3/YOUR_ACCOUNT_ID/shopper_activity/order

I'll see if I can get this correct using Axios and then run up a PR

robconery avatar Jul 18 '21 22:07 robconery

I figured out my issue - was using wrong method, should have been the client.createUpdateOrderActivity method, which uses the shopper activity stuff. Confusing for sure - would recommend versioning the API rather than having separate activity methods. Easier said than done, I know, but I've spent all morning on this.

Also - for dates, make sure you set action to "placed", otherwise the date will be ignored.

robconery avatar Jul 19 '21 01:07 robconery