Orders – Submitting an Embroidery Order
The POST orders
is used to post new orders to the system. This can be used for submitting embroidery products.
- You can submit embroidery orders without an Image ID or you can submit an order with an Image ID. Submitting an order without an Image ID is a much simpler process.
You can submit orders utilizing the partnerBillingKey
which is essentially submitting an order using your billing method.
- When you have a billing method connected and you have orders submitted using the PartnerBillingKey, our system will charge you by using your connected billing method and push your orders to production.
The POST images
endpoint is used add your image to Gooten and when you add the image, it provides you with the ID of the image. The GET images
endpoint is used get the list of images in our system and their IDs can be used for submitting an embroidery order. An Image ID is a unique identifier that defines your image(s) in our system.
Steps to order embroidery products
- Submit an embroidery order without an Image ID. This requires you to use the
UseUrlAsImageID
value when submitting an embroidery order. - Submit an embroidery order with an Image ID. This requires you to get the Image ID first and submitting an embroidery order with the Image ID.
- Get the Image ID for your embroidery artwork.
- You can get the Image ID by adding your own image into our system using the POST images API request.
- If you already have an image in our system, you can utilize our Get Image ID API call to get the Image ID needed for submitting an embroidery order.
- Submit an order via the API using the Image ID from the previous step.
- Your image must exist in our Gooten system before submitting an embroidery order.
- Optional - You can also create an embroidery print ready product and then order the product like normal.
Submit orders for embroidery products without an Image ID
1. Send a POST API request to the following URL 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.
https://api.print.io/api/orders?recipeId=YourRecipeID
2. In the body of the request, you'll need to include the following when submitting an embroidery order:
SKU-
The SKU of the embroidery productQuantity-
The number of embroidery products orderedUrl-
The ImageURL that will be used for embroidery- Please be sure that the URL for your image is public and persistent. If your URL is not public, our API will not be able to access your image link.
UseUrlAsImageID-
This essentially flags our system to use your Url as the ImageID to find or create a new image for digitization. With this value, you don't need to get the ImageID first to submit an embroidery order.
Please also be sure to include the PartnerBillingKey from your Gooten Admin. Replace the YourPartnerBillingKey in the example with your own Partner Billing Key from the Gooten Admin.
Please be sure to fill out the rest of the information for the body of the submit order API request as well.
Let's take a look at an example body for the API request:
{
"ShipToAddress":{
"FirstName":"Jhon",
"LastName":"Doo",
"Line1":"42 Street",
"City":"TestCity",
"State":"CA",
"CountryCode":"US",
"PostalCode":"12034",
"Phone":"555-555-1212",
"Email":"hi@email.com"
},
"SaveShippingAddress":false,
"BillingAddress":{
"FirstName":"Jhon",
"LastName":"Doo",
"Line1":"42 Street",
"City":"TestCity",
"State":"CA",
"CountryCode":"US",
"PostalCode":"12034",
"Phone":"555-555-1212",
"Email":"hi@email.com"
},
"Items":[
{
"SKU":"DadCaps-Embroidery-Black",
"Quantity":1,
"Images":[
{
"Url":"image-url", //The ImageURL that will be used for embroidery
"UseUrlAsImageID": true //This flag approves the image URL used above to be used and saved for digitization.
}
],
"IsSample":false,
"AddOns":null,
"ShipCarrierMethodId":1
}
],
"Payment":{
"CurrencyCode":"USD,
"PartnerBillingKey":"YourPartnerBillingKey"
},
"IsPreSubmit":false
}
3. The response after sending the submit an order API request will display the order ID for the order. You can find an example response below.
{
""Id": "115557-68eb0c64-bf4f-4e79-bf91-67772507ed78"
}
Get the Image ID by adding your own image into the Gooten system
You can to get the Image ID when you add an image to our system using the API. You would use a POST request to add an image into our system first and once it's added, you'll be provided with the ID which is the Image ID used when submitting an embroidery order.
1. Send a POST API request to the following URL 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.
https://api.print.io/api/images/createRecipeImages/submit?recipeid=YourRecipeID
2. In the body of the request, you'll need to include the URL of the image, width, and height of the image.
- Please be sure that the URL for your image is public and persistent. If your URL is not public, our API will not be able to access your image link.
Let's take a look at an example body for the API request:
{
"url":"https://some-cdn.com/605E4BD4E939.png",
"width":1394,
"height":1296
}
In you wanted to add an image with additional digitization information, you can include some additional parameters. The URLs provided for any additional digitization information must be publically accessible links.
StitchFileUrl
- Link to a DST fileColorKeyUrl
- Link to a Colorway PDF FileEmbroideryPreviewUrl
- Link to a PNG image file
Let's take a look at an example body for the API request with digitization information:
{
"url":"https://some-cdn.com/605E4BD4E939.png",
"width":1394,
"height":1296,
"StitchFileUrl":"https://cdn.com/76AF3128020A.dst",
"ColorKeyUrl":"https://some-sdn.com/76AF3128020A.png",
"EmbroideryPreviewUrl":"https://some-sdn.com/76AF3128020A.png"
}
3. Once you’ve sent the API request, the response will display the information for the new image. Here, you'll be able to get the Id of the image.
- The Id provided in the response is the Image ID used when submitting an embroidery order.
You can find an example response below.
{
"Id":7441,
"Url":"https://some-cdn.com/605E4BD4E939.png",
"Type":2,
"TimeStamp":"2021-05-14T11:33:17.0741519Z",
"InfoJSON":"{\"Width\":1394,\"Height\":1296}"
}
Get the Image ID from the list of images
1. Send a GET API request to the following URL 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.
https://api.print.io/api/images?recipeId=YourRecipeID
You can also add additional parameters to get your list of images. You can the following parameters:
Take & Skip
- optional - Used for the pagination of image.Type
- optional - The type of orientation of the image.- "1" - Square
- "2" - Landscape
- "3" - Portrait
Width
- optional - The width of the image.Height
- optional - The height of the image.
An example of the API request URL with these parameters can be found below:
https://api.print.io/api/images?take=50&skip=0&type=2&width=1200&height=750&recipeId=YourRecipeID
2. Once you’ve sent the API request, the response will display the list of images which includes the Id of the image.
You can find an example response below. The second example below also has additional digitization information that is used for embroidery.
{
"Id": 7035,
"Url": "https://some-cdn.com/40089F9C.png",
"Type": 2,
"TimeStamp": "2020-05-07T19:35:38.6570000",
"InfoJSON": "{
"Width":1200,
"Height":750}"
},
{
"Id": 7034,
"Url": "https://some-sdn.com/76AF3128020A.png",
"Type": 2,
"TimeStamp": "2020-05-07T18:16:29.1030000",
"InfoJSON": "{
"Width":1200,
"Height":750,
"StitchFileUrl":"https://cdn.com/76AF3128020A.dst",
"ColorKeyUrl" : "https://some-sdn.com/76AF3128020A.png",
"EmbroideryPreviewUrl" : "https://some-sdn.com/76AF3128020A.png",
"Digitization":"Completed"
}"
}
Submit orders for embroidery products with the Image ID
Now that you have your Image ID from the earlier steps, you can use that Image ID and the URL of your image to submit orders for embroidery products.
Please be aware that any attempt to submit an order with an embroidery product without the Image ID will cause it to fail.
1. Send a POST API request to the following URL 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.
https://api.print.io/api/orders?recipeId=YourRecipeID
2. In the body of the request, you'll need to include the PartnerBillingKey from your Gooten Admin and the ImageId that you retrieved from the previous steps. Replace the YourPartnerBillingKey in the example with your own Partner Billing Key from the Gooten Admin.
- Please be sure to fill out the rest of the information for the body of the submit order API request as well.
- Please be sure that the URL for your image is public and persistent. If your URL is not public, our API will not be able to access your image link.
Let's take a look at an example body for the API request:
{
"ShipToAddress":{
"FirstName":"Jhon",
"LastName":"Doo",
"Line1":"42 Street",
"City":"TestCity",
"State":"CA",
"CountryCode":"US",
"PostalCode":"12034",
"Phone":"555-555-1212",
"Email":"hi@email.com"
},
"SaveShippingAddress":false,
"BillingAddress":{
"FirstName":"Jhon",
"LastName":"Doo",
"Line1":"42 Street",
"City":"TestCity",
"State":"CA",
"CountryCode":"US",
"PostalCode":"12034",
"Phone":"555-555-1212",
"Email":"hi@email.com"
},
"Items":[
{
"SKU":"DadCaps-Embroidery-Black",
"Quantity":1,
"Images":[
{
"Url":"https://some.cdn/2-BEC5-76AF3128020A.png",
"Index":0,
"SpaceId":"32697",
"ImageId":7034
}
],
"IsSample":false,
"AddOns":null,
"ShipCarrierMethodId":1
}
],
"Payment":{
"CurrencyCode":"USD,
"PartnerBillingKey":"YourPartnerBillingKey"
},
"IsPreSubmit":false
}
3. The response after sending the submit an order API request will display the order ID for the order. You can find an example response below.
{
""Id": "115557-68eb0c64-bf4f-4e79-bf91-67772507ed78"
}
Creating embroidery print ready products
You also have the option to submit an order for an embroidery product by first creating a Print Ready Product (PRP)
When creating a Print Ready Product for an embroidery product, you will need to include the SKU ImageId
and this mandatory.
1. Send a POST API request to the following URL 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.
https://api.print.io//api/v/1/source/api/preconfiguredproducts/?recipeid=YourRecipeID
2. In the body of the request, you'll need to include the URL of the image, the ImageId
of the image and the rest of the information for your product.
Let's take a look at an example body for the API request:
{
"Sku":"emb-sku-1212414",
"Name":"Embroidery Cap",
"Description":"None",
"Items":[
{
"ProductId":77,
"ProductVariantSku":"DadCaps-Embroidery-Black",
"TemplateName":"Single",
"Preconfigurations":
[
{
"SpaceId":"F9145",
"ImageId": 7441,
"Url":"https://some.cdn/8b5794ef60984c32ba8f6cb2b10010d1_a.png"
}
]
}
],
"Images":[
{
"Url":"https://some.cdn/8b5794ef60984c32ba8f6cb2b10010d1_a.png",
"Index":0
},
{
"Url":"https://some.cdn/5ff4d057e2.png",
"Id":"generated-preview"
}
]
}
3. You can then use this newly created embroidery Print Ready Product and submit an order like a typical PRP product.