Ventas

Gestiona las ventas de tu negocio, emite ventas con factura electrónica o boleta electrónica, accede a las ventas por rango de fecha, estado, etc. Soporta ventas del e-Commerce.

Listar ventas

GET https://demo.simplefact.pe/v1/sales/orders

Obtiene las ventas realizadas con el comprobante asociado, por rango de fecha.

Query Parameters

NameTypeDescription

shortdate

string

Filtrar por rango de fecha predeterminado ejemplo: today : ventas de hoyyesterday : ventas de ayer, month past_month ...

to

string

Rango fecha de fin

pageSize

number

Numero de resultados a mostrar, valor por defecto 10.

from

string

Rango fecha de inicio

Headers

NameTypeDescription

Authentication

string

Authentication token para acceder al recurso, el token es proporcionado por SimpleFact. Ejemplo: Bearer Token

{
   "data":[
      {
         "id":409,
         "invoice_type_name":"Factura de Venta Electr\u00f3nica",
         "invoice_type":"01",
         "invoice_type_name_short":"F",
         "serie":"F001",
         "correlative":"141",
         "customer_name":"ACR TECHNOLGIES SAC",
         "status":"processing",
         "tax_total":"6101.69",
         "total":"40000.00",
         "date":"2020-05-06T23:27:59.000000Z",
         "date_formatted":"06\/05\/2020 18:27",
         "due_date":"-",
         "currency":"PEN",
         "currency_symbol":"S\/",
         "xml_url":"https:\/\/demo.simplefact.pe\/app\/download\/invoices\/20601643316-01-F001-141.xml",
         "pdf_url":"https:\/\/demo.simplefact.pe\/app\/download\/invoices\/20601643316-01-F001-141.pdf",
         "bill":{
            "id":276,
            "created_at":"2020-05-06 18:28:00",
            "accepted_at":"2020-05-06 18:28:00",
            "error":null,
            "message":"La Factura numero F001-141, ha sido aceptada",
            "order_id":409,
            "cdr_url":"https:\/\/demo.simplefact.pe\/app\/download\/invoices\/R-20601643316-01-F001-141.zip",
            "status":"accepted"
         },
         "void":null,
         "notes":null,
         "customer":{
            "id":2,
            "name":"ACR TECHNOLGIES SAC",
            "email":"acr@gmail.com",
            "phone":null,
            "status":"active",
            "is_company":false
         },
         "items": [],
         "origin":"api",
         "payment_method":"cash",
         "payment_status":"paid",
         "created_at_formatted":"06\/05\/2020 18:27"
      }
   ],
   "links":{
      "first":"https:\/\/demo.simplefact.pe\/api\/v1\/sales\/orders?page=1",
      "last":"https:\/\/demo.simplefact.pe\/api\/v1\/sales\/orders?page=237",
      "prev":null,
      "next":"https:\/\/demo.simplefact.pe\/api\/v1\/sales\/orders?page=2"
   },
   "meta":{
      "current_page":1,
      "from":1,
      "last_page":237,
      "path":"https:\/\/demo.simplefact.pe\/api\/v1\/sales\/orders",
      "per_page":"1",
      "to":1,
      "total":237
   }
}

Detalle de una venta

GET https://demo.simplefact.pe/v1/sales/orders/:id

Muestra información de una venta y comprobante

Path Parameters

NameTypeDescription

id

string

ID de la venta

Headers

NameTypeDescription

Authorization

string

Bearer token

{
    "success": true,
    "data": {
        "id": 407,
        "invoice_type": "03",
        "invoice_type_name": "Boleta de Venta Electr\u00f3nica",
        "invoice_number": "B001-97",
        "serie": "B001",
        "correlative": "97",
        "customer": {
           
        },
        "customer_name": "Juan Perez",
        "customer_document_type": "1",
        "customer_document_number": "00000000",
        "customer_document": "DNI",
        "status": "processing",
        "tax_total": "98.24",
        "total": "644.00",
        "date": "2020-04-30T23:14:15.000000Z",
        "date_formatted": "30\/04\/2020 18:14 PM",
        "due_date": "30\/04\/2020",
        "currency": "PEN",
        "currency_symbol": "S\/",
        "items": [
            {
                "id": 2200,
                "order_id": 407,
                "product_id": 2,
                "code": "A001",
                "unity": "NIU",
                "name": "iPhone X",
                "tax_apply_code": "10",
                "qty": "1.00",
                "unit_amount_cost": "33.05",
                "has_discount": 0,
                "discount_base": "0.00",
                "discount_percent": "0.00",
                "discount_amount": "0.00",
                "amount_cost": "33.05",
                "base_amount": "33.05",
                "tax_percent": "18.00",
                "tax": "5.95",
                "tax_total": "5.95",
                "unit_amount_price": "39.00"
            },
            {
                "id": 2201,
                "order_id": 407,
                "product_id": 3,
                "code": "P001",
                "unity": "NIU",
                "name": "Televisor Samsung 20",
                "tax_apply_code": "10",
                "qty": "1.00",
                "unit_amount_cost": "29.66",
                "has_discount": 0,
                "discount_base": "0.00",
                "discount_percent": "0.00",
                "discount_amount": "0.00",
                "amount_cost": "29.66",
                "base_amount": "29.66",
                "tax_percent": "18.00",
                "tax": "5.34",
                "tax_total": "5.34",
                "unit_amount_price": "35.00"
            },
           
        ],
        "xml_url": "https:\/\/demo.simplefact.pe\/cdn\/ZXlKcGRpSTZJamRsZVVkelVHWkJhRElyZUZOSWNsZHZWSGhOYlVFOVBTSXNJblpoYkhWbElqb2ljSGhtUkdSMFNVcG9SRWRQTVd0Mk9FWTVkMVpDY3pGNGFYZFZkREZyUW5jNWIzQm5kRlZOYTFSeGVXaERUREo1YmtSNlp6bGxaR2gwZUdVM2FFcDVTU0lzSW0xaFl5STZJak0zTURRelpUWTBPV0UxWm1RM1ptRTJOVGRrWVRJM1pERmlaakU1T1RWaE5XSTJZbUprTTJVNE56ZGpNVFV5WW1abVpqVXlOelk1TnpGbE1qRXlZV1lpZlE9PQ==",
        "pdf_url": "https:\/\/demo.simplefact.pe\/cdn\/ZXlKcGRpSTZJalpIVVVsdFFsbE5kVEp3VGxCcU5YRkdXV05zYVVFOVBTSXNJblpoYkhWbElqb2liME5vTkhVMVVuWTBSMGRSVUNzNFlWSnZRVWxpYUhoR2MwTjZNalZ4Um1OelJGTldVRU5rTVROVlZIWm9NazkzZURkUVNtWkNObUl4Y0c0elVVTmtSeUlzSW0xaFl5STZJbVEzWm1ZNFpUVmtaak5pTWpka01qbG1ZVEV6TVRBMVpUZGxaV0ppTUdNeU4yWXpZV1kzT1dKbU1qUTNPRFE1TmpNNVpXWmlNVEl5TnpBeVl6ZGtaRElpZlE9PQ==",
        "pdf_url_show": false,
        "taxed_operation": "545.76",
        "unaffected_operation": "0.00",
        "exonerated_operation": "0.00",
        "free_operation": "0.00",
        "total_discount": "0.00",
        "notes": null,
        "origin": "api",
        "address": {
            "shipping": [],
            "billing": []
        },
        "metadata": null,
        "document_type_name": "DNI",
        "payment_method": "cash",
        "payment_status": "paid",
        "bill": {
            "id": 275,
            "order_id": 407,
            "xml_path": "invoices\/20601643316-03-B001-97.xml",
            "cdr_path": null,
            "pdf_path": "invoices\/20601643316-03-B001-97.pdf",
            "status": "pending",
            "error": null,
            "message": "Listo para enviar en el Resumen Diario de Boletas",
            "accepted_at": null,
            "created_at": "2020-04-30 18:14:16",
            "updated_at": "2020-04-30 18:14:16",
            "ticket": null
        },
        "transporter": null
    }
}

Anular una venta

POST https://demo.simplefact.pe/v1/sales/orders/:id/cancel

Anula la venta en SimpleFact® y anula comprobante de pago por SUNAT mediante el método baja de comprobante.

Path Parameters

NameTypeDescription

id

number

Id de la venta

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

NameTypeDescription

reason

string

Motivo de anulación

{
    "success": true, 
    "message": "Anulado correctamente",
    "data": {} //Order Resource
    
}

Crear una venta (Factura y Boleta, Nota de venta)

POST https://demo.simplefact.pe/v1/sales/orders

Este método permite realizar un venta con un comprobante electrónico ya sea boleta o factura.

Request Body

NameTypeDescription

items

array

[

{

"code": "SKU-411",

"name": "FUNDA PARA IPHONE 13",

"qty": 2,

"price": 200, "tax_percent": 18 }

]

currency

string

Moneda por defecto PEN

total

number

Total incluido impuestos

discount

number

Descuento

tax_total

number

Total impuestos

subtotal

number

Subtotal sin impuestos

due_date

string

Fecha de vencimiento

date

string

Fecha de emisión del comprobante en formato ISO

invoice_type

string

01 Factura , 03 Boleta, nv = Nota de venta

customer_address

string

Dirección del cliente

customer_document_number

string

Numero de documento

customer_document_type

number

Tipo de documento 6: RUC 1: DNI

customer_name

string

Nombre del cliente o razón social

notes

string

Notas u observaciones

email_send

boolean

Especifica si se enviara un correo al cliente de forma automática con la factura en PDF y XML.

customer_email

string

Email del cliente

customer_phone

String

Celular del cliente

{
    "success": true,
    "data": {
        "id": 407,
        "invoice_type": "03",
        "invoice_type_name": "Boleta de Venta Electr\u00f3nica",
        "invoice_number": "B001-97",
        "serie": "B001",
        "correlative": "97",
        "customer": {
           
        },
        "customer_name": "Juan Perez",
        "customer_document_type": "1",
        "customer_document_number": "00000000",
        "customer_document": "DNI",
        "status": "processing",
        "tax_total": "98.24",
        "total": "644.00",
        "date": "2020-04-30T23:14:15.000000Z",
        "date_formatted": "30\/04\/2020 18:14 PM",
        "due_date": "30\/04\/2020",
        "currency": "PEN",
        "currency_symbol": "S\/",
        "items": [
            {
                "id": 2200,
                "order_id": 407,
                "product_id": 2,
                "code": "A001",
                "unity": "NIU",
                "name": "Producto 1",
                "tax_apply_code": "10",
                "qty": "1.00",
                "unit_amount_cost": "33.05",
                "has_discount": 0,
                "discount_base": "0.00",
                "discount_percent": "0.00",
                "discount_amount": "0.00",
                "amount_cost": "33.05",
                "base_amount": "33.05",
                "tax_percent": "18.00",
                "tax": "5.95",
                "tax_total": "5.95",
                "unit_amount_price": "39.00"
            },

            {
                "id": 2204,
                "order_id": 407,
                "product_id": 34,
                "code": "E001",
                "unity": "ZZ",
                "name": "Producto 2",
                "tax_apply_code": "10",
                "qty": "1.00",
                "unit_amount_cost": "4.24",
                "has_discount": 0,
                "discount_base": "0.00",
                "discount_percent": "0.00",
                "discount_amount": "0.00",
                "amount_cost": "4.24",
                "base_amount": "4.24",
                "tax_percent": "18.00",
                "tax": "0.76",
                "tax_total": "0.76",
                "unit_amount_price": "5.00"
            }
        ],
        "xml_url": "https:\/\/demo.simplefact.pe\/cdn\/ZXlKcGRpSTZJamRselVHWkJhRElyZUZOSWNsZHZWSGhOYlVFOVBTSXNJblpoYkhWbElqb2ljSGhtUkdSMFNVcG9SRWRQTVd0Mk9FWTVkMVpDY3pGNGFYZFZkREZyUW5jNWIzQm5kRlZOYTFSeGVXaERUREo1YmtSNlp6bGxaR2gwZUdVM2FFcDVTU0lzSW0xaFl5STZJak0zTURRelpUWTBPV0UxWm1RM1ptRTJOVGRrWVRJM1pERmlaakU1T1RWaE5XSTJZbUprTTJVNE56ZGpNVFV5WW1abVpqVXlOelk1TnpGbE1qRXlZV1lpZlE9PQ==",
        "pdf_url": "https:\/\/demo.simplefact.pe\/cdn\/ZXlKcGRpE5kVEp3VGxCcU5YRkdXV05zYVVFOVBTSXNJblpoYkhWbElqb2liME5vTkhVMVVuWTBSMGRSVUNzNFlWSnZRVWxpYUhoR2MwTjZNalZ4Um1OelJGTldVRU5rTVROVlZIWm9NazkzZURkUVNtWkNObUl4Y0c0elVVTmtSeUlzSW0xaFl5STZJbVEzWm1ZNFpUVmtaak5pTWpka01qbG1ZVEV6TVRBMVpUZGxaV0ppTUdNeU4yWXpZV1kzT1dKbU1qUTNPRFE1TmpNNVpXWmlNVEl5TnpBeVl6ZGtaRElpZlE9PQ==",
        "pdf_url_show": false,
        "taxed_operation": "545.76",
        "unaffected_operation": "0.00",
        "exonerated_operation": "0.00",
        "free_operation": "0.00",
        "total_discount": "0.00",
        "notes": null,
        "origin": "api",
        "address": {
            "shipping": [],
            "billing": []
        },
        "metadata": null,
        "document_type_name": "DNI",
        "payment_method": "cash",
        "payment_status": "paid",
        "bill": {
            "id": 275,
            "order_id": 407,
            "xml_path": "invoices\/20601643316-03-B001-97.xml",
            "cdr_path": null,
            "pdf_path": "invoices\/20601643316-03-B001-97.pdf",
            "status": "success",
            "error": null,
            "message": "Enviado a SUNAT",
            "accepted_at": null,
            "created_at": "2020-04-30 18:14:16",
            "updated_at": "2020-04-30 18:14:16",
            "ticket": null
        },
        "transporter": null
    }
}

Actualizar Stock

PATCH https://demo.simplefact.pe/v1/sales/orders/id/stock

Path Parameters

NameTypeDescription

id

number

ID del producto

Request Body

NameTypeDescription

reason

string

Descripción de la operación

qty

number

Cantidad en negativo o positivo

Última actualización