Templates
Welcome to the Happyoffer API! This API allows you to manage and retrieve offer templates specific to your company. Below are the details for accessing offer templates through two key endpoints.
The Happyoffer API provides access to offers within your company. It features endpoints to retrieve all offer templates based on a parent offer and to fetch details of a specific offer template. Access to these endpoints is restricted to ensure that users only interact with data relevant to their company.
Get all templates
This endpoint retrieves all offer templates associated with a given parent_id, including its child offers. An offer template is identified by having the is_template attribute set to true. This ensures you receive only templates and not other types of offers.
Constraints
• Company Restriction: You can only access offers that belong to your company. Offers from other companies are not accessible through this endpoint. • Template Filter: Only offers with the is_template attribute set to true are included in the response.
Response
[
{
"id": "string",
"attributes": {
"company_id": "string",
"name": "string",
"is_visible": "boolean",
"offer_status": "string",
"is_manually_rejected": "boolean",
"offer_type": "string",
"language": "string",
"offer_date": "string",
"offer_number": "string",
"created_at": "string",
"updated_at": "string",
"url": "string",
"draft_url": "string"
}
}
]
Get template by offer id
This endpoint retrieves detailed information for a specific offer template identified by offer. The offer will only be returned if its company_id matches that of the authenticated user, ensuring that users only access their own company’s data.
Path Parameters
• offer_id (string): The id of the offer template you want to retrieve.
Constraints
• company_id validation: The company_id of the offer must match the company_id of the authenticated user. If it does not match, access will be denied.
Response
{
"id": "string",
"attributes": {
"company_id": "string",
"name": "string",
"is_visible": "boolean",
"offer_status": "string",
"is_manually_rejected": "boolean",
"offer_type": "string",
"language": "string",
"offer_date": "string",
"offer_number": "string",
"created_at": "string",
"updated_at": "string",
"url": "string",
"draft_url": "string"
}
}
Error Responses
• 403 Forbidden: Returned if the company_id of the offer does not match the company_id of the authenticated user.