When the tool consumer (Canvas) launches your tool and an LTI Basic Outcomes Service (Grade Passback) is available the consumer will pass a lis_outcome_service_url and a lis_result_sourcedid.
To send a grade back from your tool to Canvas, you POST some XML to the lis_outcome_service_url. This XML will include the lis_result_sourcedid, which identifies the user and gradebook column.
This is all as per the LTI specs. Eg., Learning Tools Interoperability v1.1 Implementation Guide | IMS Global Learning Consortium
Note that the XML has to be sent using OAuth body signing.
The easiest thing is to see if there is a library or code that already supports the LTI grade return, or failing that, just the OAuth stuff, for the programming language you are using. There are some links to code at Learning Tools Interoperability: Sample Code | IMS Global Learning Consortium
Canvas has some extensions, most of Grade Passback Tools - Canvas LMS REST API Documentation is outlining these extensions.