Skip to content
SPARETECH-API
SPARETECH Team

SPARETECH API

Table of contents

 

General Information

The SPARETECH API is a solution that enables seamless synchronization of data between the SPARETECH application and various other systems, including ERP and MDM, providing users with efficient and hassle-free synchronization.

Our API is using REST design principles and allows you to manage your material master data. It has resource-oriented URLs, uses standard HTTP methods, and accepts and returns JSON-encoded request and response bodies. Authorization is done with standard JSON Web Tokens (JWT).


SPARETECH Workflow APIs


Resources With this API you can
Schema Get material master configuration schema that can be used for further mapping
Materials creation Synchronise all creation intents for material master creation in your ERP or MDM
Material change Synchronize all change intents for material master changes in your ERP or MDM
Material extension Synchronise all extension intents for material master extension in your ERP or MDM
Material master update Update the material master in SPARETECH based on the changes initiated by your ERP.


Security and Authentication

Our API uses the Client Credentials Flow for authentication and JWT tokens for authorization. SPARETECH provides your client credentials, a pair of Client ID and Client Secret, for each environment. For more details on authenticating your application, see Get an access token below

Credential-Flow

Test and Experiment

We provide you with a sandbox environment where you can create test data while safely trying out your integration without affecting your live data. Use the application to manage your test data, and then call the API to test your integration.

Get started

Get an access token

To access your data, you must first exchange your client credentials for an access token. This is done by calling our Authentication endpoint.

Example


$ curl 'https://sync.sandbox.sparetech.io/v1/auth' --request POST \ 
--header 'content-type: application/json' \
--data '{ "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" }'

Get a list of creation intents

Now that you have an access token, you can request Creation Intents.

$ curl 'https://sync.sandbox.sparetech.io/v1/creation-intents' \ 
--header "Authorization: Bearer <access_token>"

Your response should look something like this, which shows you that there is intent:

 { 
 "hasMore": false,
 "totalCount": 1,
 "limit": 10,
 "creationIntents":
[
   {
    "id": "904134",
    "createdAt": "2022-12-10T12:05:12Z",
    "status": "Exported",
    "metadata": {
    "MANU": "Sparetech",
    "ART_NUM": "SED1234",
    "TYP": "TYP_1234",
    "DESC": "Material Description"
   }
  }
 ]
}

The content of your creationIntents metadata object depends on your own export configuration and, since we only return non-empty fields, you can access the full object with the Export Schema endpoint.

Confirm a creation

After you have listed your available creation intentions, you can edit them and write them to your system. You should then call the Confirm Creation endpoint to inform SPARETECH that you have processed the material. This way you ensure that your material master data is synchronized between the two systems.

$ curl "https://sync.sandbox.sparetech.io/v1/creation-intents/904134/confirm" \
-X POST \ -H "Authorization: Bearer <access_token>" \ -d "{ \"materialNumber\": \"<YOUR_INTERNAL_REFERENCE>\" }"

 

YOUR_INTERNAL_REFERENCE is the value you use as identifier for this material in your system.

 

Change and Extension Intents

For Change Intents and Extension Intents, the process is very similar! You just need to list the available intents, apply them to your system and call the confirmation endpoints to keep the two systems at the same level. Specific information about these two processes can be found in our documentation.

Recommendations

  • Store your credentials and tokens securely and share them only with services that need them.
  • Reduce unnecessary calls by saving the access token received from the authorization server.
  • For SAP customers using SAP NetWeaver: Check your version before starting the configuration in PI/PO and whether the REST Adapter supports the authentication flow for OAuth 2.0.


API Documentation

Find the technical API documentation on this page.

More contributions