{
  "x402Version": 2,
  "id": 5483,
  "slug": "5483",
  "resource": "https://stackbill.app/routes/x402/invoice-from-data",
  "description": "Generate a finished, professional invoice PDF from JSON — recipient and line items in, a ready-to-send application/pdf out. Layouts: standard, legal, creative. Totals and tax are computed server-side so the numbers always add up. First payment auto-creates a wallet profile (token + API key in response headers); returning wallets get sequential invoice numbering and can save a sender letterhead. USD only.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x1f2A484ef654d49c58c625b09e78B538501D652D",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "100000",
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "currency": "USD",
            "dueDate": "2026-08-01",
            "invoiceNumber": "INV-2026-042",
            "lineItems": [
              {
                "description": "Backend development",
                "quantity": 10,
                "unitPrice": 95
              },
              {
                "description": "Code review",
                "quantity": 2,
                "unitPrice": 120
              }
            ],
            "notes": "Payment due within 30 days.",
            "recipient": {
              "address": "456 Oak Ave, Chicago, IL 60601",
              "name": "Acme Corp"
            },
            "sender": {
              "address": "123 Main St, Springfield, IL 62701",
              "name": "Jane Doe Consulting"
            },
            "taxRate": 7.5
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "note": "application/pdf — the finished invoice document"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "properties": {
                  "currency": {
                    "description": "Optional; must be \"USD\" if present (v1 renders USD only)",
                    "type": "string"
                  },
                  "dueDate": {
                    "description": "Optional due date, YYYY-MM-DD",
                    "type": "string"
                  },
                  "invoiceNumber": {
                    "description": "Invoice number printed on the PDF. Optional when the request carries an X-StackApps-Token header from a previous paid call — the next sequential number for that wallet is used and returned in the X-Invoice-Number response header",
                    "type": "string"
                  },
                  "lineItems": {
                    "description": "At least one line item; amount per line, subtotal, tax and total are computed server-side",
                    "items": {
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "quantity": {
                          "exclusiveMinimum": 0,
                          "type": "number"
                        },
                        "unitPrice": {
                          "minimum": 0,
                          "type": "number"
                        }
                      },
                      "required": [
                        "description",
                        "quantity",
                        "unitPrice"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "notes": {
                    "description": "Optional notes printed at the bottom of the invoice",
                    "type": "string"
                  },
                  "recipient": {
                    "description": "Who the invoice is billed to",
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "address"
                    ],
                    "type": "object"
                  },
                  "sender": {
                    "description": "Who the invoice is from. Optional for activated wallet profiles (send X-StackApps-Token) — the profile's saved name and address are used",
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "address"
                    ],
                    "type": "object"
                  },
                  "taxRate": {
                    "description": "Optional tax percent applied to the subtotal (e.g. 7.5)",
                    "minimum": 0,
                    "type": "number"
                  },
                  "template": {
                    "description": "Optional PDF layout (default standard): legal = billing statement with a per-line Date column (populated when descriptions start with 'Work session on YYYY-MM-DD: '); creative = service/fee layout without hours-rate columns (service name taken from the text before ': ' in each description)",
                    "enum": [
                      "standard",
                      "legal",
                      "creative"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "recipient",
                  "lineItems"
                ]
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST",
                  "PUT",
                  "PATCH"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar"
  ],
  "sourceHost": "stackbill.app",
  "lastUpdated": "2026-09-14T14:53:01.677Z",
  "quality": {
    "calls30d": 1,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-09-14T14:53:01.163Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "stackbill.app",
    "manifest_name": "stackbill.app",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}