printdotio / printio-api

Issues + wiki for the api. See http://print.io/api
0 stars 0 forks source link

Posting to Orders in the API explorer keeps returning "HadError": true #26

Closed seanwooj closed 9 years ago

seanwooj commented 9 years ago

Hey again,

working on getting my data structured in the correct format to send out an order request to the API, but have wanted to make sure that I have a good bit of test data to work towards before taking too many steps. I am testing by trying to use the annotated request example on print.io/api to get a successful response.

I keep getting an error Ref Code: 0dd7fcb1-e0a8-4c92-a0b3-8c165972fd52

I am using http://staging.api.print.io/docs/#!/orders/POST_post_1 with my staging recipe ID, which works on the products/GET section.

Using this data:

{
    // address of where order should be shipped to
    "ShipToAddress": {
        //
        // required
        "FirstName": "John",
        //
        // required
        "LastName": "Doe",
        //
        // required
        "Line1": "200 Nowhere St",
        "Line2": "",
        //
        // required
        "City": "Philadelphia",
        //
        // required if CountryCode is US or CA
        "State": "PA",
        //
        // required
        "CountryCode": "US",
        //
        // required if CountryCode is US or CA
        "PostalCode": "19146",
        "IsBusinessAddress": false,
        //
        // required
        "Phone": "555-555-1234",
        //
        // required
        "Email": "email@email.com"
    },

    //
    // the billing address associated with the payment method
    "BillingAddress": {
        //
        // required
        "FirstName": "John",
        //
        // required
        "LastName": "Doe",
        "Line1": "200 Nowhere St",
        "Line2": "",
        "City": "Philadelphia",
        "State": "PA",
        //
        // required
        "CountryCode": "US",
        //
        // required
        "PostalCode": "19146",
        "IsBusinessAddress": false,
        "Phone": "555-555-1234",
        "Email": "email@email.com"
    },
    "Items": [
        {
            //
            // required
            "Quantity": 1,
            //
            // required
            "SKU": "CanvsWrp-BlkWrp-10x10",
            //
            // ID returned from the /shippingprices call
            "ShipCarrierMethodId": 1,
            //
            // required, at least one image
            "Images": [
                {
                    //
                    // required - full URL to the product image
                    "Url": "http://cdn.print.io/img.jpg"
                }
            ]
        }
    ],
    "Payment": {
        //
        // required if IsPreSubmit == false
        // a private key that allows orders to be submitted
        "PartnerBillingKey":"yankeehotelfoxtrot"
    },
    //
    // space for a client-specific ID
    "SourceId": "string",
    //
    // whether or not to hold the item from full submission initially
    "IsPreSubmit": false,
    //
    // optional key/value pairs of meta information that can be used for future querying, etc
    "Meta":{

    }
}

Version: 1 Source: api

Thanks!

seanwooj commented 9 years ago

I think I fixed the problem I was having, but will keep you posted. Thanks a lot guys!

AustenB commented 9 years ago

As a reminder some of the payment fields are mandatory and you must include you api key for the partner billing key. On Apr 21, 2015 1:50 PM, "Sean Kim" notifications@github.com wrote:

Closed #26 https://github.com/printdotio/printio-api/issues/26.

— Reply to this email directly or view it on GitHub https://github.com/printdotio/printio-api/issues/26#event-286467011.