Orders – Get the billing information for an order
This API call can be used to retrieve all of the billing information for your order. The request will provide you with the billing information for the order which includes the product cost, shipping cost for each individual item in the order, order subtotal, shipping costs, surcharges, taxes, fees, any discounts, and the order total.
Get the billing information for an order
1. Send a GET API request to the following URL below.
https://api.print.io/api/v/5/source/api/orderbilling?orderid=[ORDER_ID]&recipeId=YourRecipeID&partnerBillingKey=YourPartnerBillingKey
You must also replace the [ORDER_ID]
value in the URL above with the order ID of the order that you want get the billing information for.
You can also add currency as an additional parameter to the GET request. You would simply add currency=[CURRENCY]
to the GET request as a parameter.
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.
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 can view an example GET request below:
2. 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 billing information for the order.
You can find an example response below:
{
"HadError": false,
"Result": {
"OrderSubtotal": {
"Price": 21.56,
"CurrencyCode": "USD",
"FormattedPrice": "$21.56",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"ShippingCost": {
"Price": 13.48,
"CurrencyCode": "USD",
"FormattedPrice": "$13.48",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"Surcharge": {
"Price": 0.00,
"CurrencyCode": "USD",
"FormattedPrice": "$0.00",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"Tax": {
"Price": 3.57,
"CurrencyCode": "USD",
"FormattedPrice": "$3.57",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"Discount": {
"Price": 0,
"CurrencyCode": "USD",
"FormattedPrice": "$0.00",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"Fees": {
"Price": 0,
"CurrencyCode": "USD",
"FormattedPrice": "$0.00",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"Total": {
"Price": 38.61,
"CurrencyCode": "USD",
"FormattedPrice": "$38.61",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"Items": [
{
"Id": 1065621,
"ProductCost": {
"Price": 20.90,
"CurrencyCode": "USD",
"FormattedPrice": "$20.90",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"ShippingCost": {
"Price": 9.99,
"CurrencyCode": "USD",
"FormattedPrice": "$9.99",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
}
},
{
"Id": 1065622,
"ProductCost": {
"Price": 0.66,
"CurrencyCode": "USD",
"FormattedPrice": "$0.66",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
},
"ShippingCost": {
"Price": 3.49,
"CurrencyCode": "USD",
"FormattedPrice": "$3.49",
"CurrencyFormat": "${1}",
"CurrencyDigits": 2
}
}
]
}
}