Glue API: Add services

Edit on GitHub

This endpoint lets you add services.

Installation

Install the Service Points feature

Add a service


POST /services


Request

HEADER KEY HEADER VALUE REQUIRED DESCRIPTION
Authorization string Alphanumeric string that authorizes the warehouse user to send requests to protected resources. Get it by authenticating as a warehouse user.
QUERY PARAMETER DESCRIPTION POSSIBLE VALUES
include Adds resource relationships to the request. service-types service-points
REQUEST USAGE
POST https://glue-backend.mysprykershop.com/services Add a service.
POST https://glue-backend.mysprykershop.com/services?include=service-types Add a service. Include information about the specified service type in the response.
POST https://glue-backend.mysprykershop.com/services?include=service-points Add a service. Include information about the specified service type in the response.
{
    "data": {
        "type": "services",
        "attributes": {
            "isActive": false,
            "key": "Demo",
            "servicePointUuid": "262feb9d-33a7-5c55-9b04-45b1fd22067e",
            "serviceTypeUuid": "7a263a50-12a3-5ef4-86f4-366f20783180"
        }
    }
}
ATTRIBUTE TYPE REQUIRED DESCRIPTION
isActive Boolean Defines if the service is to be active. Inactive services are not displayed on the Storefront.
key String Unique identifier of the service.
servicePointUuid String Unique identifier of the service point to assign this service to. To get it, retrieve service points.
serviceTypeUuid String Unique identifier of the service type to add a service of. To get it, retrieve service types.

Response

Add a service
{
    "data": {
        "type": "services",
        "id": "6cec29eb-a835-561c-a821-f7a690538db7",
        "attributes": {
            "uuid": "6cec29eb-a835-561c-a821-f7a690538db7",
            "isActive": false,
            "key": "Demo"
        },
        "links": {
            "self": "https://glue-backend.mysprykershop.com/services/6cec29eb-a835-561c-a821-f7a690538db7"
        }
    }
}
Add a service with service type information included
{
    "data": {
        "type": "services",
        "id": "5d1c9ed0-43b9-520b-931c-415557d9a633",
        "attributes": {
            "uuid": "5d1c9ed0-43b9-520b-931c-415557d9a633",
            "isActive": false,
            "key": "repair"
        },
        "relationships": {
            "service-types": {
                "data": [
                    {
                        "type": "service-types",
                        "id": "30f29960-b357-53a7-8ad6-1ed93ffc4086"
                    }
                ]
            }
        },
        "links": {
            "self": "https://glue-backend.mysprykershop.com/services/5d1c9ed0-43b9-520b-931c-415557d9a633?include=service-types"
        }
    },
    "included": [
        {
            "type": "service-types",
            "id": "30f29960-b357-53a7-8ad6-1ed93ffc4086",
            "attributes": {
                "name": "Repair",
                "key": "rp"
            },
            "links": {
                "self": "https://glue-backend.mysprykershop.com/service-types/30f29960-b357-53a7-8ad6-1ed93ffc4086?include=service-types"
            }
        }
    ]
}
Add a service with service point information included
{
    "data": {
        "type": "services",
        "id": "16007e04-72b4-5ac1-ad18-1ed75fef1639",
        "attributes": {
            "uuid": "16007e04-72b4-5ac1-ad18-1ed75fef1639",
            "isActive": false,
            "key": "installation"
        },
        "relationships": {
            "service-points": {
                "data": [
                    {
                        "type": "service-points",
                        "id": "262feb9d-33a7-5c55-9b04-45b1fd22067e"
                    }
                ]
            }
        },
        "links": {
            "self": "https://glue-backend.mysprykershop.com/services/16007e04-72b4-5ac1-ad18-1ed75fef1639?include=service-points"
        }
    },
    "included": [
        {
            "type": "service-points",
            "id": "262feb9d-33a7-5c55-9b04-45b1fd22067e",
            "attributes": {
                "name": "Spryker Main Store",
                "key": "sp1",
                "isActive": true,
                "stores": [
                    "DE",
                    "AT"
                ]
            },
            "relationships": {
                "services": {
                    "data": [
                        {
                            "type": "services",
                            "id": "16007e04-72b4-5ac1-ad18-1ed75fef1639"
                        }
                    ]
                }
            },
            "links": {
                "self": "https://glue-backend.mysprykershop.com/service-points/262feb9d-33a7-5c55-9b04-45b1fd22067e?include=service-points"
            }
        }
    ]
}
RESOURCE ATTRIBUTE TYPE DESCRIPTION
services uuid String Unique identifier of the service.
services isActive Boolean Defines if the service is active. Inactive services are not displayed on the Storefront.
services key String Unique key of the service. It’s used as a reference when assigning services to service points.
RESOURCE ATTRIBUTE TYPE DESCRIPTION
service-types name String Name.
service-types key String Unique key of the service type. You will use it as a reference when adding services of this type.
RESOURCE ATTRIBUTE TYPE DESCRIPTION
service-points name String This name is displayed on the Storefront.
service-points key String Unique identifier of the service point.
service-points isActive Boolean Defines if the service point is active. If it’s inactive, customers can’t select it.
service-points stores Object Defines the stores the service point is available in.

Possible errors

CODE REASON
5403 A service point with the specified id doesn’t exist.
5418 A service type with the specified id doesn’t exist.
5426 A service with the specified key exists.
5429 A service with defined relation of service point and service type exists.

To view generic errors that originate from the Glue Application, see Reference information: GlueApplication errors.