Este método simula a acción de crear un pago de un *producto en app.agendapro. El producto debe existir previamente en el inventario gestionado en agendapro, también contar con inventario para las sucursales a las que se asociará la venta.
- Uso restringido al comprador / Sin restricción, al portador
- Con descuento / Sin descuento
- Con vencimiento / Sin vencimiento
En caso de que se requiera, es posible crear pagos de distintos items en una misma llamada agregando más receipts.items con la estructura correspondiente de cada uno (new_service, giftcard, productos, otros).
Se debe tener en consideración que existen distintos tipos de receipts (boleta, factura, boleta de servicios, comprobante de giftcard y otros) y los receipt.items pueden agruparse en un solo receipt o dividirse en distintos tipos de receipts según se requiera.
Recomendamos visitar la página "Crear Pagos" para obtener información en detalle de los parámetros y sus tipos. Esta página será una buena referencia de la estructura de información.
Body examples
// Caso de pago de 1 producto
//1 transaction - 1 payment - 1 item - 1 receipt
{
"transactions":
[
{
"payment_method":"cash",
"payment_method_type":"other",
"transaction_number":"999",
"amount":30500.0
}
],
"receipt_number":"111",
"notes":"Venta de productos",
"client_id":165424,
"payment_date":"2022-02-09T12:52:00.000Z",
"location_id":1398,
"receipts":[
{
"items":
[
{
"item_type":"product",
"list_price":3500.0,
"price":3500.0,
"location_id":1398,
"seller_id":3765,
"seller_type":0,
"client_id":165424,
"product_id":3513,
"quantity":1
}
],
"receipt_type":"other"
}
]
}
// Caso de pago de 2 productos
// 2 transactions - 1 payment - 2 item - 2 receipts
// Con descuento en el segundo producto
{
"transactions":
[
{
"payment_method":"cash",
"payment_method_type":"other",
"transaction_number":"999",
"amount":3500
},
{
"payment_method":"check",
"payment_method_type":"other",
"transaction_number":"998",
"amount":27000
}
],
"receipt_number":"112",
"notes":"2 transactions 2 receipt type",
"client_id":165424,
"payment_date":"2022-02-09T12:52:00.000Z",
"location_id":1398,
"receipts":[
{
"items":
[
{
"item_type":"product",
"list_price":3500,
"price":3500.0,
"location_id":1398,
"seller_id":3765,
"seller_type":0,
"client_id":165424,
"product_id":3513,
"quantity":1
}
],
"receipt_type":"receipt"
},
{
"items":
[
{
"item_type":"product",
"list_price":3000,
"price":2700.0,
"location_id":1398,
"seller_id":3765,
"seller_type":0,
"client_id":165424,
"product_id":3514,
"quantity":10,
"discount_type":1,
"discount":10
}
],
"receipt_type":"invoice"
}
]
}
// Caso de pago de 1 producto y 1 giftcard
// 2 transactions - 1 payment - 2 item - 2 receipts
{
"transactions":
[
{
"payment_method":"cash",
"payment_method_type":"other",
"transaction_number":"1001",
"amount":3500
},
{
"payment_method":"check",
"payment_method_type":"other",
"transaction_number":"1000",
"amount":27000
}
],
"receipt_number":"112",
"notes":"2 transactions 2 receipt type",
"client_id":165424,
"payment_date":"2022-02-09T12:30:00.000Z",
"location_id":1398,
"receipts":[
{
"items":
[
{
"item_type":"product",
"list_price":3500,
"price":3500.0,
"location_id":1398,
"seller_id":3765,
"seller_type":0,
"client_id":165424,
"product_id":3513,
"quantity":1
}
],
"receipt_type":"receipt"
},
{
"items": [
{
"item_type": "payment_giftcard",
"list_price": 27000,
"to_the_carrier": true,
"comments": "giftcard $27.000",
"credit_amount": 27000,
"start_date": "2022-02-09",
"location_id": 1398,
"seller_id": 3765,
"seller_type": 0,
"client_id": 165424,
"discount_type":0,
"discount":0
}
],
"receipt_type": "giftcard"
}
]
}
Responses examples
{
"id": 4146,
"payment_date": "2022-02-09T12:52:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 3500.0,
"paid_amount": 30500.0,
"change_amount": 27000.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "MACARENA",
"last_name": "PRUEBA-API",
"email": "[email protected]",
"identification_number": "18...5",
"phone": "+56 9...49",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [
{
"price": 3500.0,
"discount": null,
"quantity": 1,
"product": "Shampoo 300ml",
"product_brand": "Pantene",
"product_display": "Botella",
"product_category": "Pelo",
"product_price": 3500.0,
"receipt_id": 4594,
"seller_details": "Cuenta prueba (prestador)"
}
],
"mock_bookings": [],
"memberships": [],
"giftcards": [],
"down_payments": [
{
"payment_transactions": [
{
"number": "999",
"amount": 30500.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4594,
"amount": 3500.0,
"date": "2022-02-09",
"number": "111",
"receipt_type": "Otro"
}
]
}
{
"id": 4136,
"payment_date": "2022-02-09T12:52:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 30500.0,
"paid_amount": 30500.0,
"change_amount": 0.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "MACARENA",
"last_name": "PRUEBA-API",
"email": "[email protected]",
"identification_number": "18.616.505-5",
"phone": "+56 9 3420 3549",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [
{
"price": 3500.0,
"discount": null,
"quantity": 1,
"product": "Shampoo 300ml",
"product_brand": "Pantene",
"product_display": "Botella",
"product_category": "Pelo",
"product_price": 3500.0,
"receipt_id": 4580,
"seller_details": "Cuenta prueba (prestador)"
},
{
"price": 2700.0,
"discount": 10.0,
"quantity": 10,
"product": "Acondicionador",
"product_brand": "Pantene",
"product_display": "Botella",
"product_category": "Pelo",
"product_price": 3000.0,
"receipt_id": 4581,
"seller_details": "Cuenta prueba (prestador)"
}
],
"mock_bookings": [],
"memberships": [],
"giftcards": [],
"down_payments": [
{
"payment_transactions": [
{
"number": "999",
"amount": 3500.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
},
{
"number": "998",
"amount": 27000.0,
"installments": 0,
"payment_method": "Cheque",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4580,
"amount": 3500.0,
"date": "2022-02-09",
"number": "112",
"receipt_type": "Boleta"
},
{
"id": 4581,
"amount": 27000.0,
"date": "2022-02-09",
"number": "112",
"receipt_type": "Factura"
}
]
}
{
"id": 4139,
"payment_date": "2022-02-09T12:30:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 30500.0,
"paid_amount": 30500.0,
"change_amount": 0.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "MACARENA",
"last_name": "PRUEBA-API",
"email": "[email protected]",
"identification_number": "18.616.505-5",
"phone": "+56 9 3420 3549",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [
{
"price": 3500.0,
"discount": null,
"quantity": 1,
"product": "Shampoo 300ml",
"product_brand": "Pantene",
"product_display": "Botella",
"product_category": "Pelo",
"product_price": 3500.0,
"receipt_id": 4585,
"seller_details": "Cuenta prueba (prestador)"
}
],
"mock_bookings": [],
"memberships": [],
"giftcards": [
{
"id": 214,
"to_the_carrier": true,
"comments": "giftcard $27.000",
"credit_amount": 27000.0,
"credit_amount_remaining": 27000.0,
"giftcard_id": null,
"price": 27000.0,
"list_price": 27000.0,
"discount": 0.0,
"discount_type": 0,
"start_date": "2022-02-09T00:00:00.000Z",
"end_date": null,
"location_id": 1398,
"payment_id": 4139,
"client_id": null,
"giftcard_code": "7740609E",
"active": true,
"receipt_id": 4586,
"seller_details": "Cuenta prueba"
}
],
"down_payments": [
{
"payment_transactions": [
{
"number": "1001",
"amount": 3500.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
},
{
"number": "1000",
"amount": 27000.0,
"installments": 0,
"payment_method": "Cheque",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4585,
"amount": 3500.0,
"date": "2022-02-09",
"number": "112",
"receipt_type": "Boleta"
},
{
"id": 4586,
"amount": 27000.0,
"date": "2022-02-09",
"number": "112",
"receipt_type": "Comprobante ingreso Gift card"
}
]
}