1. Resurse si URL-uri
Noul API
factureaza.ro
este un API
GraphQL.
Îţi permite accesul flexibil la datele tale pe baza unui "query" prin care specifici exact
datele care vrei să ţi se returneze. În mod similar poţi efetua şi operaţii de creare, editare şi ştergere a
tuturor datelor relvante.
Documentaţia oficială GraphQL o găseşti
aici.
Pentru exemplele din limbajul Ruby am folosit gem-ul "graphql", "~> 1.10". Cu versiunea 2, sau mai noi pot apărea diverse erori.
2. Sistem sandbox pentru testarea API GRAPHQL
Pentru testarea funcțiilor API-ul
factureaza.ro
îţi punem la dispoziţie un sistem sandbox.
Acesta este disponibil la adresa:
https://sandbox.factureaza.ro
Cheia API pentru teste:
72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965
Datele de acces pentru intefaţa umană corespunzătoare utilizatorului cu cheia API de mai sus:
3. Autentificare
Cheia API este definită per utilizator și se poate (re)genera din contul tău
factureaza.ro
, la punctul “Contul meu” -> “Cheie API”
Sunt disponibile două metode de autentificare:
-
HTTP Authentication
(se va folosi cheia API ca username, parola fiind ignorată)
-
Parametru api_key
adăugat fiecărui request.
6.1. Contul tău (Model Account)
Detalii despre contul tău
{
account {
id
name
companyAddress1
companyCity
companyFax
companyUid
companyName
companyState
totalOpen
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a contului tău te rugăm
să consulţi documentaţia interactivă.
Căutare clienți
{
clients(id: "1064115995", name: "nume client", email: "client_name@random.ro") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare clienți
{
clients(orderBy: "{\"email\": \"desc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare clienți
{
clients(orderBy: "{\"email\": \"asc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Adăugare client
mutation {
createClient(
uid: "12345678",
name: "nume client",
address: "adresa client",
city: "Brasov",
country: "RO"
) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea clienților te rugăm
să consulţi documentaţia interactivă.
Modificare client
mutation {
updateClient(
id: "1064116436",
name: "nume nou",
country: "RO",
uid: "3987985"
) {
id
name
email
uid
country
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea clienților te rugăm
să consulţi documentaţia interactivă.
Căutare serii facturi
{
invoiceSeries(year: "2021", counterStart: "0", prefix: "HOS") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Adăugare serie facturi
mutation {
createInvoiceSeries(
counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
6.4. Facturi (Model Invoice)
Detalii facturi
{
invoices(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
lowerAnnotation
upperAnnotation
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Listare facturi
{
invoices(limit: 1, offset: 1) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
lowerAnnotation
upperAnnotation
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Căutare facturi
{
invoices(documentSeriesId: "1061104746") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate căutare a facturilor te rugăm
să consulţi documentaţia interactivă.
Filtrare facturi
{
invoices(where: "{\"_eq\": {\"cachedTotal\": \"145.2\", \"vatType\": \"1\"}}") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate filtrare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"desc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"asc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ștergere facturi
mutation {
deleteInvoice(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea facturilor te rugăm
să consulţi documentaţia interactivă.
Adăugare facturi
mutation {
createInvoice(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104746",
documentDate: "2023-07-06",
exchangeRate: "4.55",
lowerAnnotation: "exemplu note subsol",
upperAnnotation: "exemplu note antet",
documentSeriesCounter: "469",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea facturilor te rugăm
să consulţi documentaţia interactivă.
Modificare facturi
mutation {
updateInvoice(
id: "1065255630",
exchangeRate: "4.5",
currency: "RON",
documentPositions: [{
description: "produs",
unit: "-",
unitCount: "1",
total: "0.0",
productCode: "none",
vat: "20.0",
position: "0"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
exchangeRate
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea facturilor te rugăm
să consulţi documentaţia interactivă.
Convertește factura în format PDF codificat ca Base64 (funcționează pt toate tipurile de documente)
{
invoices(id: "1065255630") {
id
pdfContent
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate convertirea facturilor în format PDF te rugăm
să consulţi documentaţia interactivă.
Trimite factura pe e-mail
mutation {
sendDocument(to: "random_email@random_service.domain", documentId: "1065255630", body: "your invoice", bcc: "random_email2@random_service.domain") {
id
description
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru trimiterea facturilor te rugăm
să consulţi documentaţia interactivă.
Export în format xml UBL pentru e-Factura
mutation {
exportInvoiceEfacturaUbl(
id: "1065255630",
invoiceNotes: "invoice note example",
invoiceTypeCode: "380",
paymentMethod: "1",
vatType: "S",
efacturaClassificationCodeAttributes: [{
documentPositionId: "1056079721",
schemeIdentifier: "STI",
classificationCode: "cltestcode"
}],
efacturaDocumentPositionUnitsAttributes: [{
documentPositionUnits: "ore",
documentPositionDescriptions: "HUR"
}, {
documentPositionUnits: "buc.",
documentPositionDescriptions: "H87"
}]
) {
xml
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate exportul facturilor în format xml UBL pentru e-Factura te rugăm
să consulţi documentaţia interactivă.
Trimitere la e-Factura (ANAF) - cont-ul trebuie să aibă integrarea cu e-Factura activată
mutation {
submitInvoiceEfacturaUbl (id: "1065255682",
invoiceTypeCode: "380",
paymentMethod: "1",
contractReference: "123a",
orderReference: "456b"
invoiceNotes: "aaa",
vatType: "S",
efacturaDocumentPositionUnitsAttributes: [{
documentPositionUnits: "l",
documentPositionDescriptions: "XZZ"
}]) {
efacturaTransaction
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate trimiterea facturilor în format xml UBL pentru e-Factura te rugăm
să consulţi documentaţia interactivă.
Vaolrile pentru diferite câmpuri se pot găsi:
-
invoiceTypeCode aici .
-
paymentMethod aici .
-
vatType aici .
-
vatExemptionReason aici .
-
paymentMethod aici .
-
alte coduri aici .
Diverse câmpuri suprascrise de e-Factura, documentația aici .
Mai multe detalii în documentația oficială e-Factura de la ANAF .
Tranzacțiile e-Factura în format JSON
{
invoices(id: "1065253790") {
id
createdAt
efacturaTransactions
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate tranzacțiile e-Factura te rugăm
să consulţi documentaţia interactivă.
6.5. Serii chitanțe (Receipt Series)
Detalii serie chitanță
{
receiptSeries(id: "1061104759") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de chitanțe te rugăm
să consulţi documentaţia interactivă.
Ștergere serie chitanță
mutation {
deleteReceiptSeries(id: "1061104759") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor de chitanțe te rugăm
să consulţi documentaţia interactivă.
Adăugare serie chitanță
mutation {
createReceiptSeries(counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor de chitanțe te rugăm
să consulţi documentaţia interactivă.
Modificare serie chitanță
mutation {
updateReceiptSeries(id: "1061104759", prefix: "SER") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor de chitanțe te rugăm
să consulţi documentaţia interactivă.
6.6. Chitanțe (Model Receipt)
Detalii chitanță
{
receipts(id: "1065255650") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a chitanțelor te rugăm
să consulţi documentaţia interactivă.
Ștergere chitanță
mutation {
deleteReceipt(id: "1065255650") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea chitanțelor te rugăm
să consulţi documentaţia interactivă.
Adăugare chitanță
mutation {
createReceipt(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104759",
documentDate: "2024-09-05",
documentSeriesCounter: "21123333",
receiptAmount: "23",
invoiceId: "1065255682",
vatType: "1",
delegateId: "525664463",
displayTransportData: "false",
invoiceDate: "2024-11-03"
) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea chitanțelor te rugăm
să consulţi documentaţia interactivă.
Modificare chitanță
mutation {
updateReceipt(id: "1065255650",
exchangeRate: "4.5",
currency: "EUR"
) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea chitanțelor te rugăm
să consulţi documentaţia interactivă.
6.7. Serii comenzi (Model Order Series)
Detalii serie comandă
{
orderSeries(id: "1061104752") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor comenzilor te rugăm
să consulţi documentaţia interactivă.
Adăugare serie comandă
mutation {
createOrderSeries(
counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor comenzilor te rugăm
să consulţi documentaţia interactivă.
Modificare serie comandă
mutation {
updateOrderSeries(id: "1061104752", prefix: "SER") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor comenzilor te rugăm
să consulţi documentaţia interactivă.
Ștergere serie comandă
mutation {
deleteOrderSeries(id: "1061104752") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor comenzilor te rugăm
să consulţi documentaţia interactivă.
6.8. Comenzi (Model Order)
Detalii comandă
{
orders(id: "1065255672") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a comenzilor te rugăm
să consulţi documentaţia interactivă.
Ștergere comandă
mutation {
deleteOrder(id: "1065255672") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea comenzilor te rugăm
să consulţi documentaţia interactivă.
Adăugare comandă
mutation {
createOrder(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104752",
documentDate: "2023-08-02",
exchangeRate: "4.55",
documentSeriesCounter: "423",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea comenzilor te rugăm
să consulţi documentaţia interactivă.
Modificare comandă
mutation {
updateOrder(id: "1065255672", exchangeRate: "4.5", currency: "RON") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea comenzilor te rugăm
să consulţi documentaţia interactivă.
Detalii serie factură proformă
{
proformaInvoiceSeries(id: "1061104757") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Adăugare serie factură proformă
mutation {
createProformaInvoiceSeries(
counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Modificare serie factură proformă
mutation {
updateProformaInvoiceSeries(id: "1061104757", prefix: "SER") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Ștergere serie factură proformă
mutation {
deleteProformaInvoiceSeries(id: "1061104757") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Detalii factură proformă
{
proformaInvoices(id: "1065255652") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Ștergere factură proformă
mutation {
deleteProformaInvoice(id: "1065255652") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Adăugare factură proformă
mutation {
createProformaInvoice(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104757",
documentDate: "2024-09-08",
exchangeRate: "4.55",
documentSeriesCounter: "423",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea facturilor proforma te rugăm
să consulţi documentaţia interactivă.
Modificare factură proformă
mutation {
updateProformaInvoice(id: "1065255652", exchangeRate: "4.5", currency: "RON") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea facturilor proforma te rugăm
să consulţi documentaţia interactivă.
6.11. Serii avize (Model Notice Series)
Detalii serie aviz
{
noticeSeries(id: "1061104766") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de avize te rugăm
să consulţi documentaţia interactivă.
Ștergere serie aviz
mutation {
deleteNoticeSeries(id: "1061104766") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor de avize te rugăm
să consulţi documentaţia interactivă.
Adăugare serie aviz
mutation {
createNoticeSeries(counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor de avize te rugăm
să consulţi documentaţia interactivă.
Modificare serie aviz
mutation {
updateNoticeSeries(id: "1061104766", prefix: "SER") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor de avize te rugăm
să consulţi documentaţia interactivă.
6.12. Avize (Model Notice)
Detalii aviz
{
notices(id: "1065255666") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a avizelor te rugăm
să consulţi documentaţia interactivă.
Ștergere aviz
mutation {
deleteNotice(id: "1065255666") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea avizelor te rugăm
să consulţi documentaţia interactivă.
Adăugare aviz
mutation {
createNotice(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104766",
documentDate: "2025-10-05",
exchangeRate: "4.55",
documentSeriesCounter: "423",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea avizelor te rugăm
să consulţi documentaţia interactivă.
Modificare aviz
mutation {
updateNotice(id: "1065255666",
exchangeRate: "4.5",
currency: "EUR") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
exchangeRate
currency
documentPositions {
id
price
position
total
type
}
inputCurrency
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea avizelor te rugăm
să consulţi documentaţia interactivă.
6.13. Utilizatori (Model User)
Detalii despre utilizatorii contului
{
users(id: "525664463") {
id
firstName
lastName
telephone
email
cnp
identityDocumentNumber
identityDocumentSeries
identityDocumentIssuedBy
identityDocumentIssueDate
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a utilizatorilor te rugăm
să consulţi documentaţia interactivă.
6.14. Plăți (Model Payment)
Detalii plată
{
payments(id: "969663807") {
id
createdAt
description
currency
paymentType
paymentDate
amount
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a plăților te rugăm
să consulţi documentaţia interactivă.
Adăugare plată
mutation {
createPayment(description: "descriere plata",
currency: "RON",
paymentDate: "2024-11-21",
proformaInvoiceId: "1065255652"
invoiceId: "1065255682",
amount: "200"
) {
id
createdAt
description
currency
paymentType
paymentDate
amount
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea plăților te rugăm
să consulţi documentaţia interactivă.
Modificare plată
mutation {
updatePayment(id: "969663807",
description: "descriere noua",
currency: "RON"
) {
id
createdAt
description
currency
paymentType
paymentDate
amount
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea plăților te rugăm
să consulţi documentaţia interactivă.
Ștergere plată
mutation {
deletePayment(id: "969663807") {
id
createdAt
description
currency
paymentType
paymentDate
amount
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea plăților te rugăm
să consulţi documentaţia interactivă.
6.15. Produse (Model Product)
Detalii produs
{
products(id: "741342701") {
id
createdAt
description
code
price
quantity
unit
currency
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a produselor te rugăm
să consulţi documentaţia interactivă.
Adăugare produs
mutation {
createProduct(description: "descriere produs",
currency: "EUR"
) {
id
createdAt
description
code
price
quantity
unit
currency
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea produselor te rugăm
să consulţi documentaţia interactivă.
Modificare produs
mutation {
updateProduct(id: "741342701",
description: "descriere noua",
currency: "EUR") {
id
createdAt
description
code
price
quantity
unit
currency
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea produselor te rugăm
să consulţi documentaţia interactivă.
Ștergere produs
mutation {
deleteProduct(id: "741342701") {
id
createdAt
description
code
price
quantity
unit
currency
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea produselor te rugăm
să consulţi documentaţia interactivă.
6.16. Abonamente (Model Recurrent)
Detalii despre abonamente
{
recurrents(id: "930987064") {
id
scheduleUnit
scheduleUnitCount
name
documentSeriesPrefix
description
documentType
recurrentJobs {
id
clientId
paymentStartAt
scheduleAnchor
locale
coveredUntil
price
vat
paymentEndAt
}
invoices {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a abonamentelor te rugăm
să consulţi documentaţia interactivă.
6.17. Abonați (Model Recurrent Job)
Detalii despre abonați
{
recurrentJobs(id: "44") {
id
recurrentId
clientId
paymentStartAt
scheduleAnchor
locale
coveredUntil
price
vat
paymentEndAt
destinationEmail
recurrentJobRuns {
id
periodEndAt
periodStartAt
documentId
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a abonaților te rugăm
să consulţi documentaţia interactivă.
Ștergere abonat
mutation {
deleteRecurrentJob(id: "44") {
id
recurrentId
clientId
paymentStartAt
scheduleAnchor
locale
coveredUntil
price
vat
paymentEndAt
destinationEmail
recurrentJobRuns {
id
periodEndAt
periodStartAt
documentId
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea abonaților te rugăm
să consulţi documentaţia interactivă.
Adăugare abonat
mutation {
createRecurrentJob(
recurrentId: "930987064",
clientId: "1064116436",
paymentStartAt: "21.11.2024"
) {
id
recurrentId
clientId
paymentStartAt
scheduleAnchor
locale
coveredUntil
price
vat
paymentEndAt
destinationEmail
recurrentJobRuns {
id
periodEndAt
periodStartAt
documentId
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea abonaților te rugăm
să consulţi documentaţia interactivă.
Modificare abonat
mutation {
updateRecurrentJob(id: "44", paymentStartAt: "12.03.2015") {
id
recurrentId
clientId
paymentStartAt
scheduleAnchor
locale
coveredUntil
price
vat
paymentEndAt
destinationEmail
recurrentJobRuns {
id
periodEndAt
periodStartAt
documentId
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea abonaților te rugăm
să consulţi documentaţia interactivă.
6.18. Rularea abonamentului (Model Recurrent Job Run)
Detalii despre rularea abonamentului
{
recurrentJobRuns(id: "809120215") {
id
documentId
periodStartAt
createdAt
updatedAt
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a rulării abonamentului te rugăm
să consulţi documentaţia interactivă.
6.19 Furnizori (Model Supplier)
Detalii furnizor
{
suppliers(id: "10") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a furnizorilor te rugăm
să consulţi documentaţia interactivă.
Listare furnizori
{
suppliers(limit: 1, offset: 1) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a furnizorilor te rugăm
să consulţi documentaţia interactivă.
Căutare furnizori
{
suppliers(id: "1064115995", name: "nume furnizor", email: "supplier_name@random.ro") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea furnizorilor te rugăm
să consulţi documentaţia interactivă.
Filtrare furnizori
{
suppliers(where: "{\"_eq\": {\"name\": \"nume furnizor\", \"email\": \"supplier_name@random.ro\"}}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea furnizorilor te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare furnizori
{
suppliers(orderBy: "{\"email\": \"desc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea furnizorilor te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare furnizori
{
suppliers(orderBy: "{\"email\": \"asc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea furnizorilor te rugăm
să consulţi documentaţia interactivă.
Adăugare furnizor
mutation {
createSupplier(
uid: "12345678",
name: "nume furnizor",
address: "adresa furnizor",
city: "Brasov",
country: "RO"
) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea furnizorilor te rugăm
să consulţi documentaţia interactivă.
Modificare furnizor
mutation {
updateSupplier(
id: "10",
name: "nume nou",
country: "RO",
uid: "3987985"
) {
id
name
email
uid
country {
iso
}
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea furnizorilor te rugăm
să consulţi documentaţia interactivă.
Ștergere furnizor
mutation {
deleteSupplier(id: "10") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea furnizorilor te rugăm
să consulţi documentaţia interactivă.
1. Resurse si URL-uri
Noul API
factureaza.ro
este un API
GraphQL.
Îţi permite accesul flexibil la datele tale pe baza unui "query" prin care specifici exact
datele care vrei să ţi se returneze. În mod similar poţi efetua şi operaţii de creare, editare şi ştergere a
tuturor datelor relvante.
Documentaţia oficială GraphQL o găseşti
aici.
Pentru exemplele din limbajul Ruby am folosit gem-ul "graphql", "~> 1.10". Cu versiunea 2, sau mai noi pot apărea diverse erori.
2. Sistem sandbox pentru testarea API GRAPHQL
Pentru testarea funcțiilor API-ul
factureaza.ro
îţi punem la dispoziţie un sistem sandbox.
Acesta este disponibil la adresa:
https://sandbox.factureaza.ro
Cheia API pentru teste:
72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965
Datele de acces pentru intefaţa umană corespunzătoare utilizatorului cu cheia API de mai sus:
3. Autentificare
Cheia API este definită per utilizator și se poate (re)genera din contul tău
factureaza.ro
, la punctul “Contul meu” -> “Cheie API”
Sunt disponibile două metode de autentificare:
-
HTTP Authentication
(se va folosi cheia API ca username, parola fiind ignorată)
-
Parametru api_key
adăugat fiecărui request.
4. Rezultate și erori
Rezultatul unui request semnalează prin status-ul HTTP returnat:
- 200 Success (după un request GET, PUT, sau DELETE reușit)
- 201 Created (după un request POST reușit)
- 400 Resource Invalid (request formatat greșit)
- 401 Unauthorized
- 404 Resource Not Found
- 405 Method Not Allowed (Verbul HTTP folosit nu este acceptat pentru această resursă)
- 422 Unprocessable Entity (Request-ul a fost sintactic corect, dar modificările cerute nu sunt valide)
- 500 Application Error (Eroare în sistem)
- Pentru cereri corecte sintactic, dar care nu îndeplinesc criteriile de validare ale sistemului, erorile vor fi returnate in corpul răspunsului.
5. Câmpuri și tipuri de date
Detalii despre datele returnate se pot vedea activând interfaţa de testare interactivă
şi căutând după numele modelului sau al câmpului dorit în Documentation Explorer.
Click aici pentru un exemplu.
-
formatul pentru dată este:
AAAA-LL-ZZ
-
valori boolean vor fi reprezentate cu:
true / false
6. Exemple query-uri
Exemplele de mai jos surprind doar câteva dintre posibilele câmpuri care se pot interoga.
Pentru lista completă a tuturor câmpurilor, relaţiilor şi obiectelor imbricate te rugăm să
consulţi documentaţia interactivă.
Click aici pentru un exemplu.
6.1. Contul tău (Model Account)
Detalii despre contul tău
{
account {
id
name
companyAddress1
companyCity
companyFax
companyUid
companyName
companyState
totalOpen
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a contului tău te rugăm
să consulţi documentaţia interactivă.
6.2. Clienţi (Model Client)
Detalii client
{
clients(id: "1064116436") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a clienților te rugăm
să consulţi documentaţia interactivă.
Listare clienți
{
clients(limit: 1, offset: 1) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a clienților te rugăm
să consulţi documentaţia interactivă.
Căutare clienți
{
clients(id: "1064115995", name: "nume client", email: "client_name@random.ro") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea clienților te rugăm
să consulţi documentaţia interactivă.
Filtrare clienți
{
clients(where: "{\"_eq\": {\"name\": \"nume client\", \"email\": \"client_name@random.ro\"}}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare clienți
{
clients(orderBy: "{\"email\": \"desc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare clienți
{
clients(orderBy: "{\"email\": \"asc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Adăugare client
mutation {
createClient(
uid: "12345678",
name: "nume client",
address: "adresa client",
city: "Brasov",
country: "RO"
) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea clienților te rugăm
să consulţi documentaţia interactivă.
Modificare client
mutation {
updateClient(
id: "1064116436",
name: "nume nou",
country: "RO",
uid: "3987985"
) {
id
name
email
uid
country
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea clienților te rugăm
să consulţi documentaţia interactivă.
Ștergere client
mutation {
deleteClient(id: "1064116436") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea clienților te rugăm
să consulţi documentaţia interactivă.
6.3. Serii facturi (Model Invoice Series)
Detalii serie facturi
{
invoiceSeries(id: "1061104755") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Listare serii facturi
{
invoiceSeries(limit: 1, offset: 1) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Căutare serii facturi
{
invoiceSeries(year: "2021", counterStart: "0", prefix: "HOS") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Filtrare serii facturi
{
invoiceSeries(where: "{\"_lte\": {\"year\": \"2036\"}}") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Ștergere serie facturi
mutation {
deleteInvoiceSeries(id: "1061104755") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Adăugare serie facturi
mutation {
createInvoiceSeries(
counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Modificare serie facturi
mutation {
updateInvoiceSeries(
id: "1061104755",
prefix: "SER"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
6.4. Facturi (Model Invoice)
Detalii facturi
{
invoices(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
lowerAnnotation
upperAnnotation
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Listare facturi
{
invoices(limit: 1, offset: 1) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
lowerAnnotation
upperAnnotation
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Căutare facturi
{
invoices(documentSeriesId: "1061104746") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate căutare a facturilor te rugăm
să consulţi documentaţia interactivă.
Filtrare facturi
{
invoices(where: "{\"_eq\": {\"cachedTotal\": \"145.2\", \"vatType\": \"1\"}}") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate filtrare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"desc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"asc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ștergere facturi
mutation {
deleteInvoice(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea facturilor te rugăm
să consulţi documentaţia interactivă.
Adăugare facturi
mutation {
createInvoice(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104746",
documentDate: "2023-07-06",
exchangeRate: "4.55",
lowerAnnotation: "exemplu note subsol",
upperAnnotation: "exemplu note antet",
documentSeriesCounter: "469",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea facturilor te rugăm
să consulţi documentaţia interactivă.
Modificare facturi
mutation {
updateInvoice(
id: "1065255630",
exchangeRate: "4.5",
currency: "RON",
documentPositions: [{
description: "produs",
unit: "-",
unitCount: "1",
total: "0.0",
productCode: "none",
vat: "20.0",
position: "0"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
exchangeRate
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea facturilor te rugăm
să consulţi documentaţia interactivă.
Convertește factura în format PDF codificat ca Base64 (funcționează pt toate tipurile de documente)
{
invoices(id: "1065255630") {
id
pdfContent
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate convertirea facturilor în format PDF te rugăm
să consulţi documentaţia interactivă.
Trimite factura pe e-mail
mutation {
sendDocument(to: "random_email@random_service.domain", documentId: "1065255630", body: "your invoice", bcc: "random_email2@random_service.domain") {
id
description
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru trimiterea facturilor te rugăm
să consulţi documentaţia interactivă.
Export în format xml UBL pentru e-Factura
mutation {
exportInvoiceEfacturaUbl(
id: "1065255630",
invoiceNotes: "invoice note example",
invoiceTypeCode: "380",
paymentMethod: "1",
vatType: "S",
efacturaClassificationCodeAttributes: [{
documentPositionId: "1056079721",
schemeIdentifier: "STI",
classificationCode: "cltestcode"
}],
efacturaDocumentPositionUnitsAttributes: [{
documentPositionUnits: "ore",
documentPositionDescriptions: "HUR"
}, {
documentPositionUnits: "buc.",
documentPositionDescriptions: "H87"
}]
) {
xml
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate exportul facturilor în format xml UBL pentru e-Factura te rugăm
să consulţi documentaţia interactivă.
Valorile pentru diferite câmpuri se pot găsi:
-
invoiceTypeCode aici .
-
paymentMethod aici .
-
vatType aici .
-
vatExemptionReason aici .
-
paymentMethod aici .
-
alte coduri necesare aici .
Diverse valori, reguli sau constrângeri specifice pentru e-Factura se regăsesc aici .
Mai multe detalii în documentația oficială e-Factura de la ANAF .
1. Resurse si URL-uri
Noul API
factureaza.ro
este un API
GraphQL.
Îţi permite accesul flexibil la datele tale pe baza unui "query" prin care specifici exact
datele care vrei să ţi se returneze. În mod similar poţi efetua şi operaţii de creare, editare şi ştergere a
tuturor datelor relvante.
Documentaţia oficială GraphQL o găseşti
aici.
Pentru exemplele din limbajul Ruby am folosit gem-ul "graphql", "~> 1.10". Cu versiunea 2, sau mai noi pot apărea diverse erori.
2. Sistem sandbox pentru testarea API GRAPHQL
Pentru testarea funcțiilor API-ul
factureaza.ro
îţi punem la dispoziţie un sistem sandbox.
Acesta este disponibil la adresa:
https://sandbox.factureaza.ro
Cheia API pentru teste:
72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965
Datele de acces pentru intefaţa umană corespunzătoare utilizatorului cu cheia API de mai sus:
3. Autentificare
Cheia API este definită per utilizator și se poate (re)genera din contul tău
factureaza.ro
, la punctul “Contul meu” -> “Cheie API”
Sunt disponibile două metode de autentificare:
-
HTTP Authentication
(se va folosi cheia API ca username, parola fiind ignorată)
-
Parametru api_key
adăugat fiecărui request.
4. Rezultate și erori
Rezultatul unui request semnalează prin status-ul HTTP returnat:
- 200 Success (după un request GET, PUT, sau DELETE reușit)
- 201 Created (după un request POST reușit)
- 400 Resource Invalid (request formatat greșit)
- 401 Unauthorized
- 404 Resource Not Found
- 405 Method Not Allowed (Verbul HTTP folosit nu este acceptat pentru această resursă)
- 422 Unprocessable Entity (Request-ul a fost sintactic corect, dar modificările cerute nu sunt valide)
- 500 Application Error (Eroare în sistem)
- Pentru cereri corecte sintactic, dar care nu îndeplinesc criteriile de validare ale sistemului, erorile vor fi returnate in corpul răspunsului.
5. Câmpuri și tipuri de date
Detalii despre datele returnate se pot vedea activând interfaţa de testare interactivă
şi căutând după numele modelului sau al câmpului dorit în Documentation Explorer.
Click aici pentru un exemplu.
-
formatul pentru dată este:
AAAA-LL-ZZ
-
valori boolean vor fi reprezentate cu:
true / false
6. Exemple query-uri
Exemplele de mai jos surprind doar câteva dintre posibilele câmpuri care se pot interoga.
Pentru lista completă a tuturor câmpurilor, relaţiilor şi obiectelor imbricate te rugăm să
consulţi documentaţia interactivă.
Click aici pentru un exemplu.
6.1. Contul tău (Model Account)
Detalii despre contul tău
{
account {
id
name
companyAddress1
companyCity
companyFax
companyUid
companyName
companyState
totalOpen
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a contului tău te rugăm
să consulţi documentaţia interactivă.
6.2. Clienţi (Model Client)
Detalii client
{
clients(id: "1064116436") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a clienților te rugăm
să consulţi documentaţia interactivă.
Listare clienți
{
clients(limit: 1, offset: 1) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a clienților te rugăm
să consulţi documentaţia interactivă.
Căutare clienți
{
clients(id: "1064115995", name: "nume client", email: "client_name@random.ro") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea clienților te rugăm
să consulţi documentaţia interactivă.
Filtrare clienți
{
clients(where: "{\"_eq\": {\"name\": \"nume client\", \"email\": \"client_name@random.ro\"}}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare clienți
{
clients(orderBy: "{\"email\": \"desc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare clienți
{
clients(orderBy: "{\"email\": \"asc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Adăugare client
mutation {
createClient(
uid: "12345678",
name: "nume client",
address: "adresa client",
city: "Brasov",
country: "RO"
) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea clienților te rugăm
să consulţi documentaţia interactivă.
Modificare client
mutation {
updateClient(
id: "1064116436",
name: "nume nou",
country: "RO",
uid: "3987985"
) {
id
name
email
uid
country
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea clienților te rugăm
să consulţi documentaţia interactivă.
Ștergere client
mutation {
deleteClient(id: "1064116436") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea clienților te rugăm
să consulţi documentaţia interactivă.
6.3. Serii facturi (Model Invoice Series)
Detalii serie facturi
{
invoiceSeries(id: "1061104755") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Listare serii facturi
{
invoiceSeries(limit: 1, offset: 1) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Căutare serii facturi
{
invoiceSeries(year: "2021", counterStart: "0", prefix: "HOS") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Filtrare serii facturi
{
invoiceSeries(where: "{\"_lte\": {\"year\": \"2036\"}}") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Ștergere serie facturi
mutation {
deleteInvoiceSeries(id: "1061104755") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Adăugare serie facturi
mutation {
createInvoiceSeries(
counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Modificare serie facturi
mutation {
updateInvoiceSeries(
id: "1061104755",
prefix: "SER"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
6.4. Facturi (Model Invoice)
Detalii facturi
{
invoices(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
lowerAnnotation
upperAnnotation
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Listare facturi
{
invoices(limit: 1, offset: 1) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
lowerAnnotation
upperAnnotation
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Căutare facturi
{
invoices(documentSeriesId: "1061104746") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate căutare a facturilor te rugăm
să consulţi documentaţia interactivă.
Filtrare facturi
{
invoices(where: "{\"_eq\": {\"cachedTotal\": \"145.2\", \"vatType\": \"1\"}}") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate filtrare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"desc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"asc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ștergere facturi
mutation {
deleteInvoice(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea facturilor te rugăm
să consulţi documentaţia interactivă.
Adăugare facturi
mutation {
createInvoice(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104746",
documentDate: "2023-07-06",
exchangeRate: "4.55",
lowerAnnotation: "exemplu note subsol",
upperAnnotation: "exemplu note antet",
documentSeriesCounter: "469",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea facturilor te rugăm
să consulţi documentaţia interactivă.
Modificare facturi
mutation {
updateInvoice(
id: "1065255630",
exchangeRate: "4.5",
currency: "RON",
documentPositions: [{
description: "produs",
unit: "-",
unitCount: "1",
total: "0.0",
productCode: "none",
vat: "20.0",
position: "0"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
exchangeRate
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea facturilor te rugăm
să consulţi documentaţia interactivă.
Convertește factura în format PDF codificat ca Base64 (funcționează pt toate tipurile de documente)
{
invoices(id: "1065255630") {
id
pdfContent
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate convertirea facturilor în format PDF te rugăm
să consulţi documentaţia interactivă.
Trimite factura pe e-mail
mutation {
sendDocument(to: "random_email@random_service.domain", documentId: "1065255630", body: "your invoice", bcc: "random_email2@random_service.domain") {
id
description
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru trimiterea facturilor te rugăm
să consulţi documentaţia interactivă.
Export în format xml UBL pentru e-Factura
mutation {
exportInvoiceEfacturaUbl(
id: "1065255630",
invoiceNotes: "invoice note example",
invoiceTypeCode: "380",
paymentMethod: "1",
vatType: "S",
efacturaClassificationCodeAttributes: [{
documentPositionId: "1056079721",
schemeIdentifier: "STI",
classificationCode: "cltestcode"
}],
efacturaDocumentPositionUnitsAttributes: [{
documentPositionUnits: "ore",
documentPositionDescriptions: "HUR"
}, {
documentPositionUnits: "buc.",
documentPositionDescriptions: "H87"
}]
) {
xml
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate exportul facturilor în format xml UBL pentru e-Factura te rugăm
să consulţi documentaţia interactivă.
Valorile pentru diferite câmpuri se pot găsi:
-
invoiceTypeCode aici .
-
paymentMethod aici .
-
vatType aici .
-
vatExemptionReason aici .
-
paymentMethod aici .
-
alte coduri necesare aici .
Diverse valori, reguli sau constrângeri specifice pentru e-Factura se regăsesc aici .
Mai multe detalii în documentația oficială e-Factura de la ANAF .
1. Resurse si URL-uri
Noul API
factureaza.ro
este un API
GraphQL.
Îţi permite accesul flexibil la datele tale pe baza unui "query" prin care specifici exact
datele care vrei să ţi se returneze. În mod similar poţi efetua şi operaţii de creare, editare şi ştergere a
tuturor datelor relvante.
Documentaţia oficială GraphQL o găseşti
aici.
Pentru exemplele din limbajul Ruby am folosit gem-ul "graphql", "~> 1.10". Cu versiunea 2, sau mai noi pot apărea diverse erori.
2. Sistem sandbox pentru testarea API GRAPHQL
Pentru testarea funcțiilor API-ul
factureaza.ro
îţi punem la dispoziţie un sistem sandbox.
Acesta este disponibil la adresa:
https://sandbox.factureaza.ro
Cheia API pentru teste:
72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965
Datele de acces pentru intefaţa umană corespunzătoare utilizatorului cu cheia API de mai sus:
3. Autentificare
Cheia API este definită per utilizator și se poate (re)genera din contul tău
factureaza.ro
, la punctul “Contul meu” -> “Cheie API”
Sunt disponibile două metode de autentificare:
-
HTTP Authentication
(se va folosi cheia API ca username, parola fiind ignorată)
-
Parametru api_key
adăugat fiecărui request.
4. Rezultate și erori
Rezultatul unui request semnalează prin status-ul HTTP returnat:
- 200 Success (după un request GET, PUT, sau DELETE reușit)
- 201 Created (după un request POST reușit)
- 400 Resource Invalid (request formatat greșit)
- 401 Unauthorized
- 404 Resource Not Found
- 405 Method Not Allowed (Verbul HTTP folosit nu este acceptat pentru această resursă)
- 422 Unprocessable Entity (Request-ul a fost sintactic corect, dar modificările cerute nu sunt valide)
- 500 Application Error (Eroare în sistem)
- Pentru cereri corecte sintactic, dar care nu îndeplinesc criteriile de validare ale sistemului, erorile vor fi returnate in corpul răspunsului.
5. Câmpuri și tipuri de date
Detalii despre datele returnate se pot vedea activând interfaţa de testare interactivă
şi căutând după numele modelului sau al câmpului dorit în Documentation Explorer.
Click aici pentru un exemplu.
-
formatul pentru dată este:
AAAA-LL-ZZ
-
valori boolean vor fi reprezentate cu:
true / false
6. Exemple query-uri
Exemplele de mai jos surprind doar câteva dintre posibilele câmpuri care se pot interoga.
Pentru lista completă a tuturor câmpurilor, relaţiilor şi obiectelor imbricate te rugăm să
consulţi documentaţia interactivă.
Click aici pentru un exemplu.
6.1. Contul tău (Model Account)
Detalii despre contul tău
{
account {
id
name
companyAddress1
companyCity
companyFax
companyUid
companyName
companyState
totalOpen
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a contului tău te rugăm
să consulţi documentaţia interactivă.
6.2. Clienţi (Model Client)
Detalii client
{
clients(id: "1064116436") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a clienților te rugăm
să consulţi documentaţia interactivă.
Listare clienți
{
clients(limit: 1, offset: 1) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a clienților te rugăm
să consulţi documentaţia interactivă.
Căutare clienți
{
clients(id: "1064115995", name: "nume client", email: "client_name@random.ro") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea clienților te rugăm
să consulţi documentaţia interactivă.
Filtrare clienți
{
clients(where: "{\"_eq\": {\"name\": \"nume client\", \"email\": \"client_name@random.ro\"}}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare clienți
{
clients(orderBy: "{\"email\": \"desc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare clienți
{
clients(orderBy: "{\"email\": \"asc\"}") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ordonarea clienților te rugăm
să consulţi documentaţia interactivă.
Adăugare client
mutation {
createClient(
uid: "12345678",
name: "nume client",
address: "adresa client",
city: "Brasov",
country: "RO"
) {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea clienților te rugăm
să consulţi documentaţia interactivă.
Modificare client
mutation {
updateClient(
id: "1064116436",
name: "nume nou",
country: "RO",
uid: "3987985"
) {
id
name
email
uid
country
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea clienților te rugăm
să consulţi documentaţia interactivă.
Ștergere client
mutation {
deleteClient(id: "1064116436") {
id
name
email
uid
address
city
zip
state
telephone
zip
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea clienților te rugăm
să consulţi documentaţia interactivă.
6.3. Serii facturi (Model Invoice Series)
Detalii serie facturi
{
invoiceSeries(id: "1061104755") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Listare serii facturi
{
invoiceSeries(limit: 1, offset: 1) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Căutare serii facturi
{
invoiceSeries(year: "2021", counterStart: "0", prefix: "HOS") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru căutarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Filtrare serii facturi
{
invoiceSeries(where: "{\"_lte\": {\"year\": \"2036\"}}") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru filtrarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Ștergere serie facturi
mutation {
deleteInvoiceSeries(id: "1061104755") {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Adăugare serie facturi
mutation {
createInvoiceSeries(
counterStart: "1",
counterCurrent: "422",
year: "2024",
prefix: "qwerty"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
Modificare serie facturi
mutation {
updateInvoiceSeries(
id: "1061104755",
prefix: "SER"
) {
id
createdAt
counterStart
counterCurrent
prefix
year
sepparator
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea seriilor de facturi te rugăm
să consulţi documentaţia interactivă.
6.4. Facturi (Model Invoice)
Detalii facturi
{
invoices(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
lowerAnnotation
upperAnnotation
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Listare facturi
{
invoices(limit: 1, offset: 1) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
lowerAnnotation
upperAnnotation
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate a facturilor te rugăm
să consulţi documentaţia interactivă.
Căutare facturi
{
invoices(documentSeriesId: "1061104746") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate căutare a facturilor te rugăm
să consulţi documentaţia interactivă.
Filtrare facturi
{
invoices(where: "{\"_eq\": {\"cachedTotal\": \"145.2\", \"vatType\": \"1\"}}") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate filtrare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare descrescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"desc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ordonare crescatoare facturi
{
invoices(orderBy: "{\"createdAt\": \"asc\"}") {
id
lowerAnnotation
upperAnnotation
documentState
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate ordonare a facturilor te rugăm
să consulţi documentaţia interactivă.
Ștergere facturi
mutation {
deleteInvoice(id: "1065255630") {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru ștergerea facturilor te rugăm
să consulţi documentaţia interactivă.
Adăugare facturi
mutation {
createInvoice(
currency: "RON",
clientId: "1064116436",
documentSeriesId: "1061104746",
documentDate: "2023-07-06",
exchangeRate: "4.55",
lowerAnnotation: "exemplu note subsol",
upperAnnotation: "exemplu note antet",
documentSeriesCounter: "469",
vatType: "1",
delegateId: "525664463",
displayTransportData: "1",
documentPositions: [{
description: "ABONAMENT BASIC",
unit: "luni",
unitCount: "12",
price: "12",
productCode: "66XXH663496H",
vat: "19"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru adăugarea facturilor te rugăm
să consulţi documentaţia interactivă.
Modificare facturi
mutation {
updateInvoice(
id: "1065255630",
exchangeRate: "4.5",
currency: "RON",
documentPositions: [{
description: "produs",
unit: "-",
unitCount: "1",
total: "0.0",
productCode: "none",
vat: "20.0",
position: "0"
}]) {
id
createdAt
type
accountBanks
clientId
clientUid
clientName
exchangeRate
currency
documentPositions {
id
price
position
total
type
}
receipts {
id
amount
clientId
clientUid
clientName
delegateId
delegateLastName
delegateFirstName
}
inputCurrency
payments {
id
paymentDate
paymentType
description
createdAt
currency
}
actionEvents {
id
description
action
}
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru modificarea facturilor te rugăm
să consulţi documentaţia interactivă.
Convertește factura în format PDF codificat ca Base64 (funcționează pt toate tipurile de documente)
{
invoices(id: "1065255630") {
id
pdfContent
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate convertirea facturilor în format PDF te rugăm
să consulţi documentaţia interactivă.
Trimite factura pe e-mail
mutation {
sendDocument(to: "random_email@random_service.domain", documentId: "1065255630", body: "your invoice", bcc: "random_email2@random_service.domain") {
id
description
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate pentru trimiterea facturilor te rugăm
să consulţi documentaţia interactivă.
Export în format xml UBL pentru e-Factura
mutation {
exportInvoiceEfacturaUbl(
id: "1065255630",
invoiceNotes: "invoice note example",
invoiceTypeCode: "380",
paymentMethod: "1",
vatType: "S",
efacturaClassificationCodeAttributes: [{
documentPositionId: "1056079721",
schemeIdentifier: "STI",
classificationCode: "cltestcode"
}],
efacturaDocumentPositionUnitsAttributes: [{
documentPositionUnits: "ore",
documentPositionDescriptions: "HUR"
}, {
documentPositionUnits: "buc.",
documentPositionDescriptions: "H87"
}]
) {
xml
}
}
curl -i -H 'Content-Type: application/json' -u 72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965:x -X POST -d '{"query": "{{code_example}}"}' https://sandbox.factureaza.ro/graphql
<?php
require_once('graphql-settings.php');
define('BASE_URL', 'https://sandbox.factureaza.ro/graphql');
define('API_KEY', '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965');
$ch = curl_init();
require_once('graphql-functions.php');
$url = BASE_URL;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, API_KEY . ":x");
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"query": "{{code_example}}"}');
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($httpCode . "\n" . $result . "\n");
curl_close($ch);
#!/usr/bin/env ruby
# graphql gem version needed: "graphql", "~> 1.10"
require "base64"
require 'graphlient'
base_url = 'https://sandbox.factureaza.ro/graphql'
api_key = '72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965'
encoded_credentials = ::Base64.strict_encode64("#{api_key}:")
headers = { Authorization: "Basic #{encoded_credentials}" }
graphql_client = Graphlient::Client.new(base_url, { headers: headers })
query_string = <<~GRAPHQL
{{code_example}}
GRAPHQL
response = graphql_client.query query_string
puts response.data.to_h
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Text;
namespace c_
{
class Program
{
static void Main(string[] args)
{
var query = "{{code_example}}";
var baseUri = "https://sandbox.factureaza.ro/graphql";
var apiKey = "72543f4dc00474bc40a27916d172eb93339fae894ec7a6f2dceb4751d965";
var queryParams = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("query", query)
});
var client = new HttpClient();
var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey + ":"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeader);
var response = client.PostAsync(baseUri, queryParams).Result;
var responseString = response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
System.Console.WriteLine(response);
System.Console.WriteLine(responseString.ToString());
foreach (var character in responseString.Result)
System.Console.Write(character);
System.Console.WriteLine();
}
}
}
}
import java.net.*;
import java.io.*;
import java.util.*;
import java.nio.charset.StandardCharsets;
public class Graph {
public static void main(String[] args) throws MalformedURLException {
String query = "{\"query\":\"{{code_example}} \" }";
byte[] postData = query.getBytes(StandardCharsets.UTF_8);
String apiKey = "743b27b9e2ba33269bca4506f858637739fca1f60562132c5b5463e40e4a";
URL serverUrl = new URL("https://sandbox.factureaza.ro/graphql");
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
BufferedReader httpResponseReader = null;
try {
HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.addRequestProperty("Authorization", basicAuthPayload);
try (DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream())) {
wr.write(postData);
wr.flush();
wr.close();
}
httpResponseReader =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String lineRead;
while((lineRead = httpResponseReader.readLine()) != null) {
System.out.println(lineRead);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (httpResponseReader != null) {
try {
httpResponseReader.close();
} catch (IOException ioe) {
// Close quietly
}
}
}
}
}
Pentru o listă completă a câmpurilor, relaţiilor şi obiectelor imbricate exportul facturilor în format xml UBL pentru e-Factura te rugăm
să consulţi documentaţia interactivă.
Valorile pentru diferite câmpuri se pot găsi:
-
invoiceTypeCode aici .
-
paymentMethod aici .
-
vatType aici .
-
vatExemptionReason aici .
-
paymentMethod aici .
-
alte coduri necesare aici .
Diverse valori, reguli sau constrângeri specifice pentru e-Factura se regăsesc aici .
Mai multe detalii în documentația oficială e-Factura de la ANAF .