Offers

This endpoint allows authenticated users to upload a price sheet to their company’s Happyoffer environment by providing a public PDF URL. The system downloads the PDF from the provided pdf_url, stores it internally, and associates it with the authenticated user and their company.


POST/api/price-sheets

Create a new price sheet

This endpoint allows authenticated users to upload a price sheet to their company’s Happyoffer environment by providing a public PDF URL. The system downloads the PDF from the provided pdf_url, stores it internally, and associates it with the authenticated user and their company.

The price sheet can optionally include a description (notes) and must include a name. Upon successful upload, the endpoint returns a structured JSON response containing metadata about the price sheet, the user who uploaded it, and the associated company.

This endpoint is primarily intended for integrations where external systems (such as mobile apps or partner platforms) need to programmatically submit pricing documents for internal use.

Request body

The request body must include the following fields, where only the company_name is required:

  • name (string, required): The name of the price sheet.
  • pdf_url (string, optional): A publicly accessible URL to the PDF.
  • notes (string, optional): Additional information of the given PDF.

Example request

{
    "name": "Q2 2025 Pricing sheet",
    "pdf_url": "https://example.com/files/q2-pricing.pdf",
    "notes": "Includes updated partner discounts"
}

Example response

This returns back the newly created price sheet record.

{
  "id": "47",
  "attributes": {
    "user_id": 3,
    "company": 1,
    "name": "Q2 2024 Pricing Sheet",
    "notes": "Includes updated partner discounts",
    "file": "https://your-app.com/storage/price-sheets/q2-pricing.pdf",
    "created_at": "2024-04-01T14:22:10.000000Z",
    "updated_at": "2024-04-01T14:22:10.000000Z"
  },
  "relationships": {
    "user": {
      "name": "Jane Doe",
      "email": "jane@example.com"
    },
    "company": {
      "name": "Acme Corp"
    }
  }
}

Notes

  • The PDF must be publicly accessible so that Happyoffer can download it.
  • Uploaded files are stored securely in the company’s environment and associated with the authenticated user.
  • The returned file URL points to the locally stored copy.

Was this page helpful?