Skip to content

Instantly share code, notes, and snippets.

@FelipeBarrosCruz
Created February 9, 2021 16:17
Show Gist options
  • Save FelipeBarrosCruz/c1fbbd3209cac23616a5f6f2bc0a8c7e to your computer and use it in GitHub Desktop.
Save FelipeBarrosCruz/c1fbbd3209cac23616a5f6f2bc0a8c7e to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
description: "StoneLog Reverse API to connect with logistic services"
version: "1.0.0"
title: "StoneLog Reverse API"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
basePath: "/"
schemes:
- "https"
paths:
/carriers:
post:
tags:
- "StoneLog"
summary: "Create a carrier"
description: "Returns the created carrier"
operationId: "create_carrier"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "create carrier"
required: true
schema:
$ref: "#/definitions/Carrier"
responses:
"201":
description: "successful operation"
schema:
$ref: "#/definitions/Carrier"
"400":
description: "Invalid request"
schema:
$ref: "#/definitions/ValidationError"
security:
- api_key: []
/carriers/{carrier_id}/prices:
post:
tags:
- "StoneLog"
summary: "Create a carrier price"
description: "Returns the created carrier price"
operationId: "create_carrier_price"
produces:
- "application/json"
parameters:
- in: "path"
name: carrier_id
type: "integer"
required: true
description: Numeric ID of the carrier
- in: "body"
name: "body"
description: "create carrier price"
required: true
schema:
$ref: "#/definitions/CarrierPrice"
responses:
"201":
description: "successful operation"
schema:
$ref: "#/definitions/Carrier"
"400":
description: "Invalid request"
schema:
$ref: "#/definitions/ValidationError"
security:
- api_key: []
securityDefinitions:
api_key:
type: "apiKey"
name: "api_key"
in: "header"
definitions:
Carrier:
type: "object"
properties:
name:
type: "string"
service:
type: "string"
api_key:
type: "string"
postback_url:
type: "string"
select_url:
type: "string"
CarrierPrice:
type: "object"
properties:
reference_key:
type: "string"
fixed_cost:
type: "number"
dynamic_cost:
type: "number"
default: 0
distance_cost:
type: "number"
default: 0
state:
type: "string"
city:
type: "string"
zipcode:
type: "integer"
example: 64010060
neighborhood:
type: "string"
default: null
ValidationError:
type: "object"
properties:
error:
type: "string"
title:
type: "string"
message:
type: "string"
fields:
type: "array"
items:
type: "string"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment