Sync API (0.2.0)

Download OpenAPI specification:Download

Authorization

Token

This API uses JWT for authorization. SPARETECH will provide your client credentials, that are specific to each organisation and integration environment. See the Authentication section of this documentation for details on how to obtain a token.

Security Scheme Type: HTTP
HTTP Authorization Scheme: bearer
Bearer format: JWT

Authentication

Retrieve an access token

Retrieves a JWT bearer token to authorize requests. The token has an expiration time and can be requested a limited number of times per day.

Request Body schema: application/x-www-form-urlencoded

Client ID and Client Secret pair.

client_id
required
string
client_secret
required
string

Responses

Response samples

Content type
application/json
{
  • "access_token": "eyJz93a...k4laUWw",
  • "expires_in": 86400,
  • "token_type": "Bearer"
}

Retrieve an access token Deprecated

Retrieves a JWT bearer token to authorize requests. The token has an expiration time and can be requested a limited number of times per day.

Request Body schema: application/json

Client ID and Client Secret pair.

clientId
required
string
clientSecret
required
string

Responses

Request samples

Content type
application/json
{
  • "clientId": "YOUR_CLIENT_ID",
  • "clientSecret": "YOUR_CLIENT_SECRET"
}

Response samples

Content type
application/json
{
  • "accessToken": "eyJz93a...k4laUWw",
  • "expiresIn": 86400,
  • "tokenType": "Bearer"
}

Schema

Export Metadata Schema

Returns a list of attributes that can occur in the metadata object. Corresponds to the export mapping of your organisation.

Authorizations:
Token

Responses

Response samples

Content type
application/json
[
  • "MANU",
  • "ART_NUM",
  • "TYP",
  • "DESC"
]

Import Material Schema

Returns a list of attributes that can occur in the request body of the Import Material endpoint. Corresponds to the Material Master fields of your organisation.

Authorizations:
Token

Responses

Response samples

Content type
application/json
[
  • "Materialnummer",
  • "[ART_NUM]",
  • "[MANU]",
  • "[TYP]"
]

CreationIntent

List all CreationIntents

Returns a list of CreationIntents.

Authorizations:
Token
query Parameters
status
string (CreationIntentStatus)
Enum: "Ready" "Done"
Example: status=Ready

Only returns intents in the given status. Allowed statuses are Ready and Done.

created.gt
string <date>
Example: created.gt=2022-12-10

A filter based on the object's createdAt field. Return results where the field is greater than or equal to this value. Follows the ISO-8601 standard format.

created.lt
string <date>
Example: created.lt=2022-12-13

A filter based on the object's createdAt field. Return results where the field is less than or equal to this value. Follows the ISO-8601 standard format.

limit
integer
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 99, and the default is 10.

page
integer
Default: 0

A cursor for pagination across multiple pages of results.

Responses

Response samples

Content type
application/json
{
  • "hasMore": true,
  • "totalCount": 2,
  • "limit": 1,
  • "page": 0,
  • "creationIntents": [
    ]
}

Retrieve a CreationIntent

Retrieves the details of a CreationIntent that has previously been created.

Authorizations:
Token
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "904134",
  • "createdAt": "2022-12-10T12:05:12Z",
  • "createdBy": {
    },
  • "approvedBy": {
    },
  • "status": "Ready",
  • "metadata": {
    }
}

Confirm material creation

Confirms the material creation by supplying the material number.

Authorizations:
Token
path Parameters
id
required
string
Request Body schema: application/json
materialNumber
required
string

Responses

Request samples

Content type
application/json
{
  • "materialNumber": "string"
}

Response samples

Content type
application/json
{
  • "id": "904134",
  • "createdAt": "2022-12-10T12:05:12Z",
  • "createdBy": {
    },
  • "approvedBy": {
    },
  • "status": "Ready",
  • "metadata": {
    }
}

Reject material creation

Marks the intent as rejected by the external system.

Authorizations:
Token
path Parameters
id
required
string
Request Body schema: application/json
message
required
string

Short description of the reason for rejecting the intent.

Responses

Request samples

Content type
application/json
{
  • "message": "string"
}

ChangeIntent

List all ChangeIntents

Returns a list of ChangeIntents.

Authorizations:
Token
query Parameters
status
string (ChangeIntentStatus)
Enum: "Ready" "Done"
Example: status=Done

Only returns intents in the given status.

created.gt
string <date>
Example: created.gt=2022-12-10

A filter based on the object's createdAt field. Return results where the field is greater than or equal to this value. Follows the ISO-8601 standard format.

created.lt
string <date>
Example: created.lt=2022-12-13

A filter based on the object's createdAt field. Return results where the field is less than or equal to this value. Follows the ISO-8601 standard format.

limit
integer
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 99, and the default is 10.

page
integer
Default: 0

A cursor for pagination across multiple pages of results.

changes.only
boolean
Default: true

If true, this endpoint only returns fields that have changes as part of the metadata property of the changeIntents property. This is the default behaviour, mimicking a patch.

Responses

Response samples

Content type
application/json
{
  • "hasMore": true,
  • "totalCount": 2,
  • "limit": 1,
  • "page": 0,
  • "changeIntents": [
    ]
}

Retrieve a ChangeIntent

Retrieves the details of a ChangeIntent that has previously been created.

Authorizations:
Token
path Parameters
id
required
string
query Parameters
changes.only
boolean
Default: true

If true, this endpoint only returns fields that have changes as part of the metadata property. This is the default behaviour, mimicking a patch.

Responses

Response samples

Content type
application/json
{
  • "id": "904136",
  • "createdAt": "2022-12-10T12:05:12Z",
  • "createdBy": {
    },
  • "approvedBy": {
    },
  • "status": "Done",
  • "materialNumber": "79850030905",
  • "plant": "",
  • "metadata": {
    }
}

Confirm material change

Confirms the change to the material.

Authorizations:
Token
path Parameters
id
required
string

Responses

Reject material change

Marks the intent as rejected by the external system.

Authorizations:
Token
path Parameters
id
required
string
Request Body schema: application/json
message
required
string

Short description of the reason for rejecting the intent.

Responses

Request samples

Content type
application/json
{
  • "message": "string"
}

ExtensionIntent

List all ExtensionIntents

Returns a list of ExtensionIntents.

Authorizations:
Token
query Parameters
status
string (ExtensionIntentStatus)
Enum: "Ready" "Done"
Example: status=Done

Only returns intents in the given status.

created.gt
string <date>
Example: created.gt=2022-12-10

A filter based on the object's createdAt field. Return results where the field is greater than or equal to this value. Follows the ISO-8601 standard format.

created.lt
string <date>
Example: created.lt=2022-12-13

A filter based on the object's createdAt field. Return results where the field is less than or equal to this value. Follows the ISO-8601 standard format.

limit
integer
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 99, and the default is 10.

page
integer
Default: 0

A cursor for pagination across multiple pages of results.

Responses

Response samples

Content type
application/json
{
  • "hasMore": true,
  • "totalCount": 2,
  • "limit": 1,
  • "page": 0,
  • "extensionIntents": [
    ]
}

Retrieve an ExtensionIntent

Retrieves the details of an ExtensionIntent that has previously been created.

Authorizations:
Token
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "904136",
  • "createdAt": "2022-12-10T12:05:12Z",
  • "createdBy": {
    },
  • "approvedBy": {
    },
  • "status": "Done",
  • "materialNumber": "79850030905",
  • "metadata": {
    }
}

Confirm material extension

Confirms the extension of the material to a new plant.

Authorizations:
Token
path Parameters
id
required
string

Responses

Reject material extension

Marks the intent as rejected by the external system.

Authorizations:
Token
path Parameters
id
required
string
Request Body schema: application/json
message
required
string

Short description of the reason for rejecting the intent.

Responses

Request samples

Content type
application/json
{
  • "message": "string"
}

Material Master Sync

Create material

This endpoint is part of the module “Material Master Sync” for updating the material master content in SPARETECH based on the changes initiated from the external ERP. The current endpoint inserts a new material.

Authorizations:
Token
Request Body schema: application/json
material
required
object

Object containing the entire material for a specific plant, if exists. The fields in this object are based on the material master headings.

Responses

Request samples

Content type
application/json
{
  • "material": {
    }
}

Update material

This endpoint is part of the module “Material Master Sync” for updating the material master content in SPARETECH based on the changes initiated from the external ERP. The current endpoint applies changes to a material.

Authorizations:
Token
path Parameters
reference
required
string
Request Body schema: application/json
material
required
object

Object containing the entire material for a specific plant, if exists. The fields in this object are based on the material master headings.

Responses

Request samples

Content type
application/json
{
  • "material": {
    }
}

Extend material

This endpoint is part of the module “Material Master Sync” for updating the material master content in SPARETECH based on the changes initiated from the external ERP. The current endpoint extends a material to a given plant.

Authorizations:
Token
path Parameters
reference
required
string
Request Body schema: application/json
material
required
object

Object containing the plant fields. The fields in this object are based on the material master headings.

Responses

Request samples

Content type
application/json
{
  • "material": {
    }
}