Orders – Update and Push Personalized Orders to Production

The PUT OrderCustomization endpoint is used to update your artwork for the items in your NeedsPersonalization order and push the order to production.

You must include the recipeid and the partnerBillingKey when updating and pushing your order to production in your system. You can retrieve these from your API page in the Settings of the Gooten Admin.

Please note that this applies only for orders in the NeedsPersonalization status or orders that has items in the same status.

Update and push personalized orders to production

1. Send a PUT API request to the following URL below.

    https://api.print.io/api/OrderCustomization?recipeId=YourRecipeID&partnerBillingKey=YourPartnerBillingKey&id=[Order_Safe_ID]

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 updated order.

When you provide your partnerBillingKey, you must encode it in order for the request to work. You can use an Encoder tool to help encode your partnerBillingKey.

You must also replace the id value in the URL above with your SafeId of the order. You can get this from retrieving the order information using our Get Orders by ID API call.

An example of the API request URL with an [Order_Safe_ID] can be found below. Please note that the GootenID used below is an example and your GootenID will be different.

    https://api.print.io/api/OrderCustomization?recipeId=YourRecipeID&partnerBillingKey=YourPartnerBillingKey&id=115557-b5c97bb2-934d-48aa-9ad2-a565154b5cd4

2. In the body of the request, you'll need to include the information to update the artwork for the order item in the order.

    • OrderItemId - required - the ID of the order item in your order that you want to update the artwork for.
    • SpaceId - required - the ID of the printing space for the order item in your order that you want to update the artwork for.
    • URL - required - the URL of the new artwork for your order item in your order. This link must be a publically accessible image link otherwise the request will not work.

You can view an example payload below:

{
    "Items": [
        {
            "OrderItemId": 9376694,
            "Images": [
                {
                    "SpaceId": "03195",
                    "Url": "https://appassets.azureedge.net/temp/176f_fba78afa0ddb9655affb80304048a8d7.png"
                }
            ]
        }
    ]
}

3. Once you’ve sent the API request, the response will display a boolean value to determine if the request worked and it will display the IDs of the order item where the artwork was updated.

The example updates the artwork for the order item in the order and updates the order status to ReadyForImageDl. Once all the personalization order items are pushed to the ReadyForImageDl status and there are no items left to push to production, the response will return "CustomizationDone": true.

    • HadError - Should be false. If true, it is typically due to some internal server error that occurred.
    • Results - The processed results or the results will be processing.
    • UpdatedOrderItems - The list of order items ids that processed successfully
    • Failures - An optional field in case of any handled errors that contains the order item id of the failure and the error message.
    • CustomizationDone - If true, this means all the order items passed the NeedsPersonalization status and the order will be moved to production. If false, it means that not all the order items have passed the NeedsPersonalization status.

You can find an example response that passed below:

{
    "HadError": false,
    "Results": {
        "UpdatedOrderItems": [
            9376694
        ],
        "CustomizationDone": true
    }
}

An example of a response where the customization isn't done can be found below:

{
    "HadError": false,
    "Results": {
        "UpdatedOrderItems": [
            1097557,
            1097559
        ],
        "Failures: {
            1097558: "Change image not allowed."
        },
        "CustomizationDone": false
    }
}

In case the order item does not need any customization and you simply wish to push it to production you can send a request to the same API endpoint using the same URL and just specify which item you want to update without any image information.

{
    "Items": [
        {
            "OrderItemId": 1097557
        }
     ]
}