How to Add Parts to a Service Ticket using SedonaAPI 2.0

Issue: 

 When creating a new Service Ticket using the API, Parts cannot be added in the Post for Service Tickets. 

Resolution: 

The API follows the same business rules as the application. You cannot add parts, appointments, notes, or other associated records until the ticket record exists in the database. 

 In the application you can see that the buttons for the associated records are all disabled until you save the ticket. 

 A screenshot of a computer

Description automatically generated 

 Once saved the other buttons are available. 

A screenshot of a computer

Description automatically generated  

 The same is true with the API. 

 The status of the ticket needs to be In-Process so the status will need to be sent to set that status. 

You would first Use the Post for service Tickets.  

A close up of a sign

Description automatically generated 

A screenshot of a service ticket

Description automatically generated 

If the Post is successful, you will get the response back. 

 A screenshot of a computer

Description automatically generated

Now that the Service Ticket Exists the other part records for the ticket can be added. 

Use the API endpoint for parts. 

 A close up of a ticket

Description automatically generated

 Use the ServiceTicketID from the response in the body of the Parts request. 

 A screenshot of a computer

Description automatically generated

 If the Post is successful, you will get the 201 created response.  

 A screenshot of a computer

Description automatically generated

 Below is a Json example of a Post for Service Tickets and for the Post for Service Ticket Parts. 

 A close up of a sign

Description automatically generated 

  { 

        "TicketStatus":"IP", 

        "CustomerId": 52334, 

        "CustomerNumber": "48977", 

        "CustomerSiteId": 59608, 

        "CustomerSiteBusinessName": "Elizabeth Arrington Beach House", 

        "CustomerSiteAddress": "4455 Beachside Blvd", 

        "CustomerSystemId": 115697, 

        "CustomerSystemAlarmAccount": "33 Use for Service", 

        "CustomerSystemCode": "CCTV", 

        "MultipleSystems": false, 

        "ProblemId": 12, 

        "ScheduledFor": "2023-05-16T08:00:00", 

        "EstimatedLength": 60, 

        "Billable": false, 

        "FieldComments": "", 

        "TripCharge": 25.0000, 

        "IsInspection": false, 

        "ServiceCompanyCode": "ABC Service Provider", 

        "PriorityDescription": "Medium", 

        "CategoryCode": "SVC Cont", 

        "ExpertiseLevel": 3, 

        "ServiceLevelCode": "T&M-Res", 

        "AutoNotify": "", 

        "CustomerBillId": 53361, 

        "CustomerBillBusinessName": "Elizabeth Arrington", 

        "CityState": "Daphne, AL" 

    } 

 

 

 A close up of a ticket

Description automatically generated 

 

 

 { 

 "ServiceTicketId": 8387, 

 "PartId": 5555650, 

 "PartCode": "18Volt Battery", 

 "Quantity": 1.0, 

 "Rate": 18.0000, 

 "Location": "Testerton", 

 "WarehouseId": 61, 

 "WarehouseCode": "Daphne", 

 "Description": "18Volt Battery", 

 "TaxExempt": false 

} 

To Review the full model for Service Tickets and Service Ticket Parts see the online help for SedonaCloud API. 

You can see the documentation at the URL below. 

If you are currently using SedonaCloud2.0 the documentation is available from your site under the About page. 

A screenshot of a computer

Description automatically generated

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.