It's really easy to get up and running with Pwinty

Place your first order

  1. Create an Order
    Make a POST call to /Orders . Get back the order id, which you will need for adding photos to the order. If you don't have the address don't worry- create the order without the address parameters, and update it later in the process

    curl https://sandbox.pwinty.com/Orders \
       -h "X-Pwinty-MerchantId: YourMerchantId" \
       -h "X-Pwinty-REST-API-Key: YourAPIKey" \
       -d recipientName=Mr%20Jones \
       -d address1=The%20Hollies \
       -d addressTownOrCity=Cardiff \
       -d stateOrCounty=Glamorgan \
       -d postalOrZipCode=CF11%201AX \
       -d country=UK
    
    RESPONSE:
    {
        "id": 1065,
        "recipientName": "Mr Jones",
        "address1": "The Hollies",
        "address2": "",
        "addressTownOrCity": "Cardiff",
        "stateOrCounty": "Glamorgan",
        "postalOrZipCode": "CF11 1AX",
        "country": "UK",
        "status" : "NotYetSubmitted"
        "photos": []
    }
                        
  2. Add photos to the order
    Make POST calls to /Photos . Either give us a URL to find the photo, or send it as part of the POST

    curl https://sandbox.pwinty.com/Photos \
        -h "X-Pwinty-MerchantId: YourMerchantId" \
        -h "X-Pwinty-REST-API-Key: YourAPIKey" \
        -d orderId=1065 \
        -d type=8x12 \
        -d url=http%3A%2F%2Fwww.testserver.com%2Faphoto.jpg \
        -d copies=2 \
        -d sizing=Crop             
                        
  3. Add a sticker to the order (optional)
    Make POST calls to /Stickers with an image. We'll print off a sticker, and stick it on the envelope

    curl https://sandbox.pwinty.com/Stickers \
        -h "X-Pwinty-MerchantId: YourMerchantId" \
        -h "X-Pwinty-REST-API-Key: YourAPIKey" \
        -d orderId=1065 \
        -F file=sticker.png \        
                        
  4. Add documents to the order (optional)
    Make POST calls to /Documents with a pdf or docx file. We'll print off the file(s), and include it in the package

    curl https://sandbox.pwinty.com/Documents \
        -h "X-Pwinty-MerchantId: YourMerchantId" \
        -h "X-Pwinty-REST-API-Key: YourAPIKey" \
        -d orderId=1065 \
        -F file=filename.pdf \
        -d color=true \           
                        
  5. Check the order is valid
    Make a GET call to /Orders/SubmissionStatus to check the order is valid and ready to be submitted

    curl https://sandbox.pwinty.com/Orders/SubmissionStatus?id=1065 
        -h "X-Pwinty-MerchantId: YourMerchantId" \
        -h "X-Pwinty-REST-API-Key: YourAPIKey" \
    RESPONSE:
    {
        "id": 1065,
        "isValid": true,                 
        "generalErrors : [],
        "photos" : []
     }
                        
  6. Submit the order
    Make a POST call to /Orders/Status to set the Status to "Submitted"

    curl https://sandbox.pwinty.com/Orders/Status
        -h "X-Pwinty-MerchantId: YourMerchantId" \
        -h "X-Pwinty-REST-API-Key: YourAPIKey" \ 
        -d id=1065 \
        -d status=Submitted                 
                        
  7. Relax
    We'll get your order printed, and shipped to your customer in no time

  8. Pay (we're afraid so!)
    When your account balance gets to a certain level, we'll invoice you