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/json

Client ID and Client Secret pair.

clientId
required
string
clientSecret
required
string

Responses

200

A dictionary with a JWT, its time until expiration, and type.

403

You have exceeded your token quota and cannot create any more tokens until {timestamp}

post /auth

Production environment

https://sync.sparetech.io/v1/auth

Sandbox environment

https://sync.sandbox.sparetech.io/v1/auth

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "clientId": "YOUR_CLIENT_ID",
  • "clientSecret": "YOUR_CLIENT_SECRET"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:

Responses

200

A list of strings containing attributes that can occur in the metadata object.

get /schema/export

Production environment

https://sync.sparetech.io/v1/schema/export

Sandbox environment

https://sync.sandbox.sparetech.io/v1/schema/export

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "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:

Responses

200

A list of strings containing all the names of the attributes that can occur in the request body of the Import Material endpoint.

get /schema/import

Production environment

https://sync.sparetech.io/v1/schema/import

Sandbox environment

https://sync.sandbox.sparetech.io/v1/schema/import

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "Materialnummer",
  • "[ART_NUM]",
  • "[MANU]",
  • "[TYP]"
]

CreationIntent

List all CreationIntents

Returns a list of CreationIntents.

Authorizations:
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

200

A dictionary with a creationIntents property that contains an array of up to limit. CreationIntents.

404

Creation intent {id} couldn't be found

get /creation-intents

Production environment

https://sync.sparetech.io/v1/creation-intents

Sandbox environment

https://sync.sandbox.sparetech.io/v1/creation-intents

Response samples

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

Retrieve a CreationIntent

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

Authorizations:
path Parameters
id
required
string

Responses

200

A CreationIntent if a valid id was provided.

404

Creation intent {id} couldn't be found

get /creation-intents/{id}

Production environment

https://sync.sparetech.io/v1/creation-intents/{id}

Sandbox environment

https://sync.sandbox.sparetech.io/v1/creation-intents/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
path Parameters
id
required
string
Request Body schema: application/json
materialNumber
required
string

Responses

200

The updated CreationIntent after adding the material number.

404

Creation intent {id} couldn't be found

post /creation-intents/{id}/confirm

Production environment

https://sync.sparetech.io/v1/creation-intents/{id}/confirm

Sandbox environment

https://sync.sandbox.sparetech.io/v1/creation-intents/{id}/confirm

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "materialNumber": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
path Parameters
id
required
string
Request Body schema: application/json
message
required
string

Short description of the reason for rejecting the intent.

Responses

200

OK

404

Creation intent {id} couldn't be found

post /creation-intents/{id}/reject

Production environment

https://sync.sparetech.io/v1/creation-intents/{id}/reject

Sandbox environment

https://sync.sandbox.sparetech.io/v1/creation-intents/{id}/reject

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

ChangeIntent

List all ChangeIntents

Returns a list of ChangeIntents.

Authorizations:
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

200

A dictionary with a changeIntents property that contains an array of up to limit ChangeIntents.

404

Change intent {id} couldn't be found

get /change-intents

Production environment

https://sync.sparetech.io/v1/change-intents

Sandbox environment

https://sync.sandbox.sparetech.io/v1/change-intents

Response samples

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

Retrieve a ChangeIntent

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

Authorizations:
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

200

A ChangeIntent if a valid id was provided.

404

Change intent {id} couldn't be found

get /change-intents/{id}

Production environment

https://sync.sparetech.io/v1/change-intents/{id}

Sandbox environment

https://sync.sandbox.sparetech.io/v1/change-intents/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
path Parameters
id
required
string

Responses

200

OK

404

Change intent {id} couldn't be found

post /change-intents/{id}/confirm

Production environment

https://sync.sparetech.io/v1/change-intents/{id}/confirm

Sandbox environment

https://sync.sandbox.sparetech.io/v1/change-intents/{id}/confirm

Reject material change

Marks the intent as rejected by the external system.

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

Short description of the reason for rejecting the intent.

Responses

200

OK

404

Change intent {id} couldn't be found

post /change-intents/{id}/reject

Production environment

https://sync.sparetech.io/v1/change-intents/{id}/reject

Sandbox environment

https://sync.sandbox.sparetech.io/v1/change-intents/{id}/reject

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

ExtensionIntent

List all ExtensionIntents

Returns a list of ExtensionIntents.

Authorizations:
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

200

A dictionary with a extensionIntents property that contains an array of up to limit ExtensionIntents.

404

Extension intent {id} couldn't be found

get /extension-intents

Production environment

https://sync.sparetech.io/v1/extension-intents

Sandbox environment

https://sync.sandbox.sparetech.io/v1/extension-intents

Response samples

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

Retrieve an ExtensionIntent

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

Authorizations:
path Parameters
id
required
string

Responses

200

An ExtensionIntent if a valid id was provided.

404

Extension intent {id} couldn't be found

get /extension-intents/{id}

Production environment

https://sync.sparetech.io/v1/extension-intents/{id}

Sandbox environment

https://sync.sandbox.sparetech.io/v1/extension-intents/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
path Parameters
id
required
string

Responses

200

OK

404

Extension intent {id} couldn't be found

post /extension-intents/{id}/confirm

Production environment

https://sync.sparetech.io/v1/extension-intents/{id}/confirm

Sandbox environment

https://sync.sandbox.sparetech.io/v1/extension-intents/{id}/confirm

Reject material extension

Marks the intent as rejected by the external system.

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

Short description of the reason for rejecting the intent.

Responses

200

OK

404

Extension intent {id} couldn't be found

post /extension-intents/{id}/reject

Production environment

https://sync.sparetech.io/v1/extension-intents/{id}/reject

Sandbox environment

https://sync.sandbox.sparetech.io/v1/extension-intents/{id}/reject

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
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

200

OK

404

Material reference already exists.

post /material

Production environment

https://sync.sparetech.io/v1/material

Sandbox environment

https://sync.sandbox.sparetech.io/v1/material

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
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

200

OK

404

Material reference and/or plant couldn't be found.

409

Invalid material reference.

put /material/{reference}

Production environment

https://sync.sparetech.io/v1/material/{reference}

Sandbox environment

https://sync.sandbox.sparetech.io/v1/material/{reference}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
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

200

OK

404

Material reference and/or plant couldn't be found.

409

Plant is already included in material

422

Material fields should not be part of an extension.

post /material/{reference}/extend

Production environment

https://sync.sparetech.io/v1/material/{reference}/extend

Sandbox environment

https://sync.sandbox.sparetech.io/v1/material/{reference}/extend

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "material":
    {
    }
}