Skip to main content
POST
/
v1
/
invoices
/
{type}
/
ingest
curl --request POST \
  --url https://api.paypulse.io/v1/invoices/rental/ingest \
  --header 'Authorization: Bearer <token>'
{
  "message": "Rental invoices ingested successfully!",
  "code": 200,
  "data": {
    "invoiceCount": 3
  }
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/azfar-imtiaz/PayPulse-Cloud/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

All requests to this endpoint must include a valid JWT in the Authorization header.
Authorization: Bearer <token>

Path parameters

type
string
required
The invoice type. Must be rental for this endpoint.

What this endpoint does

This endpoint connects to the user’s Gmail account via the stored OAuth tokens, searches for rental invoice emails matching the configured sender and subject, and uploads any previously unseen invoice PDF attachments to S3. It skips invoices for months that have already been processed. The Gmail account must be connected before calling this endpoint. See Store Gmail tokens.

Response

message
string
A human-readable confirmation message. Example: "Rental invoices ingested successfully!" or "No rental invoices found for this user."
code
number
HTTP status code. 200 on success.
data
object | null
null when no new invoices were found. Otherwise contains the fields below.

Error responses

StatusError codeDescription
400INVALID_JSONThe request body is not valid JSON.
400MISSING_FIELDSA required key is missing from the request.
401INVALID_CREDENTIALSThe Authorization header is missing or the OAuth token is invalid.
401TOKEN_EXPIREDThe JWT has expired.
502DEPENDENCY_FAILUREThe Gmail API returned an error.
502GMAIL_TOKEN_EXPIREDThe Gmail OAuth refresh token has expired and the account must be re-connected.
500INTERNAL_SERVER_ERRORAn unexpected server-side error occurred.
Error responses follow this structure:
{
  "error": {
    "code": "GMAIL_TOKEN_EXPIRED",
    "message": "Gmail account needs to be re-connected"
  }
}
curl --request POST \
  --url https://api.paypulse.io/v1/invoices/rental/ingest \
  --header 'Authorization: Bearer <token>'
{
  "message": "Rental invoices ingested successfully!",
  "code": 200,
  "data": {
    "invoiceCount": 3
  }
}

Build docs developers (and LLMs) love