# Output Api

SSM provide to delivery companies a simple lightweight API to receive and update commands status of their clients, in this guide will show you how to work with our Api.

# Webhook

Webhooks are one way that apps can send automated messages or information to other apps. in our case you need to create a webhook in our application in order to receive the command when it's confirmed. with that webhook you create we'll know that whenever a command get confirmed we need to send it to you (delivery company).

# How to create a webhook ?

To create a webhook you need first to have a client_id if you don't have one yet please contact the support team to get yours, then just perform the request below.

# Endpoint

POST https://api.supersalesmanagerapp.com/api/app/delivery-companies/webhooks

# Body

The create webhook request should contains this body:

{
 "event_name": "command.created",
 "delivery_url": "https://yourdeliverycompanywebsite.com/api/commands/create",
 "client_id": "ALS554HFHF90"
}
Attribute Description Required
event_name The complete name of the customer. for now we support only command.created Yes
delivery_url Your endpoint where we'll send you the confirmed commands Yes
client_id Your client id provided by support team. Yes

# Response

If the webhook is created successfully you should recieve this response.

{
    "payload": {
        "name": "command.created",
        "delivery_url": "https://yourdeliverycompanywebsite.com/api/commands/create"
    },
    "_response": {
        "code": "W201_00",
        "message": "Webhooks has succesfully created !"
    }
}

# Command status

Webhooks are one way that apps can send automated messages or information to other apps. in our case you need to create a webhook in our application in order to receive the command when it's confirmed. with that webhook you create we'll know that whenever a command get confirmed we need to send it to you (delivery company).

# How to update status of command ?

To create a webhook you need first to have a client_id if you don't have one yet please contact the support team to get yours, then just perform the request below.

# Endpoint

POST https://api.supersalesmanagerapp.com/api/app/delivery-companies/commands/status/update

# Body

The create webhook the request should contains this body:

{
 "status": "DELIVERED",
 "code": "1199"
}
Attribute Description Required
status the status should be one of the following DELIVERED, DELIVERY_CANCELLED, TO_BE_COLLECTED, DELIVERY_PENDDING Yes
code the id of command that should be updated Yes

# Response

If the webhook is created successfully you should recieve this response.

{
    "_response": {
        "code": "CO200_01",
        "message": "Command succesfully updated !"
    }
}