Este método simula a acción de crear un pago de una nueva gitfcard en app.agendapro. La giftcard puede tener las siguientes variaciones:
- 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, 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.
Body examples
#Giftcard:
- Canjeable por portador
- Sin descuento
- Con vigencia restringida (vencimiento)
{
"transactions": [
{
"payment_method": "cash",
"payment_method_type": "",
"transaction_number": 4839,
"amount": 25000
}
],
"receipt_number": "45454544",
"notes": "Prueba giftcard",
"client_id": 165424,
"payment_date": "2022-01-21",
"location_id": 1398,
"receipts": [
{
"items": [
{
"item_type": "payment_giftcard",
"list_price": 25000,
#aquí indicamos la restricción sobre el canje:
"to_the_carrier": false,
"comments": "giftcard $25.000",
"credit_amount": 25000,
#aquí indicamos la vigencia de la giftcard:
"start_date": "Fri, 21 Jan 2022 10:00:00 UTC +00:00",
"end_date": "Sun, 20 Feb 2022 10:00:00 UTC +00:00",
"location_id": 1398,
"seller_id": 3765,
"seller_type": 0,
"client_id": 165424
}
],
"receipt_type": "giftcard"
}
]
}
#Giftcard:
- Canjeable solo por el comprador
- Sin descuento
- Con vigencia restringida (vencimiento)
{
"transactions": [
{
"payment_method": "cash",
"payment_method_type": "",
"transaction_number": 4839,
"amount": 25000
}
],
"receipt_number": "45454544",
"notes": "Prueba giftcard",
"client_id": 165424,
"payment_date": "2022-01-21",
"location_id": 1398,
"receipts": [
{
"items": [
{
"item_type": "payment_giftcard",
"list_price": 25000,
"to_the_carrier": true,
"comments": "giftcard $25.000",
"credit_amount": 25000,
"start_date": "Fri, 21 Jan 2022 10:00:00 UTC +00:00",
"end_date": "Sun, 20 Feb 2022 10:00:00 UTC +00:00",
"location_id": 1398,
"seller_id": 3765,
"seller_type": 0,
"client_id": 165424
}
],
"receipt_type": "giftcard"
}
]
}
#Giftcard:
- Canjeable por portador
- Sin descuento
- Sin restricción de vigencia
{
"transactions": [
{
"payment_method": "cash",
"payment_method_type": "",
"transaction_number": 4839,
"amount": 25000
}
],
"receipt_number": "45454544",
"notes": "Prueba giftcard",
"client_id": 165424,
"payment_date": "2022-01-21",
"location_id": 1398,
"receipts": [
{
"items": [
{
"item_type": "payment_giftcard",
"list_price": 25000,
"to_the_carrier": true,
"comments": "giftcard $25.000",
"credit_amount": 25000,
"start_date": "Fri, 21 Jan 2022 10:00:00 UTC +00:00",
"location_id": 1398,
"seller_id": 3765,
"seller_type": 0,
"client_id": 165424
}
],
"receipt_type": "giftcard"
}
]
}
#Giftcard:
- Canjeable por portador
- Con descuento 10%
- Sin restricción de vigencia
{
"transactions": [
{
"payment_method": "cash",
"payment_method_type": "",
"transaction_number": 4839,
"amount": 22500
}
],
"receipt_number": "45454544",
"notes": "Prueba giftcard",
"client_id": 165424,
"payment_date": "2022-01-21",
"location_id": 1398,
"receipts": [
{
"items": [
{
"item_type": "payment_giftcard",
"list_price": 25000,
"to_the_carrier": true,
"comments": "giftcard $25.000",
"credit_amount": 25000,
"start_date": "Fri, 21 Jan 2022 10:00:00 UTC +00:00",
"location_id": 1398,
"seller_id": 3765,
"seller_type": 0,
"client_id": 165424,
#discount_type {1=%, 2=monto fijo)
"discount_type":1,
"discount":10
}
],
"receipt_type": "giftcard"
}
]
}
Responses examples
#Giftcard:
- Canjeable por portador
- Sin descuento
- Con vigencia restringida (vencimiento)
{
"id": 3856,
"payment_date": "2022-01-21T00:00:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 25000.0,
"paid_amount": 25000.0,
"change_amount": 0.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "first name",
"last_name": "las name",
"email": "[email protected]",
"identification_number": "32133..21",
"phone": "+56 9 34...9",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [],
"mock_bookings": [],
"memberships": [],
"giftcards": [
{
"id": 204,
"to_the_carrier": false,
"comments": "giftcard $25.000",
"credit_amount": 25000.0,
"credit_amount_remaining": 25000.0,
"giftcard_id": null,
"price": 25000.0,
"list_price": 25000.0,
"discount": 0.0,
"discount_type": null,
"start_date": "2022-01-21T10:00:00.000Z",
"end_date": "2022-02-20T10:00:00.000Z",
"location_id": 1398,
"payment_id": 3856,
"client_id": 165424,
#está es la clave que el cliente debe indicar para canjear su giftcard
"giftcard_code": "28FEFF00",
"active": true,
"receipt_id": 4252,
"seller_details": "seller_name"
}
],
"down_payments": [
{
"payment_transactions": [
{
"number": "4839",
"amount": 25000.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4252,
"amount": 25000.0,
"date": "2022-01-21",
"number": null,
"receipt_type": "Comprobante ingreso Gift card"
}
]
}
{
"id": 3857,
"payment_date": "2022-01-21T00:00:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 25000.0,
"paid_amount": 25000.0,
"change_amount": 0.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "first name",
"last_name": "last name",
"email": "[email protected]",
"identification_number": "18...5",
"phone": "+56 ....9",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [],
"mock_bookings": [],
"memberships": [],
"giftcards": [
{
"id": 205,
"to_the_carrier": true,
"comments": "giftcard $25.000",
"credit_amount": 25000.0,
"credit_amount_remaining": 25000.0,
"giftcard_id": null,
"price": 25000.0,
"list_price": 25000.0,
"discount": 0.0,
"discount_type": null,
"start_date": "2022-01-21T10:00:00.000Z",
"end_date": "2022-02-20T10:00:00.000Z",
"location_id": 1398,
"payment_id": 3857,
"client_id": null,
"giftcard_code": "42F3F66E",
"active": true,
"receipt_id": 4253,
"seller_details": "seller name"
}
],
"down_payments": [
{
"payment_transactions": [
{
"number": "4839",
"amount": 25000.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4253,
"amount": 25000.0,
"date": "2022-01-21",
"number": null,
"receipt_type": "Comprobante ingreso Gift card"
}
]
}
{
"id": 3859,
"payment_date": "2022-01-21T00:00:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 25000.0,
"paid_amount": 25000.0,
"change_amount": 0.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "first name",
"last_name": last name",
"email": "[email protected]",
"identification_number": "18...5",
"phone": "+56...9",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [],
"mock_bookings": [],
"memberships": [],
"giftcards": [
{
"id": 207,
"to_the_carrier": true,
"comments": "giftcard $25.000",
"credit_amount": 25000.0,
"credit_amount_remaining": 25000.0,
"giftcard_id": null,
"price": 25000.0,
"list_price": 25000.0,
"discount": 0.0,
"discount_type": null,
"start_date": "2022-01-21T10:00:00.000Z",
"end_date": null,
"location_id": 1398,
"payment_id": 3859,
"client_id": null,
"giftcard_code": "DD567557",
"active": true,
"receipt_id": 4255,
"seller_details": "Cuenta prueba"
}
],
"down_payments": [
{
"payment_transactions": [
{
"number": "4839",
"amount": 25000.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4255,
"amount": 25000.0,
"date": "2022-01-21",
"number": null,
"receipt_type": "Comprobante ingreso Gift card"
}
]
}
{
"id": 3864,
"payment_date": "2022-01-21T00:00:00.000Z",
"location_id": 1398,
"location_name": "Local 1",
"amount": 22500.0,
"paid_amount": 22500.0,
"change_amount": 0.0,
"employee_code_id": null,
"employee_code_name": "",
"client": {
"id": 165424,
"first_name": "first name",
"last_name": "last name",
"email": "[email protected]",
"identification_number": "4....5",
"phone": "+56...9",
"second_phone": "",
"age": 28,
"birth_day": 4,
"birth_month": 10,
"birth_year": 1993,
"record_number": "",
"address": "apoquindo",
"district": "las condes",
"city": "santiago"
},
"bookings": [],
"products": [],
"mock_bookings": [],
"memberships": [],
"giftcards": [
{
"id": 210,
"to_the_carrier": true,
"comments": "giftcard $25.000",
#amount se mantiene en el precio de lista, pero el monto pagado tiene 10% de dcto.
"credit_amount": 25000.0,
"credit_amount_remaining": 25000.0,
"giftcard_id": null,
"price": 22500.0,
"list_price": 25000.0,
"discount": 10.0,
"discount_type": 1,
"start_date": "2022-01-21T10:00:00.000Z",
"end_date": null,
"location_id": 1398,
"payment_id": 3864,
"client_id": null,
"giftcard_code": "3190C6FB",
"active": true,
"receipt_id": 4260,
"seller_details": "Cuenta prueba"
}
],
"down_payments": [
{
"payment_transactions": [
{
"number": "4839",
"amount": 22500.0,
"installments": 0,
"payment_method": "Efectivo",
"payment_method_type": "",
"bank": ""
}
]
}
],
"receipts": [
{
"id": 4260,
"amount": 22500.0,
"date": "2022-01-21",
"number": null,
"receipt_type": "Comprobante ingreso Gift card"
}
]
}