Upgrade to ChromeUpgrade to FirefoxUpgrade to Internet ExplorerUpgrade to Safari

Orders

Get Photos in an order

Description

Retrieve the photos associated with an order

URL

https://api.pwinty.com/v2.2/Orders/{id}/Photos

Method
GET
Returns
Information about the created photo - see Photos (GET) for example response

Errors

  • 400 - Bad or missing input parameter- see error for more details
  • 403 - The order is in a state (e.g. Complete) where photos cannot be added
  • 404 - The order with the specified orderId was not found

Get Photo by Id

Description

Retrieves information about a specific photo

URL

https://api.pwinty.com/v2.2/Orders/{orderId}/Photos/{photoId}

Method

GET

  • orderId the id of the order
  • photoId the id of the photo

Sample JSON response


{
    "id": 3456,
    "type": "4x6",
    "url": "http://www.flickr.com/mytestphoto.jpg",
    "status": "NotYetDownloaded",
    "copies": "4",
    "sizing": "Crop",
    "priceToUser" : 214,
    "price" : 199,
    "md5Hash" : "79054025255fb1a26e4bc422aef54eb4",
    "previewUrl" : "http://s3.amazonaws.com/anexampleurl",
    "thumbnailUrl" : "http://s3.amazonaws.com/anexamplethumbnailurl",
    "attributes": {
                    "frame_colour" : "silver"
                 }
}
                        

Return values

Field Description
id Unique integer identifying the photo
type Type of photo
url If photo is to be downloaded by Pwinty, the photo's URL
status Current status of the photo (Photo statuses)
copies Number of copies of the photo to include in the order
sizing How the image should be resized when printing (resizing options)
price The amount (in cents/pence) that Pwinty will charge you for this item
priceToUser If payment is set to InvoiceRecipient then the price (in cents/pence) you want to charge for this item
md5Hash The md5 hash of the image file (when available)
previewUrl A url that will serve up the photo image after cropping
thumbnailUrl A url that will serve up a thumbnail of the image after cropping
attributes An object containing all the attributes set on the object. To see which attributes are valid for a given photo type- look at the catalogue

Errors

  • 404 - The photo with the specified id was not found

Add a photo to an order

URL

https://api.pwinty.com/v2.2/Orders/{id}/Photos

Method

POST

Parameters

  1. id the id of the order the photo is being added to (in URL)
  2. type the type/size of photo (available photo types)
  3. urloptional if the photo is online- the url from which we can download it
  4. copies the number of copies of the photo to include in the order
  5. sizing how the image should be resized when printing (resizing options)
  6. priceToUseroptional integer- the price (in cents/pence) you'd like to charge for each copy (only available if your payment option is InvoiceRecipient)
  7. md5Hashoptional an md5Hash of the file which we'll check before processing
  8. file optional - if you have the image file, then make this request as a multipart/form-data with the file included
  9. attributes optional - an object with properties representing the attributes for the photo. For valid attributes see the Catalogue

Returns

Information about the created photo - see Photos (GET) for example response

Errors

  • 400 - Bad or missing input parameter- see error for more details
  • 403 - The order is in a state (e.g. Complete) where photos cannot be added
  • 404 - The order with the specified orderId was not found

Add photos to an order (BATCH)

Description

Adds multiple photos to an order. Can only add items by url

URL

https://api.pwinty.com/v2.2/Orders/{id}/Photos/Batch

Method

POST

Parameters

  • id the id of the order the photo is being added to (in URL)
  • type the type/size of photo (available photo types)
  • urloptional if the photo is online- the url from which we can download it
  • copies the number of copies of the photo to include in the order
  • sizing how the image should be resized when printing (resizing options)
  • priceToUseroptional integer- the price (in cents/pence) you'd like to charge for each copy (only available if your payment option is InvoiceRecipient)
  • md5Hashoptional an md5Hash of the file which we'll check before processing
  • attributes optional - an object with properties representing the attributes for the photo. For valid attributes see the Catalogue

Returns


{
    "errorMessage": null,
    "items": [
            {
                "id": 3456,
                "type": "4x6",
                "url": "http://www.flickr.com/mytestphoto.jpg",
                "status": "NotYetDownloaded",
                "copies": "4",
                "sizing": "Crop",
                "priceToUser" : 214,
                "price" : 199,
                "md5Hash" : "79054025255fb1a26e4bc422aef54eb4",
                "previewUrl" : "http://s3.amazonaws.com/anexampleurl",
                "thumbnailUrl" : "http://s3.amazonaws.com/anexamplethumbnailurl",
                "attributes": {
                                "frame_colour" : "silver"
                             }
            },
            {
                "id" : 4567,
                ...
            },
            ...
        ]
}
                        

Return values

Field Description
errorMessage Detail about any error on the request
items Array of items represented the created photos see Photos (GET) for all the properties

Errors

  • 400 - Bad or missing input parameter- see error for more details
  • 403 - The order is in a state (e.g. Complete) where photos cannot be added
  • 404 - The order with the specified orderId was not found

Delete a photo from an order

URL

https://api.pwinty.com/v2.2/Orders/{orderId}/Photos/{photoId}

Method

DELETE

Parameters

  • orderId the id of the order
  • photoId the id of the photo

Returns

HTTP Status code denoting success or failure

  • 200 - The photo was deleted
  • 403 - Order is not in a valid state to remove photos (can only remove when state is 'NotYetSubmitted')
  • 404 - The photo with the specified id was not found

Photo Statuses

Each photo in an order has a status. You can see a Photo's status by calling Photos (GET)

AwaitingUrlOrData

There are two ways of uploading a file to Pwinty. You can either specify a url when creating the photo, or you can POST to /Photos using a multi-part upload. If you see this status, it means you have done neither yet for this photo

NotYetDownloaded

You have specified a url associated with the photo, but Pwinty hasn't yet downloaded it. There's nothing you need to do about this

Ok

We've received your image, verified it is a valid jpg file, and all is ready to go

FileNotFoundAtUrl

We tried using the url you specified to grab the image associated with the photo, but we didn't find an image there

Invalid

You uploaded a file, but it wasn't a valid jpg image file, or we checked the url you specified and didn't find a valid jpg image there