Skip to main content
POST
/
services
Create a new Service
curl --request POST \
  --url https://commerce.driv.ly/api/services \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "ser_kj93kdl9s3d0",
  "type": "Oil Change",
  "price": 80,
  "provider": {
    "id": "ser_kj93kdl9s3d0",
    "name": "Auto Shop",
    "addresses": [
      {
        "street": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94105"
      }
    ]
  },
  "customer": {
    "id": "cus_kj93kdl9s3d0",
    "name": "John Doe",
    "email": "john@example.com",
    "addresses": [
      {
        "street": "456 Elm St",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94105"
      }
    ],
    "phoneNumbers": [
      "555-555-5555"
    ]
  },
  "description": "Comprehensive oil change service."
}'
{
  "data": {
    "id": "ser_kj93kdl9s3d0",
    "type": "Oil Change",
    "price": 80,
    "provider": {
      "id": "ser_kj93kdl9s3d0",
      "name": "Auto Shop",
      "addresses": [
        {
          "street": "123 Main St",
          "city": "San Francisco",
          "state": "CA",
          "zip": "94105"
        }
      ]
    },
    "customer": {
      "id": "cus_kj93kdl9s3d0",
      "name": "John Doe",
      "email": "john@example.com",
      "addresses": [
        {
          "street": "456 Elm St",
          "city": "San Francisco",
          "state": "CA",
          "zip": "94105"
        }
      ],
      "phoneNumbers": [
        "555-555-5555"
      ]
    },
    "description": "Comprehensive oil change service."
  },
  "success": true
}

Query Parameters

depth
integer

The number of levels of related objects to include in the response

Body

application/json
provider
required

Service is from Service Provider

vehicle
required

Service is performed on Vehicle

customer
required

Service is sought by Customer

id
string

Service is uniquely identified by id

destinationAddress

Service is to Destination Address

destinationContact

Service is to Destination Contact

destinationConsumer

Service is to Destination Consumer

originAddress

Service is from Origin Address

originContact

Service is from Origin Contact

originConsumer

Service is from Origin Consumer

deal

Service is performed for Deal

Response

Service Created

data
object
Examples:
{
"id": "ser_kj93kdl9s3d0",
"type": "Oil Change",
"price": 80,
"provider": {
"id": "ser_kj93kdl9s3d0",
"name": "Auto Shop",
"addresses": [
{
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zip": "94105"
}
]
},
"customer": {
"id": "cus_kj93kdl9s3d0",
"name": "John Doe",
"email": "john@example.com",
"addresses": [
{
"street": "456 Elm St",
"city": "San Francisco",
"state": "CA",
"zip": "94105"
}
],
"phoneNumbers": ["555-555-5555"]
},
"description": "Comprehensive oil change service."
}
success
boolean
I