Orders – Submitting an Order

This API request allows you to submit a POST request with the orders endpoint to post new orders to our system.

You can submit orders utilizing the PartnerBillingKey which is essentially submitting an order based on your primary payment method that you have set up in Gooten.

When you have a payment method connected and you have orders submitted using the PartnerBillingKey, our system will charge you using your connected payment method and push your orders to production.

You can provide your payment method by adding your payment information under the Billing tab in the Settings of the Gooten Admin. You have the option to provide a payment method with credit or with a PayPal account.

Gooten will accept orders even if you do not have a payment method connected, but please be aware that orders accepted without a payment method connected will end up in the Payment Issue Status. Once you connect a payment method, orders in this status will be pushed forward.

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

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. These values are subject to availability depending on which shipping method selected. If you pass in a value that is not available, an error will be thrown notifying you and you would have to change the shipping type.

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

You must pass either the ShipType or ShipCarrierMethodId for each item in the order for it to submit properly. You will never need to pass both values and you only need to pass one or the other.

Submitting on Credit

  • ShipToAddress object, with the following properties:
    • FirstName - required - the first name of the user
    • LastName - required - the 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)
    • CountryCode - required - shipping 2-letter country code
    • PostalCode - required - shipping postal code
    • IsBusinessAddress - optional - a boolean value to label this address as your business address
    • Phone - required - user’s phone
    • Email - required - user’s email
  • BillingAddress object, with the following properties:
    • FirstName - required - the first name of the user
    • LastName - required - the last name of the user
    • Line1 - required - billing address line 1
    • Line2 - optional - billing address line 2
    • City - required - billing city
    • State - optional - billing state (if applicable)
    • CountryCode - required - billing 2-letter country code
    • PostalCode - required - billing postal code
    • IsBusinessAddress - optional - a boolean value to label this address as your business address
    • Phone - required - user’s phone
    • Email - required - user’s email
  • Items an array of objects containing the following properties:
    • Quantity - required - the number of items for this SKU
    • SKU - required - SKU of product variant or print-ready product
    • ShipCarrierMethodId - required if ShipType not used - Id of shipping carrier method from the /shippingprices endpoint
    • ShipType - required if ShipCarrierMethodId not used - a type of shipping, with accepted values: standard, expedited, or overnight
    • Images - required - list of images, each containing a Url to a publicly-accessible image and optionally an Index to indicate image order, when needed. You can also provide the SpaceId which can be used later to update the image file for your order.
      • If you provide the SpaceId for your images when submitting an order, you'll be able to update your artwork at a later time with this Id. To get the proper SpaceId for your SKU, you will have to get the template for your SKU using our List of Product Templates API call which provides you with the SpaceId.
    • SourceId - optional - a space to put your internal order item id
    • Meta - optional - a map of key/value pairs where you can submit any extra info you want to be attached to the item
  • Payment object, with the following properties:
    • PartnerBillingKey - a private key that should never be shared or used client-side! This is used to charge your payment method that you have set up in Gooten for the submitted orders.
  • IsInTestMode - optional - a boolean which tells Gooten API not to process the payment. This is used for testing and used to submit test orders.
  • SourceId - optional - a space to put your internal order id.
  • IsPartnerSourceIdUnique - optional - a boolean that lets our system know if you want us to block orders where a previous order has been submitted with the same SourceId. This is used to prevent senting duplicate orders into our system.
  • Meta - optional - a map of key/value pairs where you can submit any extra info you want to be attached to the order
    • needs_customization - optional - a boolean which marks the API order as a personalized order. The Gooten API will check this value, and if it's true, our system will put each order item in the NeedsPersonalization status. This allows you to personalize each item for your order at a later time.

Artwork orientation when submitting an order

The artwork orientation is only available for wall art products. When you submit an order, our system will automatically handle the artwork's orientation on your product using the image pixel size of your artwork design. You cannot set the orientation of your artwork design when submitting an order, but if you need to make any orientation changes, you can make any changes via the Gooten Admin.

The following format can be viewed below:

{
	"ShipToAddress": {
		"FirstName": "string",
		"LastName": "string",
		"Line1": "string",
		"Line2": "string",
		"City": "string",
		"State": "string",
		"CountryCode": "string",
		"PostalCode": "string",
		"IsBusinessAddress": "boolean",
		"Phone": "string",
		"Email": "string"
	},
	"BillingAddress": {
		"FirstName": "string",
		"LastName": "string",
		"Line1": "string",
		"Line2": "string",
		"City": "string",
		"State": "string",
		"CountryCode": "string",
		"PostalCode": "string",
		"IsBusinessAddress": "boolean",
		"Phone": "string",
		"Email": "string"
	},
	"Items": [{
		"Quantity": "integer",
		"SKU": "string",
		"ShipType": "string",
		"Images": [{
			"Url": "string",
			"SpaceId": "string",
			"Index": "integer",
			"ThumbnailUrl": "string"
		}],
		"AddOns": {
			"necktag_image_url": "string"
		}
		"SourceId": "string",
		"Meta": {
			"Key1": "Value1",
			"Key2": "Value2",
			"Sample": "boolean"
		}
	}],
	"Payment": {
		"PartnerBillingKey": "string"
	},
	"SourceId": "string",
	"IsPartnerSourceIdUnique": "boolean",
	"IsInTestMode": "boolean",
	"Meta": {
		"Key1": "Value1",
		"Key2": "Value2",
		"needs_customization": "boolean",
	}
}

Let's take a look at an example of the submit order API request below:

Each API request to the Gooten API must have the RecipeID parameter included in the URL. This is typically used to authenticate to the Gooten API. Please be sure to replace the YourRecipeID in the example with your proper RecipeID from the Gooten Admin.

You must also replace the YourPartnerBillingKey in the example with your own Partner Billing Key from the Gooten Admin. This key is used for order related API calls. In this scenario, it is used to charge your payment method connected to your Gooten account for the submitted order.

{
  "method": "POST",
  "url": "https://api.print.io/api/v/5/source/api/orders/",
  "httpVersion": "HTTP/1.1",
  "headers": [
    {
      "name": "Content-Type",
      "value": "application/json"
    }
  ],
  "queryString": [
    {
      "name": "recipeid",
      "value": "f255af6f-9614-4fe2-aa8b-1b77b936d9d6"
    }
  ],
  "postData": {
    "mimeType": "application/json; charset=utf-8",
    "text": {
      "ShipToAddress": {
        "FirstName": "John",
        "LastName": "Doe",
        "Line1": "79 Madison Ave",
        "Line2": "Suite 228",
        "City": "New York",
        "State": "NY",
        "CountryCode": "US",
        "PostalCode": "10016",
        "IsBusinessAddress": false,
        "Phone": "0000000000",
        "Email": "mail@test.com"
      },
      "BillingAddress": {
        "FirstName": "John",
        "LastName": "Doe",
        "Line1": "79 Madison Ave",
        "Line2": "Suite 228",
        "City": "New York",
        "State": "NY",
        "CountryCode": "US",
        "PostalCode": "10016",
        "IsBusinessAddress": false,
        "Phone": "0000000000",
        "Email": "mail@test.com"
      },
      "Items": [
        {
          "Quantity": 1,
          "SKU": "CanvsWrp-ImgWrp-10x10",
          "ShipType": "standard",
          "Images": [
            {
              "Url": "https://placekitten.com/3000/3000"
            }
          ]
        }
      ],
      "Payment": {
        "PartnerBillingKey": "oeO2j1ZbfU0TaDPRrhStEyp68ZRbXK8UfWfq7BKICGY="
      },
      "IsInTestMode": true,
      "Meta": {
        "tag": "test order",
        "my value": "42"
      }
    }
  }
}

After sending the POST request to submit your order, the response will display the order Id for your newly created order. The response will be displayed in the following format:

{
  "Id": "string"
}

If you're using Shopify, Etsy, or WooCommerce, these platforms have a built-in checkout function. This function will charge your customers and then our system will charge you when the order is fully synced and pushed to production.

If you have a custom website, you must build your own checkout using any method that you prefer as Gooten does not collect payments from your customers.

Next Topic: Search Orders