Skip to content

Get Invoices List

Endpoint: https://api.youcan.shop/invoices

Method: GET

Required Scopes

  • read-invoices

Query Parameters

  • page: The page number for pagination.
  • limit: The number of invoices to return per page.

Filters:

Apply filters to narrow down the invoice results based on specific criteria, allowing for more targeted data retrieval.

Values:

  • due: Retrieves invoices generated by the system or admin for due amounts.
  • paid: Retrieves invoices that have been paid.
  • credit: Retrieves invoices for purchased credits.

Example:

  • Get Due Invoices:
/invoices?filters[0][field]=type&filters[0][value]=due
  • Get Paid Invoices:
/invoices?filters[0][field]=type&filters[0][value]=paid
  • Get Credit Invoices:
/invoices?filters[0][field]=type&filters[0][value]=credit

Response

[200]

json
{
    "data": [
        {
            "id": "5e3aabfe-7532-4386-9c1b-f1c5011a8775",
            "amount": 10,
            "paid_amount": 0,
            "status": "Pending",
            "payment_gateway": "Stripe",
            "description": "Bought credit $10",
            "created_at": "2024-09-09T15:40:29+00:00",
            "updated_at": "2024-09-09T15:40:29+00:00",
            "paid_at": null,
            "deleted_at": null,
            "links": {
                "pdf": "https://seller-area.youcan.shop/admin/invoices/5e3aabfe-7532-4386-9c1b-f1c5011a8775/download"
            }
        },
        {
            "id": "c2d82e20-8300-4087-a4ad-11c8cea7dbd5",
            "amount": 15.44,
            "paid_amount": 15.44,
            "status": "Paid",
            "payment_gateway": null,
            "description": "Invoice for Sep 2024 Domain",
            "created_at": "2024-09-10T09:23:31+00:00",
            "updated_at": "2024-09-10T09:23:31+00:00",
            "paid_at": "2024-09-10T09:23:31+00:00",
            "deleted_at": null,
            "links": {
                "pdf": "https://seller-area.youcan.shop/admin/invoices/c2d82e20-8300-4087-a4ad-11c8cea7dbd5/download"
            }
        },
        {
            "id": "051436d6-ac70-4b07-b5e0-8d2b6f729159",
            "amount": 27,
            "paid_amount": 27,
            "status": "Paid",
            "payment_gateway": null,
            "description": "Invoice for Sep 2024 Subscription",
            "created_at": "2024-09-23T09:10:53+00:00",
            "updated_at": "2024-09-23T13:43:10+00:00",
            "paid_at": "2024-09-23T09:10:53+00:00",
            "deleted_at": null,
            "links": {
                "pdf": "https://seller-area.youcan.shop/admin/invoices/051436d6-ac70-4b07-b5e0-8d2b6f729159/download"
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 17,
            "count": 3,
            "per_page": 3,
            "current_page": 1,
            "total_pages": 6,
            "links": {
                "next": "https://api.youcan.shop/invoices?limit=3&page=2"
            }
        }
    }
}

Errors

[500]

json
{
    "status": 500,
    "detail": "internal error",
    "meta": []
}