Confirmer une facture

Quand vous créez une facture par API, elle est dans l'état de brouillon. Vous pouvez donc modifier la facture comme vous le souhaitez.

var myHeaders = new Headers();

myHeaders.append("Authorization", "Bearer <token>");

var formdata = new FormData();

var requestOptions = {
		method: 'POST',
		headers: myHeaders,
		body: formdata,
		redirect: 'follow'
};

fetch("https://api.sinao.app/v1/apps/:appId/invoices/:id", requestOptions)
		.then(response => response.text())
		.then(result => console.log(result))
		.catch(error => console.log('error', error));
{
    "id": 13,
    "number": "FAC000006",
    "delivered_at": null,
    "written_at": "2023-10-11T22:00:02.000000Z",
    "title": null,
    "details": null,
    "reference": null,
    "foreign_currency": null,
    "amount_net_foreign_currency": null,
    "bank_details_id": null,
    "related_quote_id": null,
    "status": "final",
    "customer_email": null,
    "amount": 0,
    "amount_tax": 10000,
    "credit_note_id": null,
    "stocks_are_pending_back": null,
    "payment_period": 30,
    "payment_methods": "virement bancaire, chèque",
    "payment_deadline_at": "2023-11-10T23:00:02.000000Z",
    "author_user_id": 25359,
    "attachment": null,
    "tags": [],
    "legal_notice": null,
    "note": null,
    "imported_at": null,
    "related_recurring_invoice_id": null,
    "sepa_direct_debit_exported_at": null,
    "email_sent_at": null,
    "validated_at": "2023-10-23T13:54:16.000000Z",
    "paid_at": null,
    "columns": {
        "due": "Total TTC",
        "quantity": "Qte",
        "subtotal": "Total HT",
        "designation": "Designation"
    },
    "metadata": {},
    "totals": {
        "due": 10000,
        "subtotal": {
            "total": 0,
            "55": [
                0
            ]
        },
        "taxes": {
            "total": 10000,
            "vat": {
                "total": 10000,
                "0": 10000
            }
        },
        "before_downpayments": {
            "due": 10000,
            "subtotal": {
                "total": 0,
                "55": [
                    0
                ]
            },
            "taxes": {
                "total": 10000,
                "vat": {
                    "total": 10000,
                    "0": 10000
                }
            }
        }
    },
    "email_viewed_at": null,
    "email_complaint_at": null,
    "email_bounced_at": null,
    "yousign_sent_at": null,
    "yousign_signed_at": null,
    "created_at": "2023-10-09T14:04:13.000000Z",
    "updated_at": "2023-10-23T13:54:16.000000Z",
    "contact_infos": {
        "type": "person",
        "id": 3,
        "name": "M. Test Client",
        "address": "",
        "address2": null,
        "location": "",
        "details": null,
        "image": "/services/avatar/M.testclient/M",
        "email": null
    },
    "third_account": false,
    "locale_currency": "EUR",
    "discount": {
        "name": null,
        "amount": null,
        "percent": null
    },
    "vat_exemption": {
        "exempted": false,
        "reason": null,
        "article": null
    },
    "downpayment_request": null,
    "is_late": false,
    "will_be_late_at": "2023-11-10T23:00:02.000000Z",
    "due_date": "2023-11-10T23:00:02.000000Z"
}