Skip to main content
Create a new invoice from an existing estimate
POST https://services.leadconnectorhq.com/invoices/estimate/{estimateId}/invoice

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

estimateId
string
default:"5f9d6d8b1b2d2c001f2d9e4b"
required
Estimate Id

Body

altId
string
default:"6578278e879ad2646715ba9c"
required
Account Id or Agency Id
altType
string
required
Posibles valores: ‘account’
markAsInvoiced
boolean
default:"True"
required
Mark Estimate as Invoiced
version
string
default:"v2"
Version of the update request Posibles valores: ‘v1’, ‘v2’

Respuestas

estimate
object
required
Estimate details
invoice
object
required
Invoice details
{}
{}
{}
{}

Ejemplo

curl -X POST 'https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/invoice' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "markAsInvoiced": true,
  "version": "v2"
}'
const response = await fetch('https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/invoice', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "markAsInvoiced": true, "version": "v2"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'POST',
    'https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/invoice',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "markAsInvoiced": true, "version": "v2"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/invoice');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'markAsInvoiced': true, 'version': 'v2'}),
]);
$data = json_decode(curl_exec($ch), true);