Docs
Dashboard
On this page

    Invoices

    3 endpoints. Each needs an API key or OAuth token with the scope shown; the key already names its store, so paths start at /v1/store. Generated from the live contract; also in openapi.json.

    Invoices and credit notes issued to buyers, newest first, with totals per currency

    GET/v1/store/invoices

    Or name the store: GET /v1/stores/{storeId}/invoices

    orders:readrole: finance:readlistInvoices

    Parameters

    • fromstring | nullquery
    • tostring | nullquery
    • kind"all" | "invoice" | "credit_note"query
    • qstring | nullquery
    • testboolean | "true" | "false"query
    • cursorstring | nullquery
    • limitinteger | stringquery
    • sort"date" | "number" | "buyer" | "order" | "net" | "tax" | "total"query
    • dir"asc" | "desc"query

    Response InvoiceList

    • itemsInvoiceRow[]required
    • nextCursorstringrequired
    • totalsInvoiceTotalsByCurrency[]required

    Example

    curl "https://api.shopfa.st/v1/store/invoices" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/invoices', {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
      },
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "GET",
        "https://api.shopfa.st/v1/store/invoices",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/invoices", nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    One invoice or credit note as issued

    GET/v1/store/invoices/{invoiceId}

    Or name the store: GET /v1/stores/{storeId}/invoices/{invoiceId}

    orders:readrole: finance:readgetInvoice

    Parameters

    • invoiceIdinv_…pathrequired

    Response GetInvoiceResponse

    • rowInvoiceRowrequired
    • documentInvoiceDocumentrequired

    Example

    curl "https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk', {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
      },
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "GET",
        "https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk", nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    A link to the PDF or the UBL 2.1 (EN 16931) XML

    GET/v1/store/invoices/{invoiceId}/download

    Or name the store: GET /v1/stores/{storeId}/invoices/{invoiceId}/download

    orders:readrole: finance:readdownloadInvoice

    Parameters

    • invoiceIdinv_…pathrequired
    • format"pdf" | "xml"query

    Response DocumentLink

    • urlstringrequired
    • filenamestringrequired
    • expiresAtTimestamprequired

    Example

    curl "https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk/download" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk/download', {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
      },
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "GET",
        "https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk/download",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/invoices/inv_0123456789abcdefghjk/download", nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Was this page helpful?