So Intuit built their QBO Customer API to use the same URL for two distinctly different actions: Create (POST) and Update (also, POST for some reason).
Create a customer
#Request URL
POST /v3/company/<realmID>/customer
Content type:application/json
Production Base URL:https://quickbooks.api.intuit.com
Sandbox Base URL:https://sandbox-quickbooks.api.intuit.com
#Request Body
{
"FullyQualifiedName": "King Groceries",
"PrimaryEmailAddr": {
"Address": "jdrew@myemail.com"
},
"DisplayName": "King's Groceries",
"Suffix": "Jr",
"Title": "Mr",
"MiddleName": "B",
"Notes": "Here are other details.",
"FamilyName": "King",
"PrimaryPhone": {
"FreeFormNumber": "(555) 555-5555"
},
"CompanyName": "King Groceries",
"BillAddr": {
"CountrySubDivisionCode": "CA",
"City": "Mountain View",
"PostalCode": "94042",
"Line1": "123 Main Street",
"Country": "USA"
},
"GivenName": "James"
}
Full update a customer
# Request URL
POST /v3/company/<realmID>/customer
Content type:application/json
Production Base URL:https://quickbooks.api.intuit.com
Sandbox Base URL:https://sandbox-quickbooks.api.intuit.com
# Request Body
{
"domain": "QBO",
"PrimaryEmailAddr": {
"Address": "Surf@Intuit.com"
},
"DisplayName": "Bill's Windsurf Shop",
"PreferredDeliveryMethod": "Print",
"GivenName": "Bill",
"FullyQualifiedName": "Bill's Windsurf Shop",
"BillWithParent": false,
"Job": false,
"BalanceWithJobs": 85.0,
"PrimaryPhone": {
"FreeFormNumber": "(415) 444-6538"
},
"Active": true,
"MetaData": {
"CreateTime": "2014-09-11T16:49:28-07:00",
"LastUpdatedTime": "2015-07-23T11:07:55-07:00"
},
"BillAddr": {
"City": "Half Moon Bay",
"Line1": "12 Ocean Dr.",
"PostalCode": "94213",
"Lat": "37.4307072",
"Long": "-122.4295234",
"CountrySubDivisionCode": "CA",
"Id": "3"
},
"MiddleName": "Mac",
"Taxable": false,
"Balance": 85.0,
"SyncToken": "3",
"CompanyName": "Bill's Windsurf Shop",
"FamilyName": "Lucchini",
"PrintOnCheckName": "Bill's Wind Surf Shop",
"sparse": false,
"Id": "2"
}
Really, it looks like it determines if it is an update if the "Id" key is present in the body. That is the only distinction as to if it should update a record.
So, at any rate, I need a Create and an Update action. The Customer Connector will not allow this because they share the same URL.
What are my options here?
- Make a separate custom connector? (That would be pretty stupid if I have to do this.)
- Is there a way to force Power Automate to accept two Actions with the same URL? (I honestly don't see why this shouldn't be allowed. The action name being called should delineate the URL and Body to use. What difference does it make if it is the same URL.)
- Is there a way to have two distinct bodies per one action in the custom connector?
- Or, do I just have to build the body in the Flow with Compose and only have one generic action in the customer connector called "Create and Update Customers"?
Seems like the last option is going to be the case. If so, how do I add a request body from a Flow?