Clientes

Ruby
PHP
Javascript
.Net >= 4.5
Java
Phyton

En este ejemplo se considera que facturama es una instancia de Facturama API ver en la guía

Agregar cliente

    cliente = facturama.clients.create(Facturama::Models::Client.new({   
        Email: "info@pedroperez.net",
        Rfc: "RODJ899315654",
        CfdiUse: "P01",
        Name: "Pedro Perez Development Environment",

        Address: {  Country: "MEXICO",
                    ExteriorNumber: "1230",
                    InteriorNumber: "B",
                    Locality: "San Luis",
                    Municipality: "San Luis Potosí",
                    Neighborhood: "Lomas 4ta",
                    State: "San Luis Potosí",
                    Street: "Cañada de Gomez",
                    ZipCode: "78220"
        }
    }))
    

En este ejemplo se considera que $facturama es una instancia de Facturama API ver en la guía

Agregar cliente

    $params = [
      'Address' => [
        'Street' => 'St One ',
        'ExteriorNumber' => '15',
        'InteriorNumber' => '12',
        'Neighborhood' => 'Lower Manhattan, ',
        'ZipCode' => 'sample string 5',
        'Locality' => 'sample string 6',
        'Municipality' => 'sample string 7',
        'State' => 'sample string 8',
        'Country' => 'MX',
      ],
      'Rfc' => 'XEXX010101000',
      'Name' => 'Test Test',
      'Email' => 'test@facturma.com',
    ];
    $cliente = $facturama->post('Client', $params);
            

En este ejemplo se considera que Facturama es una instancia de Facturama API ver en la guía

Agregar cliente

    var newClient = {
        "Email": "pruebas@gmail.com",
        "Address": {
            "Street": "Av Seguridad Soc",
            "ExteriorNumber": "123",
            "InteriorNumber": "",
            "Neighborhood": "Fidel Velazquez",
            "ZipCode": "78436",
            "Locality": "",
            "Municipality": "Soledad de Graciano Sánchez",
            "State": "San Luis Potosí",
            "Country": "Mex"
        },
        "Rfc": "ROAM861021459",
        "Name": "Manuel Romero Alva",
        "CfdiUse": "P01",
    };


    Facturama.Clients.Create(newClient, function(result){ 
        client = result;
        console.log("creacion",result);    
    });
    

En este ejemplo se considera que facturama es una instancia de Facturama API ver en la guía

Referencias

    Client cliente = new Client();    
         
    Address clientAddress = new Address();
    clientAddress.setCountry("MEXICO");
    clientAddress.setExteriorNumber("1230");
    clientAddress.setInteriorNumber("B");
    clientAddress.setLocality("San Luis");                  
    clientAddress.setMunicipality("San Luis Potosí");         
    clientAddress.setNeighborhood("Lomas 4ta");
    clientAddress.setState("San Luis Potosí");
    clientAddress.setStreet("Cañada de Gomez");
    clientAddress.setZipCode("78220");
         
    cliente.setAddress(clientAddress);         
    cliente.setCfdiUse("P01");
    cliente.setRfc("ESO1202108R2");
    cliente.setEmail("diego@facturama.com.mx");
    cliente.setName("Expresion en Software");
         
         
   cliente = facturama.Clients().Create(cliente);

En este ejemplo se considera que facturama es una instancia de Facturama API ver en la guía

Referencia

    var cliente = facturama.Clients.Create(new Client
        {
            Address = new Address
            {
                Country = "MEXICO",
                ExteriorNumber = "1230",
                InteriorNumber = "B",
                Locality = "San Luis",
                Municipality = "San Luis Potosí",
                Neighborhood = "Lomas 4ta",
                State = "San Luis Potosí",
                Street = "Cañada de Gomez",
                ZipCode = "78220"
            },
            CfdiUse = "P01",
            Email = "diego@facturama.com.mx",
            Rfc = "ESO1202108R2",
            Name = "Expresion en Software"
        });

Referencia

    customer_object = {
        "Id": "1111000",
        "Email": "test@test.com",
        "Address": {
            "Street": "Fenix One",
            "ExteriorNumber": "1",
            "InteriorNumber": "0",
            "Neighborhood": "Call me",
            "ZipCode": "59510",
            "Locality": "Xiquilpan",
            "Municipality": "Jiquilpan",y
            "State": "MICHOACAN DE OCAMPO",
            "Country": "MX"
        },
        "Rfc": "GARR900630G98",
        "Name": "Pollitux",
        "CfdiUse": "P01",
        "TaxResidence": "",
        "NumRegIdTrib": ""
    }

    cliente = facturama.Client.create(customer_object)