Objectives

Creates a custom objective.

Changed on

The objective is created for the store of the API key and is listed by the objectives list endpoints. Use the returned Guid to reward customers through POST v1/pvt/Objectives/{guid}/importpoints.

This endpoint is not idempotent: each successful call creates a new objective.

Required permission: PointsWrite (Admin: Pontos e cashback - Leitura e escrita)

post/v1/pvt/Objectives/custom

Request

  • Base URL
    https://api.bonifiq.com.br
  • Auth
    HTTP basic

Request body

Namestring nullable

Name of the objective. Required, up to 100 characters.

AmountOfPointsinteger

Amount of points granted each time a customer completes the objective. Must be greater than zero.

Activeboolean

If false, the objective is created inactive and does not grant points. Defaults to true.

CustomerMaxCompletioninteger nullable

Maximum number of times each customer can be rewarded by this objective. Null (default) means no limit; when informed it must be greater than zero.

ShowOnWidgetAndLandingPageboolean

If true, the objective card is shown on the widget and on the landing page. Defaults to false.

IconUrlstring nullable

Optional icon shown on the objective card. Must be an absolute HTTPS URL with up to 2048 characters.

CardTitlestring nullable

Optional card title, up to 20 characters. The widget and the landing page show the card without a title when it is empty.

CardDescriptionstring nullable

Optional card description, up to 4000 characters. Accepts basic HTML (p, br, strong, b, em, i, u, ul, ol, li, a, img); any other tag, attribute or unsafe link is removed.

ActionButtonTextstring nullable

Optional action button text, up to 10 characters. Must be informed together with ActionButtonUrl.

ActionButtonUrlstring nullable

Optional action button URL. Must be an absolute HTTP or HTTPS URL with up to 2048 characters and informed together with ActionButtonText.

NotifyCustomerWhenPointIsGivenboolean

If true, the customer is notified when points are granted by this objective. Defaults to false.

Response

The created custom objective, including its Guid.

ErrorMessagestring nullable

Error message returned when the request fails validation or processing. For warnings and successful responses, consumers should usually inspect Result, Code and Severity first.

ErrorCodeinteger nullable

Legacy numeric error code derived from internal API errors when available. This field is relevant only for error flows that use ApiResponseErrorDescription.

Codestring nullable

Endpoint-specific business code formatted as a two-digit string, such as 03 or 07. This field is available for success, warning and error outcomes.

CodeNamestring nullable

Symbolic enum name associated with Code, such as CheckoutNotFound.

Severity0 | 1 | 2

0 = Success 1 = Warning 2 = Error

HasWarningboolean

Convenience flag that is true when Severity is Warning. Warnings are valid 200 OK business outcomes and should not be handled as transport or validation errors.

HasErrorboolean

Indicates whether the request failed and should be handled as an error response. This flag is reserved for real API errors; warnings must keep this property as false.

Changes