Postman
Postman
  • Documentación

    • Información general
    • Entornos
    • Primeros pasos
    • Listar CFDI's
    • Buscar CFDI
    • Crear CFDI 4.0
    • Crear CFDI Global 4.0
    • Borradores CFDI 4.0
    • Descargar CFDI
    • Cancelar CFDI 4.0
    • Descargar acuse CFDI 4.0
    • Enviar CFDI
    • Consultar estatus de cancelación de un CFDI
    • Eventos
    • Webhooks
    • Grupos de empleados
    • Empleados
    • Nóminas
    • Complementos
    • Retenciones
    • Complementos de retenciones
    • Carta porte v3.1
    • Comercio exterior v2.0
    • Catálogos
    • Clientes
    • Empresas
    • Migraciones
    • Series
    • Productos
    • Addendas

      • Introducción
      • ADO
      • Aduanero
      • Amazon
      • APR
      • Arteche North America
      • Asonioscoc
      • Asoprolimates
      • Basware
      • Calsonic Kansei
      • CENACE
      • City Fresko
      • Comentario
      • Costco
      • Custom (cambio de concepto)
      • Envases Universales de México (EUM)
      • Gunderson
      • Hapag-Lloyd
      • Herdez
      • Inbursa
      • Kuehne + Nagel
      • Lesaffre
      • Liverpool
      • Mabe
      • Nortech
      • NS (propina)
      • PepsiCo
      • Plastek
      • Proveedores
      • Sanmina
      • Sevisible
      • Sidel
      • Sintenovo
      • Soriana
      • Soriana simplificada
      • Thetodoonline
      • Tsubakimoto
      • Walmart
      • Whirlpool
    • Fundamentos legales del SAT

City Fresko

Asi podremos crear una addenda de City Fresko, con un ejemplo y la muestra de la respuesta al crearla.

Para crear nuestra addenda de City Fresko seran necesarios los siguientes parametros:

 Parametro Tipo Requerido Detalles
 Invoice String Requerido Es el identificador del CCFDI al cual se le agregara la addenda
 cityFresko Arreglo Requerido Es el arreglo principal de la addenda y contiene toda la informacion relacionada a esta
 requestForPayment Arreglo Requerido Es el arreglo que contiene la informacion del tipo de documento
 documentStatus String Requerido

 Indica el tipo de documento que generamos, puede ser:

ORIGINAL

DELETE

COPY

REEMPLAZA

 DeliveryDate String Requerido

 Se utiliza para indicar la fecha en la que se entrega el documento, utiliza el siguiente formato:

"2023-01-23"

 requestForPaymentIdentification Arreglo Requerido Es el arreglo que contiene la informacion que especcifica el tipo de transaccion
 entityType String Requerido

 Se utiliza para indicar el tipo de documento que se genero

ejemplo:

"INVOICE" para las Facturas

 uniqueCreatorIdentification String Requerido Lo utilizamos para ingresar un identificador para nuestro documento
 specialInstruction Arreglo Requerido Arreglo que contiene la informacion para señalar instrucciones especiales
 code String Requerido

 Pertenece a "specialInstruction" y se utilliza para indicar las condiciones para estas instrucciones, acepta las siguientes opciones:

"AAB" - Condiciones de pago

"DUT" - Informacion de impuestos (Pedimentos)

"PUR" - Informacion de compras

"ZZZ" - Importe con letra

 text String Requerido Pertenece a "specialInstruction" y se utiliza para ingresar la descripcion relacionada al codigo que creamos anteriormente
 orderIdentification Arreglo Requerido Es el arreglo que contiene la informacion que especifica
 referenceIdentification String Requerido Indica el numero de oden de compra(comprador) a la que hace referencia la factura
 ReferenceDate String Opcional

 Indica la feca de la orden de compra(comprador) a la que hace referencia la factura, utiliza el siguiente formato:

"2023-01-13"

 AdditionalInformation Arreglo Requerido Arreglo que contiene las referencias adicionales a nivel global de la factura
 referenceIdentification String Requerido Indica el numero de referencia global
 type String Requerido

 Es el tipo al que corresponde la referencia adicional de acuerdo al tipo de documento

 buyer Arreglo Requerido Es el arreglo que contiene la informacion correspondiente a el comprado
 gln String Requerido Dentro de buyer especifica el numero global de localizacion (GLN) del comprador
 text String Requerido Dentro de buyer especifica el nombre del contacto de compras
 seller Arreglo Requerido Es el arreglo que contiene la informacion correspondiente a el proveedor
 gln String Requerido Dentro de seller especifica el numero global de localizacion (GLN) del proveedor
 alternatePartyIdentification String Requerido Dentro de seller especifica el ccodigo para identificar que tipo de dentificacion secundaria se le asigno al proveedor
 type String Requerido Dentro de seller especifica el tipo a el que pertenece el proveedor
 shipTo Arreglo Requerido Es el arreglo que contiene la ubicacion donde debe realizarse la entrega de la mercancia
 gln String Requerido Dentro de shipTo especifica el numero global de localizacion (GLN) de la ubicacion a entregar la mercancia
 address Arreglo Opcional Dentro de shipTo es el arreglo que cotiene la informacion con el nombre y direccion de la ubicacion donde debe realizarse la entrega
 name String Opcional Dentro de address especifica la razon social de la empresa donde se va a embarcar en caso de ser diferente al comprado, o el nombre de la bodega o cento de distribucion
 streetAddressOne String Opcional Dentro de address especifica el domicilio a donde se embarcara la mercancia: Calle, numero exterior, numero interior y colonias
 city String Opcional Dentro de address especifiica la ciudad donde se encuentra el ddomicilio a donde se embarcara la mercancia
 postalCode String Opcional Dentro de address especifica el codigo postal del domicilio a donde se embarcara la mercancia
 currency Arreglo Requerido Es el arreglo que contiene la informacion relacionada al tipo de divisa utilizada
 currencyFunction String Requerido

 Dentro de currency especifica el uso de la divisa para el documento, admite los siguienntes valores:

"BILLING_CURRENCY"

"PRICE_CURRENCY"

"PAYMENT_CURRENCY"

 paymentTerms Arreglo Opcional Arreglo que contiene los terminos de pago de la factura
 paymentTermsEvent String Opcional

 Dentro de paymentTerms especifica como se realizara el evento del pago, admite los siguientes valores:

"DATE_OF_INVOICE"

"EFFECTIVE_DATE"

 PaymentTermsRelationTime String Opcional Dentro de paymentTerms especifica la relacion tiempo de los terminos de pago
 netPaymentTermsType String Opcional Dentro de paymentTerms especifica las condiciones de pago
 days String Opcional Dentro de paymentTerms especifica
 allowanceCharge Arreglo Opcional Arreglo que contiene la informacion de los cargos o descuentos globales mercantiles por factura
 settlementType String Opcional

 Dentro de allowanceCharge especifica la imputacion del descuento o cargo, dmite los siguienntes valores:

"BILL_BACK"
"OFF_INVOICE"

 allowanceChargeTypeString Opcional 

 Dentro de allowanceCharge indica el atributo de cargo o descuento, admite los siguientes valores:

"ALLOWANCE_GLOBAL"
"CHARGE_GLOBAL"

 specialServicesType String Opcional

 Dentro de allowanceCharge especifica el tipo de descuento o cargo este elemento se utiliza si el comprador conoce los descuentos,admite los siguientes valore:

“AA”, “AJ”, “ADO”, “ADT”, “ADS”, “ABZ”, “DA”, “EAA”, “EAB”, “PI”, “TAE”, “SAB”, “RAA”, “PAD”, “FG”, “FA”, “TD”, “TS”, “TX”, “TZ”, “ZZZ”, “VAB”, “UM”, “DI”, “CAC”, “COD”, “EAB”, “FC”, “FI”, “HD”, “QD”

 monetaryAmountOrPercentage Arreglo Opcional Aarreglo que contiene la informacion de la cantidad monetaria o porcentaje del descuento
 rate String Opcional Dentro de monetaryAmountOrPercentage este elemento especifica la tarifa
 percentage String  Opcional Dentro de monetaryAmountOrPercentage especifica el porcentaje de descuento que se esta aplicando segun se ha indicado en el campo anterior a toda la factura
 lineItems Arreglo Opcional Es el arreglo qu contiene la informacion de la linea de detalle de la factura
 type String Requerido dentro de lineItems especifica el tipo de linea de detalle
 number String Requerido Dentro de lineItems especifica el numero secuencial que se asigna a cada linea de detalle
 tradeItemIdentification String  Requerido Dentro de lineItems especifica la identificacion de cada articulo
 alternateTradeItemIdentification Arreglo Opcional Dentro de lineItems es el arreglo que contiene la informacion del numero de iddentificacion adicional para el articulo
 type String Requerido Dentro de alternateTradeItemIdentification es el atributo que especifica el tipo de identiificacion adicional
 value String Requerido Dentro de alternateTradeItemIdentification contiene el valor del indentificador adicional
 tradeItemDescriptionInformation Arreglo Opcional Dentro de lineItems es el arreglo que contiene la informacion de la descripcion del articulo
 language String Requerido

 Dentro de tradeItemDescriptionInformation es el atributo para especificar el ccodigo del idioma en que esta la descripcion del articulo, admite los siguientes valores

"ES"

"EN"

 longtext String Requerido Dentro de tradeItemDescriptionInformation es el atributo que especifica la descripcion del articulo solicitado
 invoicedQuantity String Requerido Dentro de lineItems especifica la cantidad facturada del producto en la linea de articulo actual
 unitOfMeasure String Requerido Dentro de lineItems especifica la unidad de medida, solo si el articulo es de unidad variable
 aditionalQuantity String Requerido Dentro de lineItems especifica la ccantiddad facturada del producto en la lina de articulo actual
 grossPrice String Requerido Dentro de lineItems especifica la declaracion del precio bruto
 netPrice String Requerido Dentro de lineItems especifica la declaracion del precio neto
 AdditionalInformation Arreglo Opcional Dentro de lineItems es el arreglo que contiene la informacion adicional de referencia en el detalle de productos
 referencceIdentification String Requerido Dentro de AdditionalInformation especifica la referencia adicional de los productos
 type String Requerido Dentro de AdditionalInformation especifica el tipo de referencia
 tradeItemTaxInformation Arreglo Opcional Dentro de lineItems es el arreglo que contiene la informacion de los impuestos por cadda linea de articulo
 taxTypeDescription String Requerio Dentro de tradeItemTaxInformation especifica el tipo dde arancel, impuesto o cutoa
 tradeItemTaxAmount Arreglo Opcional Dentro de tradeItemTaxInformation es el arreglo que contiene la informacion del importe o porcentaje del descuento
 taxPercentage String Requerido Dentro de tradeItemTaxAmount especifica el porcentaje del impuesto
 taxAmount String Requerido Dentro de tradeItemTaxAmount especifica el monto del impuesto
 totalLineAmount Arreglo Requerido Dentro de lineItems es el arreglo que contiene la informacion de los importes monetarios por linea de articulo
 grossAmount String Opccional Dentro de totalLineAmount especifica el importe bruto
 netAmount String Requerido Dentro de totalLineAmount specifica el importe neto
 totalAmount String Opcional Especifica el monto total de las lineas de articulos
 baseAmount String Requerido  Especifica el monto
 tax Arreglo Requerido Es el arreglo que contiene la informacion de de los impuestos aplicados a el documento
 type String Requerido Dentro de tax especifica el tipo de impuesto aplicado a el documento
 taxPercentage String Requerido Dentro de tax especifica el porcentaje del impuesto que se selecciono en el campo anterior
 taxAmount String Requerido Dentro de tax especifica el importe del impuesto basado en el porcentaje anterior
 taxCategory String  Requerido Dentro de tax especifica la categoria a la que pertenece el impuesto declarado
 payableAmount String Requerido Especifica el total pagable de la factura

Construcción de la URL

Importante

El método para agregar una addenda de es tipo POST

Host: https://facturaonline.com.mx/api (producción) / https://sandbox.facturaonline.com.mx/api (sandbox)

Endpoint: /v3/addenda/cityfresko/store

Ejemplo: https://facturaonline.com.mx/api/v3/addenda/cityfresko/store

Tip

Para probar el ejemplo de código, necesitas cambiar "Tu API key" por la clave de API de tu cuenta, y "Tu Secret key" por la clave secreta correspondiente.

Ejemplo de addenda de City Fresko
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{ HOST }/v3/addenda/cityfresko/store',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "invoice": "bef24401-05e6-4ccb-b3aa-4a0343f1c0a6",
    "cityFresko":{
       "requestForPayment": {
           "documentStatus": "ORIGINAL",
           "DeliveryDate": "2023-01-13"
       },
       "requestForPaymentIdentification": {
           "entityType": "INVOICE",
           "uniqueCreatorIdentification": "UNIQUEIDAAPI123"
       },
       "specialInstruction": [
           {
             "code": "AAB",
             "text": "PAGO A 5 DIAS"
           },
           {
             "code": "PUR",
             "text": "CLIENNTE FRECUENTE"
           },
           {
             "code": "DUT",
             "text": "IMPUESTOS RELACIONADOS"
           },
           {
             "code": "ZZZ",
             "text": "QUINIENTOS CINCUENTA Y CINCO"
           }
       ],
       "orderIdentification": {
           "referenceIdentification": "CUSTOMORDER API 12345",
           "ReferenceDate": "2023-01-13"
       },
       "AdditionalInformation": [
           {
               "referenceIdentification": "REFERENCIA NUMERO DDE FACTURA123",
               "type": "IV"
           },
           {
               "referenceIdentification": "REFERENCIA NUMERO DOC123",
               "type": "ACE"
           },
           {
               "referenceIdentification": "REFERENCIA CHEQUE123",
               "type": "CK"
           },
           {
               "referenceIdentification": "REFERENCIA PREDIAL123",
               "type": "AAE"
           }
       ],
       "buyer": {
           "gln": "BUYERGLN123456",
           "text": "LUIS QUINTERO"
       },
       "seller": {
           "gln": "SELLERGLN123456",
           "alternatePartyIdentification": "ALTPARTYIDD123",
           "type": "IEPS_REFERENCE"
       },
       "shipTo": {
           "gln": "GLNSHIPMENT1234",
           "address": {
               "name": "LUIS QUINTERO CO.",
               "streetAddressOne": "CALLE CORAL AZUL",
               "city": "GUADALAJARA",
               "postalCode": "44790"
           }
        },
        "currency": {
            "currencyFunction": "PRICE_CURRENCY"
        },
        "paymentTerms": {
            "paymentTermsEvent": "EFECTIVE_DATE",
            "PaymentTermsRelationTime": "REFERENCE_BEFORE",
            "netPaymentTermsType":"END_OF_MONTH",
            "days": "2"
        },
        "allowanceCharge": {
            "settlementType": "OFF_INVOICE",
            "allowanceChargeType": "ALLOWANCE_GLOBAL",
            "specialServicesType": "ZZZ",
            "monetaryAmountOrPercentage": {
                "rate": "INVOICE_VALUE",
                "percentage": "2345.67"
            }
        },
        "lineItems": [
            {
                "type": "SimpleInvoiceLineItemType",
                "number": "0",
                "tradeItemIdentification": "GTINPROD1",
                "alternateTradeItemIdentification": {
                    "type": "SUPPLIER_ASSIGNED",
                    "value": "NUMALTPROD1"
                },
                "tradeItemDescriptionInformation": {
                    "language": "ES",
                    "longText": "DESCRIPCION PRODUCTO 0"
                },
                "invoicedQuantity": "10",
                "unitOfMeasure": "1.0",
                "aditionalQuantity": "10",
                "grossPrice": "",
                "netPrice": "11.00",
                "AdditionalInformation": {
                    "referenceIdentification": "REFPROD1",
                    "type": "ON"
                },
                "tradeItemTaxInformation": {
                    "taxTypeDescription": "GST",
                    "tradeItemTaxAmount": {
                        "taxPercentage": "10.00",
                        "taxAmount": "1.00"
                    }
                },
                "totalLineAmount": {
                    "grossAmount": "100",
                    "netAmount": "110"
                }
            },
            {
                "type": "SimpleInvoiceLineItemType",
                "number": "2",
                "tradeItemIdentification": "GTINPROD1",
                "alternateTradeItemIdentification": {
                    "type": "SUPPLIER_ASSIGNED",
                    "value": "NUMALTPROD1"
                },
                "tradeItemDescriptionInformation": {
                    "language": "ES",
                    "longText": "DESCRIPCION PRODUCTO 1"
                },
                "invoicedQuantity": "10",
                "unitOfMeasure": "1.0",
                "aditionalQuantity": "",
                "grossPrice": "10.00",
                "netPrice": "",
                "AdditionalInformation": {
                    "referenceIdentification": "REFPROD1",
                    "type": "ON"
                },
                "tradeItemTaxInformation": {
                    "taxTypeDescription": "GST",
                    "tradeItemTaxAmount": {
                        "taxPercentage": "10.00",
                        "taxAmount": "1.00"
                    }
                },
                "totalLineAmount": {
                    "grossAmount": "100",
                    "netAmount": "110"
                }
            },
            {
                "type": "SimpleInvoiceLineItemType",
                "number": "3",
                "tradeItemIdentification": "GTINPROD2",
                "alternateTradeItemIdentification": {
                    "type": "BUYER_ASSIGNED",
                    "value": "NUMALTPROD2"
                },
                "tradeItemDescriptionInformation": {
                    "language": "EN",
                    "longText": "DESCRIPCION PRODUCTO 2"
                },
                "invoicedQuantity": "10",
                "unitOfMeasure": "2.0",
                "aditionalQuantity": "10",
                "grossPrice": "",
                "netPrice": "",
                "AdditionalInformation": {
                    "referenceIdentification": "REFPROD2",
                    "type": "ON"
                },
                "tradeItemTaxInformation": {
                    "taxTypeDescription": "VAT",
                    "tradeItemTaxAmount": {
                        "taxPercentage": "16.00",
                        "taxAmount": "3.20"
                    }
                },
                "totalLineAmount": {
                    "grossAmount": "200",
                    "netAmount": "232"
                }
            },
            {
                "type": "SimpleInvoiceLineItemType",
                "number": "4",
                "tradeItemIdentification": "GTINPROD3",
                "alternateTradeItemIdentification": {
                    "type": "123",
                    "value": "123"
                },
                "tradeItemDescriptionInformation": {
                    "language": "ES",
                    "longText": "DESCRIPCION PRODUCTO 3"
                },
                "invoicedQuantity": "10",
                "unitOfMeasure": "3.0",
                "aditionalQuantity": "10",
                "grossPrice": "0.00",
                "netPrice": "30.75",
                "AdditionalInformation": {
                    "referenceIdentification": "REFPROD3",
                    "type": "ON"
                },
                "tradeItemTaxInformation": {
                    "taxTypeDescription": "LAC",
                    "tradeItemTaxAmount": {
                        "taxPercentage": "02.50",
                        "taxAmount": "00.75"
                    }
                },
                "totalLineAmount": {
                    "grossAmount": "300",
                    "netAmount": "307.5"
                }
            },
            {
                "type": "SimpleInvoiceLineItemType",
                "number": "5",
                "tradeItemIdentification": "GTINPROD4",
                "alternateTradeItemIdentification": {
                    "type": "SUPPLIER_ASSIGNED",
                    "value": "NUMALTPROD4"
                },
                "tradeItemDescriptionInformation": {
                    "language": "EN",
                    "longText": "DESCRIPCION PRODUCTO 4"
                },
                "invoicedQuantity": "10",
                "unitOfMeasure": "4.0",
                "aditionalQuantity": "10",
                "grossPrice": "40.00",
                "netPrice": "44.80",
                "AdditionalInformation": {
                    "referenceIdentification": "REFPROD4",
                    "type": "ON"
                },
                "tradeItemTaxInformation": {
                    "taxTypeDescription": "AAA",
                    "tradeItemTaxAmount": {
                        "taxPercentage": "12.00",
                        "taxAmount": "48.00"
                    }
                },
                "totalLineAmount": {
                    "grossAmount": "400",
                    "netAmount": "448"
                }
            }
        ],
        "totalAmount": "1234567.89",
        "baseAmount": "123456.00",
        "tax": [ 
            {
                "type": "GST",
                "taxPercentage": "10",
                "taxAmount": "10",
                "taxCategory": "TRANSFERIDO"
            },
            {
                "type": "VAT",
                "taxPercentage": "16",
                "taxAmount": "32",
                "taxCategory": "TRANSFERIDO"
            },
            {
                "type": "LAC",
                "taxPercentage": "02.50",
                "taxAmount": "07.50",
                "taxCategory": "TRANSFERIDO"
            },
            {
                "type": "AAA",
                "taxPercentage": "12.00",
                "taxAmount": "48.00",
                "taxCategory": "TRANSFERIDO"
            }
        ],
        "payableAmount": "123456789"
   }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'F-PLUGIN: 9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',
    'F-Api-Key: Tu API key',
    'F-Secret-Key: Tu Secret key'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

var request = require('request');
var options = {
  'method': 'POST',
  'url': '{ HOST }/v3/addenda/cityfresko/store',
  'headers': {
    'Content-Type': 'application/json',
    'F-PLUGIN': '9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',
    'F-Api-Key': 'Tu API key',
    'F-Secret-Key': 'Tu Secret key'
  },
  body: JSON.stringify({
    "invoice": "bef24401-05e6-4ccb-b3aa-4a0343f1c0a6",
    "cityFresko": {
      "requestForPayment": {
        "documentStatus": "ORIGINAL",
        "DeliveryDate": "2023-01-13"
      },
      "requestForPaymentIdentification": {
        "entityType": "INVOICE",
        "uniqueCreatorIdentification": "UNIQUEIDAAPI123"
      },
      "specialInstruction": [
        {
          "code": "AAB",
          "text": "PAGO A 5 DIAS"
        },
        {
          "code": "PUR",
          "text": "CLIENNTE FRECUENTE"
        },
        {
          "code": "DUT",
          "text": "IMPUESTOS RELACIONADOS"
        },
        {
          "code": "ZZZ",
          "text": "QUINIENTOS CINCUENTA Y CINCO"
        }
      ],
      "orderIdentification": {
        "referenceIdentification": "CUSTOMORDER API 12345",
        "ReferenceDate": "2023-01-13"
      },
      "AdditionalInformation": [
        {
          "referenceIdentification": "REFERENCIA NUMERO DDE FACTURA123",
          "type": "IV"
        },
        {
          "referenceIdentification": "REFERENCIA NUMERO DOC123",
          "type": "ACE"
        },
        {
          "referenceIdentification": "REFERENCIA CHEQUE123",
          "type": "CK"
        },
        {
          "referenceIdentification": "REFERENCIA PREDIAL123",
          "type": "AAE"
        }
      ],
      "buyer": {
        "gln": "BUYERGLN123456",
        "text": "LUIS QUINTERO"
      },
      "seller": {
        "gln": "SELLERGLN123456",
        "alternatePartyIdentification": "ALTPARTYIDD123",
        "type": "IEPS_REFERENCE"
      },
      "shipTo": {
        "gln": "GLNSHIPMENT1234",
        "address": {
          "name": "LUIS QUINTERO CO.",
          "streetAddressOne": "CALLE CORAL AZUL",
          "city": "GUADALAJARA",
          "postalCode": "44790"
        }
      },
      "currency": {
        "currencyFunction": "PRICE_CURRENCY"
      },
      "paymentTerms": {
        "paymentTermsEvent": "EFECTIVE_DATE",
        "PaymentTermsRelationTime": "REFERENCE_BEFORE",
        "netPaymentTermsType": "END_OF_MONTH",
        "days": "2"
      },
      "allowanceCharge": {
        "settlementType": "OFF_INVOICE",
        "allowanceChargeType": "ALLOWANCE_GLOBAL",
        "specialServicesType": "ZZZ",
        "monetaryAmountOrPercentage": {
          "rate": "INVOICE_VALUE",
          "percentage": "2345.67"
        }
      },
      "lineItems": [
        {
          "type": "SimpleInvoiceLineItemType",
          "number": "0",
          "tradeItemIdentification": "GTINPROD1",
          "alternateTradeItemIdentification": {
            "type": "SUPPLIER_ASSIGNED",
            "value": "NUMALTPROD1"
          },
          "tradeItemDescriptionInformation": {
            "language": "ES",
            "longText": "DESCRIPCION PRODUCTO 0"
          },
          "invoicedQuantity": "10",
          "unitOfMeasure": "1.0",
          "aditionalQuantity": "10",
          "grossPrice": "",
          "netPrice": "11.00",
          "AdditionalInformation": {
            "referenceIdentification": "REFPROD1",
            "type": "ON"
          },
          "tradeItemTaxInformation": {
            "taxTypeDescription": "GST",
            "tradeItemTaxAmount": {
              "taxPercentage": "10.00",
              "taxAmount": "1.00"
            }
          },
          "totalLineAmount": {
            "grossAmount": "100",
            "netAmount": "110"
          }
        },
        {
          "type": "SimpleInvoiceLineItemType",
          "number": "2",
          "tradeItemIdentification": "GTINPROD1",
          "alternateTradeItemIdentification": {
            "type": "SUPPLIER_ASSIGNED",
            "value": "NUMALTPROD1"
          },
          "tradeItemDescriptionInformation": {
            "language": "ES",
            "longText": "DESCRIPCION PRODUCTO 1"
          },
          "invoicedQuantity": "10",
          "unitOfMeasure": "1.0",
          "aditionalQuantity": "",
          "grossPrice": "10.00",
          "netPrice": "",
          "AdditionalInformation": {
            "referenceIdentification": "REFPROD1",
            "type": "ON"
          },
          "tradeItemTaxInformation": {
            "taxTypeDescription": "GST",
            "tradeItemTaxAmount": {
              "taxPercentage": "10.00",
              "taxAmount": "1.00"
            }
          },
          "totalLineAmount": {
            "grossAmount": "100",
            "netAmount": "110"
          }
        },
        {
          "type": "SimpleInvoiceLineItemType",
          "number": "3",
          "tradeItemIdentification": "GTINPROD2",
          "alternateTradeItemIdentification": {
            "type": "BUYER_ASSIGNED",
            "value": "NUMALTPROD2"
          },
          "tradeItemDescriptionInformation": {
            "language": "EN",
            "longText": "DESCRIPCION PRODUCTO 2"
          },
          "invoicedQuantity": "10",
          "unitOfMeasure": "2.0",
          "aditionalQuantity": "10",
          "grossPrice": "",
          "netPrice": "",
          "AdditionalInformation": {
            "referenceIdentification": "REFPROD2",
            "type": "ON"
          },
          "tradeItemTaxInformation": {
            "taxTypeDescription": "VAT",
            "tradeItemTaxAmount": {
              "taxPercentage": "16.00",
              "taxAmount": "3.20"
            }
          },
          "totalLineAmount": {
            "grossAmount": "200",
            "netAmount": "232"
          }
        },
        {
          "type": "SimpleInvoiceLineItemType",
          "number": "4",
          "tradeItemIdentification": "GTINPROD3",
          "alternateTradeItemIdentification": {
            "type": "123",
            "value": "123"
          },
          "tradeItemDescriptionInformation": {
            "language": "ES",
            "longText": "DESCRIPCION PRODUCTO 3"
          },
          "invoicedQuantity": "10",
          "unitOfMeasure": "3.0",
          "aditionalQuantity": "10",
          "grossPrice": "0.00",
          "netPrice": "30.75",
          "AdditionalInformation": {
            "referenceIdentification": "REFPROD3",
            "type": "ON"
          },
          "tradeItemTaxInformation": {
            "taxTypeDescription": "LAC",
            "tradeItemTaxAmount": {
              "taxPercentage": "02.50",
              "taxAmount": "00.75"
            }
          },
          "totalLineAmount": {
            "grossAmount": "300",
            "netAmount": "307.5"
          }
        },
        {
          "type": "SimpleInvoiceLineItemType",
          "number": "5",
          "tradeItemIdentification": "GTINPROD4",
          "alternateTradeItemIdentification": {
            "type": "SUPPLIER_ASSIGNED",
            "value": "NUMALTPROD4"
          },
          "tradeItemDescriptionInformation": {
            "language": "EN",
            "longText": "DESCRIPCION PRODUCTO 4"
          },
          "invoicedQuantity": "10",
          "unitOfMeasure": "4.0",
          "aditionalQuantity": "10",
          "grossPrice": "40.00",
          "netPrice": "44.80",
          "AdditionalInformation": {
            "referenceIdentification": "REFPROD4",
            "type": "ON"
          },
          "tradeItemTaxInformation": {
            "taxTypeDescription": "AAA",
            "tradeItemTaxAmount": {
              "taxPercentage": "12.00",
              "taxAmount": "48.00"
            }
          },
          "totalLineAmount": {
            "grossAmount": "400",
            "netAmount": "448"
          }
        }
      ],
      "totalAmount": "1234567.89",
      "baseAmount": "123456.00",
      "tax": [
        {
          "type": "GST",
          "taxPercentage": "10",
          "taxAmount": "10",
          "taxCategory": "TRANSFERIDO"
        },
        {
          "type": "VAT",
          "taxPercentage": "16",
          "taxAmount": "32",
          "taxCategory": "TRANSFERIDO"
        },
        {
          "type": "LAC",
          "taxPercentage": "02.50",
          "taxAmount": "07.50",
          "taxCategory": "TRANSFERIDO"
        },
        {
          "type": "AAA",
          "taxPercentage": "12.00",
          "taxAmount": "48.00",
          "taxCategory": "TRANSFERIDO"
        }
      ],
      "payableAmount": "123456789"
    }
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

import requests
import json

url = "{ HOST }/v3/addenda/cityfresko/store"

payload = json.dumps({
  "invoice": "bef24401-05e6-4ccb-b3aa-4a0343f1c0a6",
  "cityFresko": {
    "requestForPayment": {
      "documentStatus": "ORIGINAL",
      "DeliveryDate": "2023-01-13"
    },
    "requestForPaymentIdentification": {
      "entityType": "INVOICE",
      "uniqueCreatorIdentification": "UNIQUEIDAAPI123"
    },
    "specialInstruction": [
      {
        "code": "AAB",
        "text": "PAGO A 5 DIAS"
      },
      {
        "code": "PUR",
        "text": "CLIENNTE FRECUENTE"
      },
      {
        "code": "DUT",
        "text": "IMPUESTOS RELACIONADOS"
      },
      {
        "code": "ZZZ",
        "text": "QUINIENTOS CINCUENTA Y CINCO"
      }
    ],
    "orderIdentification": {
      "referenceIdentification": "CUSTOMORDER API 12345",
      "ReferenceDate": "2023-01-13"
    },
    "AdditionalInformation": [
      {
        "referenceIdentification": "REFERENCIA NUMERO DDE FACTURA123",
        "type": "IV"
      },
      {
        "referenceIdentification": "REFERENCIA NUMERO DOC123",
        "type": "ACE"
      },
      {
        "referenceIdentification": "REFERENCIA CHEQUE123",
        "type": "CK"
      },
      {
        "referenceIdentification": "REFERENCIA PREDIAL123",
        "type": "AAE"
      }
    ],
    "buyer": {
      "gln": "BUYERGLN123456",
      "text": "LUIS QUINTERO"
    },
    "seller": {
      "gln": "SELLERGLN123456",
      "alternatePartyIdentification": "ALTPARTYIDD123",
      "type": "IEPS_REFERENCE"
    },
    "shipTo": {
      "gln": "GLNSHIPMENT1234",
      "address": {
        "name": "LUIS QUINTERO CO.",
        "streetAddressOne": "CALLE CORAL AZUL",
        "city": "GUADALAJARA",
        "postalCode": "44790"
      }
    },
    "currency": {
      "currencyFunction": "PRICE_CURRENCY"
    },
    "paymentTerms": {
      "paymentTermsEvent": "EFECTIVE_DATE",
      "PaymentTermsRelationTime": "REFERENCE_BEFORE",
      "netPaymentTermsType": "END_OF_MONTH",
      "days": "2"
    },
    "allowanceCharge": {
      "settlementType": "OFF_INVOICE",
      "allowanceChargeType": "ALLOWANCE_GLOBAL",
      "specialServicesType": "ZZZ",
      "monetaryAmountOrPercentage": {
        "rate": "INVOICE_VALUE",
        "percentage": "2345.67"
      }
    },
    "lineItems": [
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "0",
        "tradeItemIdentification": "GTINPROD1",
        "alternateTradeItemIdentification": {
          "type": "SUPPLIER_ASSIGNED",
          "value": "NUMALTPROD1"
        },
        "tradeItemDescriptionInformation": {
          "language": "ES",
          "longText": "DESCRIPCION PRODUCTO 0"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "1.0",
        "aditionalQuantity": "10",
        "grossPrice": "",
        "netPrice": "11.00",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD1",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "GST",
          "tradeItemTaxAmount": {
            "taxPercentage": "10.00",
            "taxAmount": "1.00"
          }
        },
        "totalLineAmount": {
          "grossAmount": "100",
          "netAmount": "110"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "2",
        "tradeItemIdentification": "GTINPROD1",
        "alternateTradeItemIdentification": {
          "type": "SUPPLIER_ASSIGNED",
          "value": "NUMALTPROD1"
        },
        "tradeItemDescriptionInformation": {
          "language": "ES",
          "longText": "DESCRIPCION PRODUCTO 1"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "1.0",
        "aditionalQuantity": "",
        "grossPrice": "10.00",
        "netPrice": "",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD1",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "GST",
          "tradeItemTaxAmount": {
            "taxPercentage": "10.00",
            "taxAmount": "1.00"
          }
        },
        "totalLineAmount": {
          "grossAmount": "100",
          "netAmount": "110"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "3",
        "tradeItemIdentification": "GTINPROD2",
        "alternateTradeItemIdentification": {
          "type": "BUYER_ASSIGNED",
          "value": "NUMALTPROD2"
        },
        "tradeItemDescriptionInformation": {
          "language": "EN",
          "longText": "DESCRIPCION PRODUCTO 2"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "2.0",
        "aditionalQuantity": "10",
        "grossPrice": "",
        "netPrice": "",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD2",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "VAT",
          "tradeItemTaxAmount": {
            "taxPercentage": "16.00",
            "taxAmount": "3.20"
          }
        },
        "totalLineAmount": {
          "grossAmount": "200",
          "netAmount": "232"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "4",
        "tradeItemIdentification": "GTINPROD3",
        "alternateTradeItemIdentification": {
          "type": "123",
          "value": "123"
        },
        "tradeItemDescriptionInformation": {
          "language": "ES",
          "longText": "DESCRIPCION PRODUCTO 3"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "3.0",
        "aditionalQuantity": "10",
        "grossPrice": "0.00",
        "netPrice": "30.75",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD3",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "LAC",
          "tradeItemTaxAmount": {
            "taxPercentage": "02.50",
            "taxAmount": "00.75"
          }
        },
        "totalLineAmount": {
          "grossAmount": "300",
          "netAmount": "307.5"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "5",
        "tradeItemIdentification": "GTINPROD4",
        "alternateTradeItemIdentification": {
          "type": "SUPPLIER_ASSIGNED",
          "value": "NUMALTPROD4"
        },
        "tradeItemDescriptionInformation": {
          "language": "EN",
          "longText": "DESCRIPCION PRODUCTO 4"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "4.0",
        "aditionalQuantity": "10",
        "grossPrice": "40.00",
        "netPrice": "44.80",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD4",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "AAA",
          "tradeItemTaxAmount": {
            "taxPercentage": "12.00",
            "taxAmount": "48.00"
          }
        },
        "totalLineAmount": {
          "grossAmount": "400",
          "netAmount": "448"
        }
      }
    ],
    "totalAmount": "1234567.89",
    "baseAmount": "123456.00",
    "tax": [
      {
        "type": "GST",
        "taxPercentage": "10",
        "taxAmount": "10",
        "taxCategory": "TRANSFERIDO"
      },
      {
        "type": "VAT",
        "taxPercentage": "16",
        "taxAmount": "32",
        "taxCategory": "TRANSFERIDO"
      },
      {
        "type": "LAC",
        "taxPercentage": "02.50",
        "taxAmount": "07.50",
        "taxCategory": "TRANSFERIDO"
      },
      {
        "type": "AAA",
        "taxPercentage": "12.00",
        "taxAmount": "48.00",
        "taxCategory": "TRANSFERIDO"
      }
    ],
    "payableAmount": "123456789"
  }
})
headers = {
  'Content-Type': 'application/json',
  'F-PLUGIN': '9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',
  'F-Api-Key': 'Tu API key',
  'F-Secret-Key': 'Tu Secret key'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

require "uri"
require "json"
require "net/http"

url = URI("{ HOST }/v3/addenda/cityfresko/store")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["F-PLUGIN"] = "9d4095c8f7ed5785cb14c0e3b033eeb8252416ed"
request["F-Api-Key"] = "Tu API key"
request["F-Secret-Key"] = "Tu Secret key"
request.body = JSON.dump({
  "invoice": "bef24401-05e6-4ccb-b3aa-4a0343f1c0a6",
  "cityFresko": {
    "requestForPayment": {
      "documentStatus": "ORIGINAL",
      "DeliveryDate": "2023-01-13"
    },
    "requestForPaymentIdentification": {
      "entityType": "INVOICE",
      "uniqueCreatorIdentification": "UNIQUEIDAAPI123"
    },
    "specialInstruction": [
      {
        "code": "AAB",
        "text": "PAGO A 5 DIAS"
      },
      {
        "code": "PUR",
        "text": "CLIENNTE FRECUENTE"
      },
      {
        "code": "DUT",
        "text": "IMPUESTOS RELACIONADOS"
      },
      {
        "code": "ZZZ",
        "text": "QUINIENTOS CINCUENTA Y CINCO"
      }
    ],
    "orderIdentification": {
      "referenceIdentification": "CUSTOMORDER API 12345",
      "ReferenceDate": "2023-01-13"
    },
    "AdditionalInformation": [
      {
        "referenceIdentification": "REFERENCIA NUMERO DDE FACTURA123",
        "type": "IV"
      },
      {
        "referenceIdentification": "REFERENCIA NUMERO DOC123",
        "type": "ACE"
      },
      {
        "referenceIdentification": "REFERENCIA CHEQUE123",
        "type": "CK"
      },
      {
        "referenceIdentification": "REFERENCIA PREDIAL123",
        "type": "AAE"
      }
    ],
    "buyer": {
      "gln": "BUYERGLN123456",
      "text": "LUIS QUINTERO"
    },
    "seller": {
      "gln": "SELLERGLN123456",
      "alternatePartyIdentification": "ALTPARTYIDD123",
      "type": "IEPS_REFERENCE"
    },
    "shipTo": {
      "gln": "GLNSHIPMENT1234",
      "address": {
        "name": "LUIS QUINTERO CO.",
        "streetAddressOne": "CALLE CORAL AZUL",
        "city": "GUADALAJARA",
        "postalCode": "44790"
      }
    },
    "currency": {
      "currencyFunction": "PRICE_CURRENCY"
    },
    "paymentTerms": {
      "paymentTermsEvent": "EFECTIVE_DATE",
      "PaymentTermsRelationTime": "REFERENCE_BEFORE",
      "netPaymentTermsType": "END_OF_MONTH",
      "days": "2"
    },
    "allowanceCharge": {
      "settlementType": "OFF_INVOICE",
      "allowanceChargeType": "ALLOWANCE_GLOBAL",
      "specialServicesType": "ZZZ",
      "monetaryAmountOrPercentage": {
        "rate": "INVOICE_VALUE",
        "percentage": "2345.67"
      }
    },
    "lineItems": [
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "0",
        "tradeItemIdentification": "GTINPROD1",
        "alternateTradeItemIdentification": {
          "type": "SUPPLIER_ASSIGNED",
          "value": "NUMALTPROD1"
        },
        "tradeItemDescriptionInformation": {
          "language": "ES",
          "longText": "DESCRIPCION PRODUCTO 0"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "1.0",
        "aditionalQuantity": "10",
        "grossPrice": "",
        "netPrice": "11.00",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD1",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "GST",
          "tradeItemTaxAmount": {
            "taxPercentage": "10.00",
            "taxAmount": "1.00"
          }
        },
        "totalLineAmount": {
          "grossAmount": "100",
          "netAmount": "110"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "2",
        "tradeItemIdentification": "GTINPROD1",
        "alternateTradeItemIdentification": {
          "type": "SUPPLIER_ASSIGNED",
          "value": "NUMALTPROD1"
        },
        "tradeItemDescriptionInformation": {
          "language": "ES",
          "longText": "DESCRIPCION PRODUCTO 1"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "1.0",
        "aditionalQuantity": "",
        "grossPrice": "10.00",
        "netPrice": "",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD1",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "GST",
          "tradeItemTaxAmount": {
            "taxPercentage": "10.00",
            "taxAmount": "1.00"
          }
        },
        "totalLineAmount": {
          "grossAmount": "100",
          "netAmount": "110"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "3",
        "tradeItemIdentification": "GTINPROD2",
        "alternateTradeItemIdentification": {
          "type": "BUYER_ASSIGNED",
          "value": "NUMALTPROD2"
        },
        "tradeItemDescriptionInformation": {
          "language": "EN",
          "longText": "DESCRIPCION PRODUCTO 2"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "2.0",
        "aditionalQuantity": "10",
        "grossPrice": "",
        "netPrice": "",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD2",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "VAT",
          "tradeItemTaxAmount": {
            "taxPercentage": "16.00",
            "taxAmount": "3.20"
          }
        },
        "totalLineAmount": {
          "grossAmount": "200",
          "netAmount": "232"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "4",
        "tradeItemIdentification": "GTINPROD3",
        "alternateTradeItemIdentification": {
          "type": "123",
          "value": "123"
        },
        "tradeItemDescriptionInformation": {
          "language": "ES",
          "longText": "DESCRIPCION PRODUCTO 3"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "3.0",
        "aditionalQuantity": "10",
        "grossPrice": "0.00",
        "netPrice": "30.75",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD3",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "LAC",
          "tradeItemTaxAmount": {
            "taxPercentage": "02.50",
            "taxAmount": "00.75"
          }
        },
        "totalLineAmount": {
          "grossAmount": "300",
          "netAmount": "307.5"
        }
      },
      {
        "type": "SimpleInvoiceLineItemType",
        "number": "5",
        "tradeItemIdentification": "GTINPROD4",
        "alternateTradeItemIdentification": {
          "type": "SUPPLIER_ASSIGNED",
          "value": "NUMALTPROD4"
        },
        "tradeItemDescriptionInformation": {
          "language": "EN",
          "longText": "DESCRIPCION PRODUCTO 4"
        },
        "invoicedQuantity": "10",
        "unitOfMeasure": "4.0",
        "aditionalQuantity": "10",
        "grossPrice": "40.00",
        "netPrice": "44.80",
        "AdditionalInformation": {
          "referenceIdentification": "REFPROD4",
          "type": "ON"
        },
        "tradeItemTaxInformation": {
          "taxTypeDescription": "AAA",
          "tradeItemTaxAmount": {
            "taxPercentage": "12.00",
            "taxAmount": "48.00"
          }
        },
        "totalLineAmount": {
          "grossAmount": "400",
          "netAmount": "448"
        }
      }
    ],
    "totalAmount": "1234567.89",
    "baseAmount": "123456.00",
    "tax": [
      {
        "type": "GST",
        "taxPercentage": "10",
        "taxAmount": "10",
        "taxCategory": "TRANSFERIDO"
      },
      {
        "type": "VAT",
        "taxPercentage": "16",
        "taxAmount": "32",
        "taxCategory": "TRANSFERIDO"
      },
      {
        "type": "LAC",
        "taxPercentage": "02.50",
        "taxAmount": "07.50",
        "taxCategory": "TRANSFERIDO"
      },
      {
        "type": "AAA",
        "taxPercentage": "12.00",
        "taxAmount": "48.00",
        "taxCategory": "TRANSFERIDO"
      }
    ],
    "payableAmount": "123456789"
  }
})

response = https.request(request)
puts response.read_body

Respuesta

Ejemplo de respuesta exitosa.
{
    "response": "success",
    "message": "Addenda agregada con éxito"
}

Ejemplo de respuesta cuando la factura ya cuenta con una addenda

Importante

Los CFDI solo pueden contar con una addenda añadida, por lo que este mensaje es importante para conocer si estamos intentando duplicar una addenda o ya se asigno alguna a nuestro CFDI

{
    "response": "failed",
    "message": "Ya cuenta con addenda"
}

Ejemplo de respuesta erronea

Aviso

El mensaje de error puede variar dependiendo el nodo en el que haya información incorrecta. Te sugerimos leer cuidadosamente el mensaje del error ya que en el mismo se indica donde es necesario corregir la información.

{
    "response": "failed",
    "message": "CFDI invalido"
}

Prev
CENACE
Next
Comentario