APIs & Integrations

okasem
Member

Orders API and the Order total issue

SOLVE

Hello, I'm building a small app to integrate to new orders API, I managed to create a deal then associate it to the order and also add line items.

My main issue is I can't find anyway to fill in the fields for 'Order Total' like subtotal price, discount, tax and shipping

What API endpoint can i call to fill in these details?

Does the order has to have an invoice or quote so these details would show up?

 

screenshot-app_hubspot_com-2025_02_06-18_45_17.png

0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

Orders API and the Order total issue

SOLVE

Hey, @okasem 👋 Are you looking to have these values updated as if they are calculated properties based on the associations? Or do you just want to add values when you create the Order programmatically? If it's the second option, you can send them in the request body. You can find all the Order object properties by making a request to the Properties API.

Examples:
To get the properties for Orders

 

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/properties/orders?archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

 

Request I sent to create a new Order:

 

{
    "associations": [
        {
            "to": {
                "id": 901
            },
            "types": [
                {
                    "associationCategory": "HUBSPOT_DEFINED",
                    "associationTypeId": 507
                }
            ]
        }
    ],
    "properties": {
        "hs_order_name": "Cat supplies 6",
        "hs_currency_code": "USD",
        "hs_source_store": "Cat Supply Co",
        "hs_fulfillment_status": "Packing",
        "hs_shipping_address_city": "Albuquerque",
        "hs_shipping_address_state": "New Mexico",
        "hs_shipping_address_street": "123 Fake Street",
        "hs_subtotal_price": "1000",
        "hs_order_discount": "25",
        "hs_shipping_cost": "100",
        "hs_total_price": "1076",
        "hs_tax": "1"
    }
}

 

Result

CleanShot 2025-02-07 at 10.33.17@2x.png

 

I hope this helps get you moving forward! — Jaycee


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !

View solution in original post

0 Upvotes
2 Replies 2
okasem
Member

Orders API and the Order total issue

SOLVE

@Jaycee_Lewis Thanks a lot that really helped me 🙂

I hope those would be included in the documentation here

https://developers.hubspot.com/docs/guides/api/crm/commerce/orders

0 Upvotes
Jaycee_Lewis
Solution
Community Manager
Community Manager

Orders API and the Order total issue

SOLVE

Hey, @okasem 👋 Are you looking to have these values updated as if they are calculated properties based on the associations? Or do you just want to add values when you create the Order programmatically? If it's the second option, you can send them in the request body. You can find all the Order object properties by making a request to the Properties API.

Examples:
To get the properties for Orders

 

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/properties/orders?archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

 

Request I sent to create a new Order:

 

{
    "associations": [
        {
            "to": {
                "id": 901
            },
            "types": [
                {
                    "associationCategory": "HUBSPOT_DEFINED",
                    "associationTypeId": 507
                }
            ]
        }
    ],
    "properties": {
        "hs_order_name": "Cat supplies 6",
        "hs_currency_code": "USD",
        "hs_source_store": "Cat Supply Co",
        "hs_fulfillment_status": "Packing",
        "hs_shipping_address_city": "Albuquerque",
        "hs_shipping_address_state": "New Mexico",
        "hs_shipping_address_street": "123 Fake Street",
        "hs_subtotal_price": "1000",
        "hs_order_discount": "25",
        "hs_shipping_cost": "100",
        "hs_total_price": "1076",
        "hs_tax": "1"
    }
}

 

Result

CleanShot 2025-02-07 at 10.33.17@2x.png

 

I hope this helps get you moving forward! — Jaycee


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes