API Documentation

Submitting an Order

The POST orders endpoint is used to post new orders to the system.

There are 4 ways to submit an order:

Note that there are places within the order and each item to put ancillary information. For instance, both the order object and item object have SourceId to store your internal ID, as well as Meta to store any other properties you wish to save against the order/items.

Avoiding Duplicate Orders

Before getting to the different types of payment methods we support, know that we have a special method that will help you make sure you never submit the same order twice. What a relief!

How it works:

  1. You pass in your internal order ID into the SourceId field
  2. At the root of the order object, you set IsPartnerSourceIdUnique to true

And that’s it. If you already have an order with that SourceId in our system, we will block the order submission.

Selecting a Shipping Method

There are two ways of specifying shipping methods for items.

Item.ShipType is by far the easiest. Pass in a string value of standard, expedited, or overnight and subject to availability, that method will just be selected. If you pass in a value that is not available, an error will be thrown notifying you.

Item.ShipCarrierMethodId offers more granular selection. In order to get an integer value to pass into that field, please see the documentation for finding shipping options.

Either ShipType or ShipCarrierMethodId need passed for each item in the order; you never need to pass both.

Submitting on Credit

An order that is submitted on credit bypasses Braintree and PayPal charging.

  • IsInTestMode - optional - a boolean which tells Gooten API not to process the payment (used for testing)
  • ShipToAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • Line1 - required - shipping address line 1
    • Line2 - optional - shipping address line 2
    • City - required - shipping city
    • State - optional - shipping state (if applicable)
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
    • Email - required - user’s email
    • Phone - required - user’s phone
  • BillingAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
  • Items array of objects containing the following properties:
    • SKU - required - SKU of product variant
    • ShipCarrierMethodId - required if ShipType not used - Id of shipping carrier method from the /shippingprices endpoint
    • ShipType - required if ShipCarrierMethodId not used - type of shipping, with accepted values: standard, expedited, or overnight
    • Quantity - required - quantity of items with this SKU
    • Images - required - list of images, each containing a Url to a publicly-accessible image and optionally an Index to indicate image order, when needed
    • Meta - optional - a map of key/value pairs where you can submit any extra info you want attached to the item
    • SourceId - optional - a space to put your internal order item id
  • Payment object, with following properties:
    • PartnerBillingKey - a private key that should never be shared or used client-side!
  • Meta - optional - a map of key/value pairs where you can submit any extra info you want attached to the order
  • SourceId - optional - a space to put your internal order id
  • IsPartnerSourceIdUnique - optional - a boolean that sets if you want us to block orders where a previous order has been submitted with the same SourceId
{
  "ShipToAddress": {
    "FirstName": "Gooten",
    "LastName": "Test",
    "Line1": "222 Broadway",
    "City": "New York",
    "State": "NY",
    "CountryCode": "US",
    "PostalCode": "10038",
    "IsBusinessAddress": false,
    "Phone": "1234567890",
    "Email": "test@gooten.com"
  },
  "BillingAddress": {
    "FirstName": "Gooten",
    "LastName": "Test",
    "Line1": "222 Broadway",
    "City": "New York",
    "State": "NY",
    "CountryCode": "US",
    "PostalCode": "10038",
    "IsBusinessAddress": false,
    "Phone": "1234567890",
    "Email": "test@gooten.com"
  },
  "IsInTestMode": true,
  "Items": [
    {
      "Quantity": 1,
      "SKU": "PhoneCase-GalaxyNote2-Matte",
      "ShipCarrierMethodId": 1,
      "Images": [
        {
          "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
          "Index": 0,
          "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
        }
      ]
    },
    {
      "Quantity": 2,
      "SKU": "PhoneCase-Glossy-GalaxyNote3",
      "ShipCarrierMethodId": 1,
      "Images": [
        {
          "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
          "Index": 0,
          "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
        }
      ],
      "Meta":{
        "key1":"value"
      }
    }
  ],
  "Payment": {
    "PartnerBillingKey":"super-secret!"
  },
  "Meta":{
    "key1":"value"
  }
}

Example:

This yields the response:

{
  "Id": "7-023c9dfe-2e18-4c01-93dd-883e9f2d64d5"
}

Submitting via Braintree JS v1

Again, be sure to see the Braintree documentation.

  • IsInTestMode - optional - a boolean which tells Gooten API not to process the payment (used for testing)
  • ShipToAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • Line1 - required - shipping address line 1
    • Line2 - optional - shipping address line 2
    • City - required - shipping city
    • State - optional - shipping state (if applicable)
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
    • Email - required - user’s email
    • Phone - required - user’s phone
  • BillingAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
  • Items array of objects containing the following properties:
    • SKU - required - SKU of product variant
    • ShipCarrierMethodId - required if ShipType not used - Id of shipping carrier method from the /shippingprices endpoint
    • ShipType - required if ShipCarrierMethodId not used - type of shipping, with accepted values: standard, expedited, or overnight
      • Quantity - required - quantity of items with this SKU
      • Images - required - list of images, each containing a Url to a publicly-accessible image and optionally an Index to indicate image order, when needed
  • Payment object, with following properties:
    • BraintreeEncryptedCCNumber - required - encrypted credit card number
    • BraintreeEncryptedCCExpDate - required - encrypted expiry date of card (month/year)
    • BraintreeEncryptedCCV - required - encrypted CVV number
    • CurrencyCode - required - currency code
    • Total - required - order total
{
  "ShipToAddress": {
    "FirstName": "Gooten",
    "LastName": "Test",
    "Line1": "222 Broadway",
    "City": "New York",
    "State": "NY",
    "CountryCode": "US",
    "PostalCode": "10038",
    "IsBusinessAddress": false,
    "Phone": "1234567890",
    "Email": "test@gooten.com"
  },
  "BillingAddress": {
    "FirstName": "Gooten",
    "LastName": "Test",
    "CountryCode": "US",
    "PostalCode": "10038"
  },
  "IsInTestMode": true,
  "Items": [
    {
      "Quantity": 1,
      "SKU": "PhoneCase-GalaxyNote2-Matte",
      "ShipCarrierMethodId": 1,
      "Images": [
        {
          "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
          "Index": 0,
          "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
        }
      ]
    },
    {
      "Quantity": 2,
      "SKU": "PhoneCase-Glossy-GalaxyNote3",
      "ShipCarrierMethodId": 1,
      "Images": [
        {
          "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
          "Index": 0,
          "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
        }
      ]
    }
  ],
  "Payment": {
    "BraintreeEncryptedCCNumber": "$bt3|android_2_1_0$IqLBgSffLyeqKyrk0ak5oWyiRygvr1Iku8IzJB62yETuu1k6TOEHZBYKJbuIicDERY6mrnk9gL\/N2yF0+cvx8rI9JIlnrCborEGjLWGRF6Gwa0JYAdYY\/UaeQcVkJ9uWyDq+XJkPkMG7FWohHcW3w59+C\/W4iVCKfUS6VPM7i9K+BXrzpdxazM0biQh4baHZUHGHpuNkAnt9rKHKMYb35TZ+KYNsYLSZd+L9z50f9LF6+Q8h0qXHEFV7\/fcasLn05zBV7zjElc\/nYCFTFxepoqWMS+o3WnwN3QB+G9G2l6nLU1IR1Rd2x+NTcU\/RZv8VinzxZ7oeMk8RbFr819aXXA==$jcFWKRBTVFMUn24hi5b8C0kpzwr1VbnCuknTub9qvPrm2OEXQ+fwK9Yk2UIYCB47",
    "BraintreeEncryptedCCExpDate": "$bt3|android_2_1_0$kiEMxOEBz9cOJ1UIogKQjKo7wIpfp619jXKpdPma8MjfJ8gGlDli\/KalG\/Hb65aZa4Bnq5Jg1wBTE6OpoRVHovqzSvPaTbuQUC33rG3vXNmGjCL\/upgM239HFy6CgAAZ3sXyokxxMI9WhnbrwoOMvn7m2Dz7wSh\/NGdNzRRaHlefV1jCZEzBTcgPd2Q+wXM+\/q26uUDEH2wXhZ3181eBNvfnU+PuX7MIgKns6s3uNNXnAwlxg0F++4DV3ON5dcpxSLvPTyInR9snvCNsKHqy3dDzFSOGVIafA6C+UhuZl0Q1GwaT2KmznForqk5xQdswL+oDxbpbWgZZlyeswfIwtQ==$j6Exgsb9bJZerxbwBC7wVa\/NulZ\/xt\/DjPMleUwMxZ8=",
    "BraintreeEncryptedCCV": "$bt3|android_2_1_0$aQMradWrA4AXzhci89WYgtZKs35wiL3PX0tVHQx4DJ+GxuCQImMCuRK7p+XfnB8JhX4WYgckzwFSNhsPThh+ZZqbF4mZ0Lj++9cMqjmG+9e4WwMkESZKPL31Gjaf8Ck2kKM0ftZcSRvjxzoSsUKS0MwFTDyQpPYvj7o8pHsrWIqIUmj3to8HWRKltXWyL2azs8w9PFkub8M3eznkId8vPNpmpTrgD4aRPPBUvaN+4gTDUTxrI1yj\/jDH9NupelMBzhg2ofLFqt1CBjFKakE65nDfLaqkbz7UqzubfTpnLxc2m1f\/nRVFEdhHnXmFJRc2VoFLnqr4EZlazrOUROVgIA==$F9FTxCDWTUsZ\/0iesyArPZRcEQ3YpWN30T9gGU1fpRY=",
    "CurrencyCode": "USD",
    "Total": 52.07
  }
}

Example:

This yields the response:

{
  "Id": "7-023c9dfe-2e18-4c01-93dd-883e9f2d64d5"
}

Submitting via Braintree Token

To obtain Braintree token, use endpoint (replace recipeid with yours): https://api.print.io/api/v/5/source/api/braintreeclienttoken/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6

Be sure to see the Braintree Documentation

  • IsInTestMode - optional - a boolean which tells Gooten API not to process the payment (used for testing)
  • ShipToAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • Line1 - required - shipping address line 1
    • Line2 - optional - shipping address line 2
    • City - required - shipping city
    • State - optional - shipping state (if applicable)
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
    • Email - required - user’s email
    • Phone - required - user’s phone
  • BillingAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
  • Items array of objects containing the following properties:
    • SKU - required - SKU of product variant
    • ShipCarrierMethodId - required if ShipType not used - Id of shipping carrier method from the /shippingprices endpoint
    • ShipType - required if ShipCarrierMethodId not used - type of shipping, with accepted values: standard, expedited, or overnight
      • Quantity - required - quantity of items with this SKU
      • Images - required - list of images, each containing a Url to a publicly-accessible image and optionally an Index to indicate image order, when needed
  • Payment object, with following properties:
    • BraintreePaymentNonce - required - encrypted Braintree payment nonce
    • CurrencyCode - required - currency code
    • Total - required - order total
{
    "ShipToAddress": {
      "FirstName": "Gooten",
      "LastName": "Test",
      "Line1": "222 Broadway",
      "City": "New York",
      "State": "NY",
      "CountryCode": "US",
      "PostalCode": "10038",
      "IsBusinessAddress": false,
      "Phone": "1234567890",
      "Email": "test@gooten.com"
    },
    "BillingAddress": {
      "FirstName": "Gooten",
      "LastName": "Test",
      "CountryCode": "US",
      "PostalCode": "10038"
    },
    "IsInTestMode": true,
    "Items": [
      {
        "Quantity": 1,
        "SKU": "PhoneCase-GalaxyNote2-Matte",
        "ShipCarrierMethodId": 1,
        "Images": [
          {
            "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
            "Index": 0,
            "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
          }
        ]
      },
      {
        "Quantity": 2,
        "SKU": "PhoneCase-Glossy-GalaxyNote3",
        "ShipCarrierMethodId": 1,
        "Images": [
          {
            "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
            "Index": 0,
            "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
          }
        ]
      }
    ],
    "Payment": {
      "BraintreePaymentNonce": "#braintree_payment_nonce#",
      "CurrencyCode": "USD",
      "Total": 52.07
    }
  }

Example:

This yields the response:

{
  "Id": "7-c9d829af-822b-4ba2-93f6-7338d31bde78"
}

Submitting via Paypal

For a web/js scenario, usually it makes sense to create and submit a hidden form like this after submitting the order info to us:

<form class="js-paypal-form" style="display:none;" action="... place PayPal/Sandbox url here ..." method="post">
    <input type="hidden" name="cmd" value="_xclick" />
    <input type="hidden" name="business" value="...email..." />
    <input type="hidden" name="item_name" value="Printed Items">
    <input type="hidden" name="cbt" value="Return to the site you came from" />
    <input type="hidden" name="rm" value="1" />
    <input type="hidden" name="image_url" value="...logo url..." />
    <input type="hidden" name="currency_code" value="...currency code..." />
    <input type="hidden" name="amount" value="...total value..." />
    <input type="hidden" name="no_shipping" value="1" />
    <input type="hidden" name="return" value="...return url..." />
    <input type="hidden" name="invoice" value="...Id of order from response - in example above: 7-f0f4ffd3-2582-48c5-9d10-4c7c625e1fec..." />
    <input type="hidden" name="notify_url" value="https://api.print.io/PayPal" />
    <input type="submit" />
</form>

Notice the notify_url – after payment completes PayPal will notify our server and we remove pre-payment flag from the submitted order, and it will go into production.

  • IsPreSubmit - must be set to true
  • IsInTestMode - optional - a boolean which tells Gooten API not to process the payment (used for testing)
  • ShipToAddress object, with following properties:
    • FirstName - required - first name of the user
    • LastName - required - last name of the user
    • Line1 - required - shipping address line 1
    • Line2 - optional - shipping address line 2
    • City - required - shipping city
    • State - optional - shipping state (if applicable)
    • PostalCode - required - shipping postal code
    • CountryCode - required - shipping 2-letter country code
    • Email - required - user’s email
    • Phone - required - user’s phone
  • Items array of objects containing the following properties:
    • SKU - required - SKU of product variant
    • ShipCarrierMethodId - required if ShipType not used - Id of shipping carrier method from the /shippingprices endpoint
    • ShipType - required if ShipCarrierMethodId not used - type of shipping, with accepted values: standard, expedited, or overnight
    • Quantity - required - quantity of items with this SKU
    • Images - required - list of images, each containing a Url to a publicly-accessible image and optionally an Index to indicate image order, when needed
  • Payment object, with following properties:
    • CurrencyCode - required - currency code
    • Total - required - order total
{
  "IsPreSubmit": true,
  "ShipToAddress": {
    "FirstName": "Gooten",
    "LastName": "Test",
    "Line1": "222 Broadway",
    "City": "New York",
    "State": "NY",
    "CountryCode": "US",
    "PostalCode": "10038",
    "IsBusinessAddress": false,
    "Phone": "1234567890",
    "Email": "test@gooten.com"
  },
  "IsInTestMode": true,
  "Items": [
    {
      "Quantity": 1,
      "SKU": "PhoneCase-GalaxyNote2-Matte",
      "ShipCarrierMethodId": 1,
      "Images": [
        {
          "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
          "Index": 0,
          "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
        }
      ]
    },
    {
      "Quantity": 2,
      "SKU": "PhoneCase-Glossy-GalaxyNote3",
      "ShipCarrierMethodId": 1,
      "Images": [
        {
          "Url": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg",
          "Index": 0,
          "ThumbnailUrl": "https:\/\/printio-widget-live.s3.amazonaws.com\/200E4604-4CD5-4E0C-A131-9F5AF25006E6.jpg"
        }
      ]
    }
  ],
  "Payment": {
    "CurrencyCode": "USD",
    "Total": 52.07
  }
}

Example:

This yields the response:

{
  "Id": "7-023c9dfe-2e18-4c01-93dd-883e9f2d64d5"
}