curl -X POST https://simplewebapis.com/api/quote \
-H "Content-Type: application/json" \
-H "X-Api-Key: swa_your_key" \
-d '{
"quoteNumber": 1001,
"issueDate": "2025-01-15",
"validUntilDate": "2025-02-15",
"seller": { "name": "Acme Corp", "addressLines": ["123 Seller St", "San Francisco, CA 94105"], "email": "[email protected]" },
"customer": { "name": "Globex Inc", "addressLines": ["456 Customer Ave", "New York, NY 10001"], "email": "[email protected]" },
"items": [
{ "name": "Web Development", "price": 1500.00, "quantity": 1 },
{ "name": "UI Design", "price": 800.00, "quantity": 2 }
],
"taxRate": 0.2,
"discountRate": 0.1,
"notes": "Quote valid for 30 days from issue date.",
"terms": "Payment due within 14 days of acceptance.",
"currency": "USD",
"logoUrl": "https://simplewebapis.com/favicon-32x32.png",
"accentColor": "#2563EB",
"separatorColor": "#E5E7EB",
"notesBackgroundColor": "#F9FAFB"
}' --output quote.pdf
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "swa_your_key");
var payload = new
{
quoteNumber = 1001,
issueDate = "2025-01-15",
validUntilDate = "2025-02-15",
seller = new { name = "Acme Corp", addressLines = new[] { "123 Seller St", "San Francisco, CA 94105" }, email = "[email protected]" },
customer = new { name = "Globex Inc", addressLines = new[] { "456 Customer Ave", "New York, NY 10001" }, email = "[email protected]" },
items = new[]
{
new { name = "Web Development", price = 1500.00m, quantity = 1 },
new { name = "UI Design", price = 800.00m, quantity = 2 }
},
taxRate = 0.2m,
discountRate = 0.1m,
notes = "Quote valid for 30 days from issue date.",
terms = "Payment due within 14 days of acceptance.",
Currency = "USD",
LogoUrl = "https://simplewebapis.com/favicon-32x32.png",
accentColor = "#2563EB",
separatorColor = "#E5E7EB",
notesBackgroundColor = "#F9FAFB"
};
var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://simplewebapis.com/api/quote", content);
var pdfBytes = await response.Content.ReadAsByteArrayAsync();
await File.WriteAllBytesAsync("quote.pdf", pdfBytes);
$payload = json_encode([
'quoteNumber' => 1001,
'issueDate' => '2025-01-15',
'validUntilDate' => '2025-02-15',
'seller' => ['name' => 'Acme Corp', 'addressLines' => ['123 Seller St', 'San Francisco, CA 94105'], 'email' => '[email protected]'],
'customer' => ['name' => 'Globex Inc', 'addressLines' => ['456 Customer Ave', 'New York, NY 10001'], 'email' => '[email protected]'],
'items' => [
['name' => 'Web Development', 'price' => 1500.00, 'quantity' => 1],
['name' => 'UI Design', 'price' => 800.00, 'quantity' => 2],
],
'taxRate' => 0.2,
'discountRate' => 0.1,
'notes' => 'Quote valid for 30 days from issue date.',
'terms' => 'Payment due within 14 days of acceptance.',
'currency' => 'USD',
'logoUrl' => 'https://simplewebapis.com/favicon-32x32.png',
'accentColor' => '#2563EB',
'separatorColor' => '#E5E7EB',
'notesBackgroundColor' => '#F9FAFB',
]);
$ch = curl_init('https://simplewebapis.com/api/quote');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Api-Key: swa_your_key',
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
]);
$pdf = curl_exec($ch);
curl_close($ch);
file_put_contents('quote.pdf', $pdf);
const response = await fetch('https://simplewebapis.com/api/quote', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': 'swa_your_key',
},
body: JSON.stringify({
quoteNumber: 1001,
issueDate: '2025-01-15',
validUntilDate: '2025-02-15',
seller: { name: 'Acme Corp', addressLines: ['123 Seller St', 'San Francisco, CA 94105'], email: '[email protected]' },
customer: { name: 'Globex Inc', addressLines: ['456 Customer Ave', 'New York, NY 10001'], email: '[email protected]' },
items: [
{ name: 'Web Development', price: 1500.00, quantity: 1 },
{ name: 'UI Design', price: 800.00, quantity: 2 },
],
taxRate: 0.2,
discountRate: 0.1,
notes: 'Quote valid for 30 days from issue date.',
terms: 'Payment due within 14 days of acceptance.',
currency: 'USD',
logoUrl: 'https://simplewebapis.com/favicon-32x32.png',
accentColor: '#2563EB',
separatorColor: '#E5E7EB',
notesBackgroundColor: '#F9FAFB',
}),
});
const buffer = await response.arrayBuffer();
const fs = require('fs');
fs.writeFileSync('quote.pdf', Buffer.from(buffer));
import requests
response = requests.post(
'https://simplewebapis.com/api/quote',
headers={
'Content-Type': 'application/json',
'X-Api-Key': 'swa_your_key',
},
json={
'quoteNumber': 1001,
'issueDate': '2025-01-15',
'validUntilDate': '2025-02-15',
'seller': {'name': 'Acme Corp', 'addressLines': ['123 Seller St', 'San Francisco, CA 94105'], 'email': '[email protected]'},
'customer': {'name': 'Globex Inc', 'addressLines': ['456 Customer Ave', 'New York, NY 10001'], 'email': '[email protected]'},
'items': [
{'name': 'Web Development', 'price': 1500.00, 'quantity': 1},
{'name': 'UI Design', 'price': 800.00, 'quantity': 2},
],
'taxRate': 0.2,
'discountRate': 0.1,
'notes': 'Quote valid for 30 days from issue date.',
'terms': 'Payment due within 14 days of acceptance.',
'currency': 'USD',
'logoUrl': 'https://simplewebapis.com/favicon-32x32.png',
'accentColor': '#2563EB',
'separatorColor': '#E5E7EB',
'notesBackgroundColor': '#F9FAFB',
},
)
with open('quote.pdf', 'wb') as f:
f.write(response.content)
payload := map[string]interface{}{
"quoteNumber": 1001,
"issueDate": "2025-01-15",
"validUntilDate": "2025-02-15",
"seller": map[string]interface{}{
"name": "Acme Corp",
"addressLines": []string{"123 Seller St", "San Francisco, CA 94105"},
"email": "[email protected]",
},
"customer": map[string]interface{}{
"name": "Globex Inc",
"addressLines": []string{"456 Customer Ave", "New York, NY 10001"},
"email": "[email protected]",
},
"items": []map[string]interface{}{
{"name": "Web Development", "price": 1500.00, "quantity": 1},
{"name": "UI Design", "price": 800.00, "quantity": 2},
},
"taxRate": 0.2,
"discountRate": 0.1,
"notes": "Quote valid for 30 days from issue date.",
"terms": "Payment due within 14 days of acceptance.",
"currency": "USD",
"logoUrl": "https://simplewebapis.com/favicon-32x32.png",
"accentColor": "#2563EB",
"separatorColor": "#E5E7EB",
"notesBackgroundColor": "#F9FAFB",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://simplewebapis.com/api/quote",
bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "swa_your_key")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
os.WriteFile("quote.pdf", body, 0644)
require 'net/http'
require 'json'
require 'uri'
payload = {
quoteNumber: 1001,
issueDate: '2025-01-15',
validUntilDate: '2025-02-15',
seller: { name: 'Acme Corp', addressLines: ['123 Seller St', 'San Francisco, CA 94105'], email: '[email protected]' },
customer: { name: 'Globex Inc', addressLines: ['456 Customer Ave', 'New York, NY 10001'], email: '[email protected]' },
items: [
{ name: 'Web Development', price: 1500.00, quantity: 1 },
{ name: 'UI Design', price: 800.00, quantity: 2 },
],
taxRate: 0.2,
discountRate: 0.1,
notes: 'Quote valid for 30 days from issue date.',
terms: 'Payment due within 14 days of acceptance.',
currency: 'USD',
logo_url: 'https://simplewebapis.com/favicon-32x32.png',
accentColor: '#2563EB',
separatorColor: '#E5E7EB',
notesBackgroundColor: '#F9FAFB',
}
uri = URI('https://simplewebapis.com/api/quote')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req['X-Api-Key'] = 'swa_your_key'
req.body = payload.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
File.binwrite('quote.pdf', response.body)
var payload = """
{
"quoteNumber": 1001,
"issueDate": "2025-01-15",
"validUntilDate": "2025-02-15",
"seller": { "name": "Acme Corp", "addressLines": ["123 Seller St", "San Francisco, CA 94105"], "email": "[email protected]" },
"customer": { "name": "Globex Inc", "addressLines": ["456 Customer Ave", "New York, NY 10001"], "email": "[email protected]" },
"items": [
{ "name": "Web Development", "price": 1500.00, "quantity": 1 },
{ "name": "UI Design", "price": 800.00, "quantity": 2 }
],
"taxRate": 0.2,
"discountRate": 0.1,
"notes": "Quote valid for 30 days from issue date.",
"terms": "Payment due within 14 days of acceptance.",
"currency": "USD",
"logoUrl": "https://simplewebapis.com/favicon-32x32.png",
"accentColor": "#2563EB",
"separatorColor": "#E5E7EB",
"notesBackgroundColor": "#F9FAFB"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://simplewebapis.com/api/quote"))
.header("Content-Type", "application/json")
.header("X-Api-Key", "swa_your_key")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
var response = HttpClient.newHttpClient().send(request,
HttpResponse.BodyHandlers.ofByteArray());
Files.write(Path.of("quote.pdf"), response.body());
use serde_json::json;
use std::fs;
let client = reqwest::Client::new();
let payload = json!({
"quoteNumber": 1001,
"issueDate": "2025-01-15",
"validUntilDate": "2025-02-15",
"seller": { "name": "Acme Corp", "addressLines": ["123 Seller St", "San Francisco, CA 94105"], "email": "[email protected]" },
"customer": { "name": "Globex Inc", "addressLines": ["456 Customer Ave", "New York, NY 10001"], "email": "[email protected]" },
"items": [
{ "name": "Web Development", "price": 1500.00, "quantity": 1 },
{ "name": "UI Design", "price": 800.00, "quantity": 2 }
],
"taxRate": 0.2,
"discountRate": 0.1,
"notes": "Quote valid for 30 days from issue date.",
"terms": "Payment due within 14 days of acceptance.",
"currency": "USD",
"logoUrl": "https://simplewebapis.com/favicon-32x32.png",
"accentColor": "#2563EB",
"separatorColor": "#E5E7EB",
"notesBackgroundColor": "#F9FAFB"
});
let resp = client.post("https://simplewebapis.com/api/quote")
.header("Content-Type", "application/json")
.header("X-Api-Key", "swa_your_key")
.json(&payload)
.send()
.await?;
let bytes = resp.bytes().await?;
fs::write("quote.pdf", &bytes)?;