Contrato histórico: POST create-offer
Contrato histórico de API. Esta página describe un contrato anterior. Los métodos, las rutas y las respuestas pueden diferir de la API vigente.
Significado histórico
Crear oferta de negocio
Este endpoint de la API se utiliza para crear un descuento. Puede ser un descuento automático que se aplica al carrito después de que se cumplen las condiciones, o un descuento con cupón que se aplica al carrito al ingresar el código y cumplirse las condiciones del cupón.
API vigente
Para desarrollar una integración nueva, consulta la referencia o guía vigente enlazada.
Ver la referencia de la API vigenteParámetros
[
{
"name": "language",
"in": "path",
"schema": {
"type": "string",
"default": "en"
},
"required": true
},
{
"name": "project",
"in": "path",
"schema": {
"type": "string",
"default": "<redacted-personal>"
},
"required": true
},
{
"name": "business_id",
"in": "path",
"schema": {
"type": "integer",
"format": "int32"
},
"required": true
},
{
"name": "api_version",
"in": "path",
"schema": {
"type": "string",
"default": "v400"
},
"required": true
}
]
Cuerpo de solicitud
{
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name",
"type",
"rate_type",
"rate",
"start",
"end"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "integer",
"format": "int32"
},
"minimum": {
"type": "number",
"format": "float"
},
"rate_type": {
"type": "integer",
"format": "int32"
},
"rate": {
"type": "number",
"format": "float"
},
"start": {
"type": "string",
"format": "date"
},
"end": {
"type": "string",
"format": "date"
},
"limit": {
"type": "integer",
"format": "int32"
},
"coupon": {
"type": "string"
},
"enabled": {
"type": "boolean"
}
}
}
}
}
}
Respuestas
{
"200": {
"description": "200",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "\n \"error\": false,\n \"result\": {\n \"name\": \"Weekend\",\n \"type\": 1,\n \"minimum\": 1,\n \"rate_type\": 1,\n \"rate\": 1,\n \"start\": \"11/11/2011\",\n \"end\": \"11/11/2222\",\n \"business_id\": \"41\",\n \"updated_at\": \"2018-11-26 17:31:46\",\n \"created_at\": \"2018-11-26 17:31:46\",\n \"id\": 24\n }"
}
}
}
}
},
"400": {
"description": "400",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": true,\n \"result\": [\n \"The offer could not be registered.\"\n ]\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "boolean",
"example": true,
"default": true
},
"result": {
"type": "array",
"items": {
"type": "string",
"example": "The offer could not be registered."
}
}
}
}
}
}
},
"401": {
"description": "401",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": true,\n \"result\": [\n \"You do not have permission.\"\n ]\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "boolean",
"example": true,
"default": true
},
"result": {
"type": "array",
"items": {
"type": "string",
"example": "You do not have permission."
}
}
}
}
}
}
}
}