Business Offers Model

Action

Method

Resource

Description

Get all

GET

/business/:business_id/offers

Get all offers.

Get

GET

/business/:business_id/offers/:offer_id

Get offer with id business_id and offer_id.

Create

POST

/business/:business_id/offers

Create an offer with business_id.

Update

PUT

/business/:business_id/offers/:offer_id

Update an offer with business_id and offer_id.

Delete

DELETE

/business/:business_id/offers/:offer_id

Delete an offer with business_id and offer_id.

The offer model is composed of the following attributes:

Attribute

Type

Required

Description

Whereable

name

string

no, required to create.

The offer's name.

Yes

type

integer

no, required to create.

The offer's type.

Yes

minimum

float

no

The offer's minimum purshase.

Yes

rate_type

integer

no, required to create.

The offer's type discount.
1 for percentage.
2 for fixed amount.

Yes

rate

float

no, required to create.

The offer's rate.

Yes

start

date

no

The offer's start. (e.g. MM/DD/YYYY)

Yes

end

date

no

The offer's end. (e.g. MM/DD/YYYY)

Yes

limit

integer

no

The offer's limit.

Yes

coupon

string

no

The offer's code/coupon.

Yes

enabled

boolean

no

The offer's status.

Yes

📘

Restrictions for use offers API endpoints

  • Offers can only be created, updated or removed by Users level 0 or level 2 (Type: Administrator or Business Owner).

Offer types

The type of offer is used to distinguish if the discount is direct by business order or if it is a coupon ( promotional code). The types are shown bellow:

Offer name

Offer value

Description

Offer

1

This discount is automatically applied to the orders if it exists in the business and if the order meets the conditions set.

Coupon

2

This discount is applied at the request of the user if he has permission. That is to say that it has a code that allows you to access the discount, this discount is applied if the order meets the requirements.

Rate type

Actually, there are two rate types, percentage and fixed.

Rate type

Rate valye

Description

Percentage

1

This discount depends on the total amount of the order.

Fixed

2

This discount is fixed and the value is chosen by the business.