How to get information about sales customer from Sale via API?

lock
push_pin
done
Answered
2

I have successfully been able to fetch information about Projects and Sales via the SuperOffice API.

Additionally, I have been able to fetch information about Sale/Project connections via the Links call.

However, there are some fields my client would like me to fetch from the Sales tab, for example the customer/company of the given Sale.

What I am referring to is the field named "Firma" ("Company" in Norwegian). I did not find this info via a standard Sale API call towards this specific Sale.

How can I fetch this information via the API?

 

20 Mar 2023 | 09:38 AM

All Replies (2)

Hi Oscar,

Technical API questions should be posted in the Technical forums.

That said, when you use the APIs to get a Sale, the company information is available under the Contact property. The selected company contact is available under the Person property.

You didn't specify which API you used, however if you are using the REST API, and getting a sale like this:

GET https://{{env}}.superoffice.com/{{tenant}}/api/v1/sale/3 HTTP/1.1
Authorization: Bearer {{token}}
Accept: application/json

The response appears as:

{
  "Appointment": null,
  "Associate": {
  },
  "UpdatedBy": {
  },
  "CreatedBy": {
  },
  "Contact": {
    "ContactId": 1,
    "Name": "Starbucks",
    "OrgNr": "1234567890",
    "Department": "Foods",
    "URL": "http://www.Starbucks.co.uk",
    "City": "Milton Keynes",
    "DirectPhone": "+448707703333",
    "AssociateId": 5,
    "CountryId": 826,
   // left out for bevity
},
"Person": {
    "Position": "",
    "PersonId": 1,
    "Mrmrs": "Ms.",
    "Firstname": "Debra",
    "Lastname": "Graves",
    "MiddleName": "",
    "Title": "Sales Director",
    "Description": "",
    "Email": "debra.graces@starbucks.co.uk",
   // left out for bevity
 }
}
  

So you can get the sale company and contact names directly from their related sale entity properties.

Hope this helps!

 

20 Mar 2023 | 10:34 AM
Thank you Tony
22 Mar 2023 | 09:32 AM

Add reply