Purchases
POST /purchases
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A representation of a purchase",
"type": "object",
"anyOf": [
{"required": ["service_uid", "invoice_number", "purchase_detail", "prices"]},
{"required": ["email", "invoice_number", "purchase_detail", "prices"]},
{"required": ["document", "invoice_number", "purchase_detail", "prices"]},
{"required": ["telephone", "invoice_number", "purchase_detail", "prices"]}
],
"properties": {
"service_uid": { "type": "string" },
"email": { "type": "string" },
"document": { "type": "string" },
"telephone": { "type": "string" },
"points": { "type": "number", "multipleOf": 1 },
"invoice_number": { "type": ["string", "integer"] },
"channel":{"type": "string",
"enum": ["web","telephone", "in-store", "corporate", "direct", "other"]
},
"purchase_detail": {
"type": "array",
"items": {
"type": "object",
"required": ["sku", "quantity", "unit_price"],
"properties": {
"sku": {
"type": "string",
"minLength": 1,
"pattern": "^[^-][a-zA-Z0-9_%-]+$"
},
"base_name": {"type": "string"},
"product_name": {"type": "string"},
"category": {
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"required": ["id", "name" ],
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"url": { "type": "string" },
"image_url": { "type": "string" }
}
}
]
}
},
"quantity": { "type": "integer" },
"unit_price": { "type": "number" },
"variations": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "value"],
"properties": {
"name": {"type": "string"},
"value": {"type": "string"}
}
}
},
"specifications": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "value"],
"properties": {
"name": { "type": "string" },
"value": { "type": "string" }
}
}
},
"brand": {"type": "string"},
"description": {"type": "string"},
"url": {"type": "string"},
"image_url": {"type": "string"},
"thumbnail_url": {"type": "string"},
"stock": {"type": "number"},
"available": {"type": "boolean"},
"manufacturer_warranty_date": {"type": "date"},
"extension_warranty_date": {"type": "date"},
"with_extension_warranty": {"type": "boolean"},
"custom_attributes": { "type": "object" }
}
}
},
"prices": {
"type": "object",
"required": ["total"],
"properties": {
"cost": { "type": "number" },
"shipping": { "type": "number" },
"gross": { "type": "number" },
"tax": { "type": "number" },
"discount": { "type": "number" },
"total": { "type": "number" }
}
},
"payment": {
"oneOf": [
{
"type": "object",
"required": ["type"],
"properties": {
"type": { "type": "string",
"enum": ['credit', 'debit', 'cash', 'mercadopago', 'other']
},
"brand": { "type": "string" },
"bank": { "type": "string" },
"total": { "type": "float" },
"installments": { "type": "integer" },
"card_first_digits": { "type": "string", "pattern": "^[0-9]{6}$" }
}
},
{
"type": "array",
"items": {
"type": "object",
"required": ["type","total"],
"properties": {
"type": { "type": "string",
"enum": ['credit', 'debit', 'cash', 'mercadopago', 'other']
},
"brand": { "type": "string" },
"bank": { "type": "string" },
"total": { "type": "float" },
"installments": { "type": "integer" },
"card_first_digits": { "type": "string", "pattern": "^[0-9]{6}$" }
}
}
}
]
},
"branch_name": { "type": "string" },
"seller": {
"type": "object",
"required": ["name", "email"],
"properties": {
"name": { "type": "string"},
"email": { "type": "string", "format": "email" },
"external_id": { "type": "string" }
}
},
"createtime": { "type": "string" },
"approvedtime": { "type": "string" },
"metadata": { "type": "object" },
"custom_attributes": { "type": "object" }
}
}POST /purchases/bulk
PUT /purchases
GET /purchases
GET /purchases/iin/{firstSixDigits}
Example
Response
Errors
Delete purchase
Request Body
Name
Type
Description
Delete purchases (bulk)
Request Body
Name
Type
Description

Last updated
Was this helpful?