POST api/Offers

Create Offer

Request Information

URI Parameters

None.

Body Parameters

The Offer class

Offer
NameDescriptionTypeAdditional information
Id

GUID Id for Offer. Assigned by system on Create. [REQUIRED]

globally unique identifier

None.

MerchantId

Guid MerchantId for Merchant. [REQUIRED]

globally unique identifier

None.

AppId

GUID AppId for App. [REQUIRED]

globally unique identifier

None.

Type

The type of Offer. [REQUIRED]

OfferType

None.

Reward

The amount of the Offer. Example: 10.00 for DollarOff, .10 for PercentageOff or NULL for BOGO [NULL]

string

None.

IsRewardBased

Indicates whether the Offer is a rewards-based offer. This is used for the BOGO Offer type. [NULLABLE]

boolean

None.

Name

The name or title of the Offer. [NULL]

string

None.

Description

The description for the Offer. [NULL]

string

None.

TermsConditions

The terms and conditions for the Offer. [NULL]

string

None.

Tags

Tags associated with an Offer. [NULL]

string

None.

StartDate

The start date of the Offer. [NULLABLE]

date

None.

EndDate

The end date of the Offer. [NULLABLE]

date

None.

ExpiryDate

The redemption expiration date of the Offer. [NULLABLE]

date

None.

Limited

Indicates whether the Offer has a redemption limit. [REQUIRED]

boolean

None.

RedemptionLimit

The redemption limit for the Offer. [REQUIRED]

integer

None.

Share

Indicates whether the Offer should be shared. [NULLABLE]

boolean

None.

Created

Date Offer was created. Assigned by system on Create. [REQUIRED]

date

None.

Deleted

Indicates whether the Offer has been deleted or not. Set to false on Create by system. Set to true on delete by system. [REQUIRED]

boolean

None.

Published

Indicates whether Offer has been published. [REQUIRED]

boolean

None.

OfferImage

Picture of the Offer. [NULL]

string

None.

Pause

Indicates whether the Offer is in a pause status. [REQUIRED]

boolean

None.

Private

Indicates whether the Offer is private. [REQUIRED]

boolean

None.

Merchant

Gets the Merchant using MerchantId.

Merchant

None.

App

Gets the App using AppId.

App

None.

Shares

Collection of SharedOffer

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": "7b9b09c7-6f3b-4bd4-a783-0101f4c6fe54",
  "MerchantId": "379216e4-b1c5-45e7-bb03-5393b407790c",
  "AppId": "2075f5c6-ad12-43aa-8571-8e7a0aa1a8f8",
  "Type": 0,
  "Reward": "sample string 4",
  "IsRewardBased": true,
  "Name": "sample string 5",
  "Description": "sample string 6",
  "TermsConditions": "sample string 7",
  "Tags": "sample string 8",
  "StartDate": "2018-09-18T10:25:40.5298847+00:00",
  "EndDate": "2018-09-18T10:25:40.5298847+00:00",
  "ExpiryDate": "2018-09-18T10:25:40.5298847+00:00",
  "Limited": true,
  "RedemptionLimit": 10,
  "Share": true,
  "Created": "2018-09-18T10:25:40.5298847+00:00",
  "Deleted": true,
  "Published": true,
  "OfferImage": "sample string 14",
  "Pause": true,
  "Private": true,
  "Merchant": {
    "$id": "2",
    "Id": "121cf9ec-b86f-46c7-ba41-972742cf9e47",
    "PlanId": "193178e8-d436-4436-966f-59e5bbb28c26",
    "StripeToken": "sample string 2",
    "StripeCustomerId": "sample string 3",
    "CompanyName": "sample string 4",
    "UserId": "sample string 5",
    "Active": true,
    "Deleted": true,
    "TimeZone": "sample string 8",
    "User": {
      "$id": "3",
      "Id": "sample string 1",
      "Email": "sample string 2",
      "EmailConfirmed": true,
      "UserName": "sample string 10",
      "FirstName": "sample string 11",
      "LastName": "sample string 12",
      "Address1": "sample string 13",
      "Address2": "sample string 14",
      "City": "sample string 15",
      "State": "sample string 16",
      "Country": "sample string 17",
      "ZipCode": "sample string 18",
      "DateRegistered": "2018-09-18T10:25:40.5298847+00:00",
      "RegistrationCompleted": true,
      "LastLogin": "2018-09-18T10:25:40.5298847+00:00",
      "TermsConditions": true,
      "MobileNumber": "sample string 21",
      "ProfileImage": "sample string 22",
      "FullName": "sample string 12, sample string 11",
      "Roles": [
        {
          "$id": "4",
          "Id": "sample string 1",
          "Name": "sample string 2",
          "Users": [
            {
              "$ref": "3"
            },
            {
              "$ref": "3"
            }
          ]
        },
        {
          "$ref": "4"
        }
      ]
    },
    "Plan": {
      "$id": "5",
      "Id": "32b9fb45-78ce-4a53-86c2-45a7bcb0bfc5",
      "PlanName": "sample string 2",
      "Description": "sample string 3",
      "LimitedApps": true,
      "AppLimit": 1,
      "LimitedLocations": true,
      "LocationLimit": 1,
      "LimitedOffers": true,
      "OfferLimit": 1,
      "Amount": 1,
      "WithCall": true,
      "SortNo": 8,
      "Billable": true
    },
    "MerchantLocations": [
      {
        "$id": "6",
        "Id": "329b312e-1256-4167-b0ff-4a1c6172751c",
        "MerchantId": "cdc290bf-1f34-42b7-b917-61ed156d851a",
        "Active": true,
        "Name": "sample string 4",
        "Address1": "sample string 5",
        "Address2": "sample string 6",
        "City": "sample string 7",
        "State": "sample string 8",
        "ZipCode": "sample string 9",
        "PhoneNumber": "sample string 10",
        "Deleted": true,
        "Main": true,
        "Latitude": 1.1,
        "Longitude": 1.1,
        "GeoLocation": null,
        "GeoSpot": true,
        "Merchant": {
          "$ref": "2"
        },
        "CompleteAddress": "sample string 5, sample string 6, sample string 7, sample string 8, sample string 9"
      },
      {
        "$ref": "6"
      }
    ]
  },
  "App": {
    "$id": "7",
    "Id": "308f162e-e70f-4cae-9bf0-0b0e2ad3236c",
    "MerchantId": "41ac5c7d-d5f2-459a-863f-bec43e925757",
    "KeyId": "7fae7ee1-b6fd-4272-ad53-7d92b79200b8",
    "Name": "sample string 4",
    "Description": "sample string 5",
    "Created": "2018-09-18T10:25:40.5298847+00:00",
    "Modified": "2018-09-18T10:25:40.5298847+00:00",
    "Photo": "sample string 7",
    "Deleted": true,
    "Merchant": {
      "$ref": "2"
    },
    "Key": {
      "$id": "8",
      "Id": "152e527a-f707-4ac5-aa92-e4a8d0fe9cdf",
      "MerchantId": "6694ad85-4812-4696-bb29-a6a237356c0c",
      "Name": "sample string 3",
      "SecretKey": "sample string 4",
      "Created": "2018-09-18T10:25:40.5298847+00:00",
      "Deleted": true,
      "Assigned": true,
      "Merchant": {
        "$ref": "2"
      }
    }
  },
  "Shares": [
    {
      "$id": "9",
      "Id": "5f204a26-f7f8-450e-b4c5-d9c6afb7a904",
      "FromConsumerId": "207df62c-0d9d-4825-bd2c-db37b0636e04",
      "ToConsumerId": "484284c4-36d9-456e-96e1-c3bf3c0411ad",
      "OfferId": "9e309a6c-6459-4cf5-a63c-ead7b66217e2",
      "Redeemed": true,
      "Timestamp": "2018-09-18T10:25:40.5298847+00:00",
      "ReceiptImage": "sample string 4",
      "TotalAmount": "sample string 5",
      "RedeemedOn": "2018-09-18T10:25:40.5298847+00:00",
      "MerchantLocationId": "29de09eb-6396-40b1-b86f-a6d91f1ea78a",
      "UserName": "sample string 6",
      "Consumer": {
        "$id": "10",
        "Id": "35890748-74f5-44bc-bafc-b529cbffdf00",
        "Gender": "sample string 2",
        "Address1": "sample string 3",
        "Address2": "sample string 4",
        "City": "sample string 5",
        "State": "sample string 6",
        "ZipCode": "sample string 7",
        "Image": "sample string 8",
        "Deleted": true
      },
      "Consumer1": {
        "$ref": "10"
      },
      "Offer": {
        "$ref": "1"
      }
    },
    {
      "$ref": "9"
    }
  ]
}

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Object graph for type 'FaceOffers.Entities.MerchantConsumer' contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Object graph for type 'FaceOffers.Entities.MerchantConsumer' contains cycles and cannot be serialized if reference tracking is disabled.

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'Offer'.

Response Information

Resource Description

Returns an Offer or an alert message/email if the Offer limit has been reached

Offer
NameDescriptionTypeAdditional information
Id

GUID Id for Offer. Assigned by system on Create. [REQUIRED]

globally unique identifier

None.

MerchantId

Guid MerchantId for Merchant. [REQUIRED]

globally unique identifier

None.

AppId

GUID AppId for App. [REQUIRED]

globally unique identifier

None.

Type

The type of Offer. [REQUIRED]

OfferType

None.

Reward

The amount of the Offer. Example: 10.00 for DollarOff, .10 for PercentageOff or NULL for BOGO [NULL]

string

None.

IsRewardBased

Indicates whether the Offer is a rewards-based offer. This is used for the BOGO Offer type. [NULLABLE]

boolean

None.

Name

The name or title of the Offer. [NULL]

string

None.

Description

The description for the Offer. [NULL]

string

None.

TermsConditions

The terms and conditions for the Offer. [NULL]

string

None.

Tags

Tags associated with an Offer. [NULL]

string

None.

StartDate

The start date of the Offer. [NULLABLE]

date

None.

EndDate

The end date of the Offer. [NULLABLE]

date

None.

ExpiryDate

The redemption expiration date of the Offer. [NULLABLE]

date

None.

Limited

Indicates whether the Offer has a redemption limit. [REQUIRED]

boolean

None.

RedemptionLimit

The redemption limit for the Offer. [REQUIRED]

integer

None.

Share

Indicates whether the Offer should be shared. [NULLABLE]

boolean

None.

Created

Date Offer was created. Assigned by system on Create. [REQUIRED]

date

None.

Deleted

Indicates whether the Offer has been deleted or not. Set to false on Create by system. Set to true on delete by system. [REQUIRED]

boolean

None.

Published

Indicates whether Offer has been published. [REQUIRED]

boolean

None.

OfferImage

Picture of the Offer. [NULL]

string

None.

Pause

Indicates whether the Offer is in a pause status. [REQUIRED]

boolean

None.

Private

Indicates whether the Offer is private. [REQUIRED]

boolean

None.

Merchant

Gets the Merchant using MerchantId.

Merchant

None.

App

Gets the App using AppId.

App

None.

Shares

Collection of SharedOffer

None.

Response Formats

application/json, text/json

Sample:
{
  "Id": "ccf904c3-c56f-4e86-8ca6-ae2e8641b0f3",
  "MerchantId": "c9f82814-0e34-4004-b6fa-de3794481720",
  "AppId": "06262c77-8ef0-4aef-8335-98cdec44223c",
  "Type": 0,
  "Reward": "sample string 4",
  "IsRewardBased": true,
  "Name": "sample string 5",
  "Description": "sample string 6",
  "TermsConditions": "sample string 7",
  "Tags": "sample string 8",
  "StartDate": "2018-09-18T10:25:40.7951086+00:00",
  "EndDate": "2018-09-18T10:25:40.7951086+00:00",
  "ExpiryDate": "2018-09-18T10:25:40.7951086+00:00",
  "Limited": true,
  "RedemptionLimit": 10,
  "Share": true,
  "Created": "2018-09-18T10:25:40.7951086+00:00",
  "Deleted": true,
  "Published": true,
  "OfferImage": "sample string 14",
  "Pause": true,
  "Private": true,
  "Merchant": {
    "$id": "2",
    "Id": "ce6bfd37-5ffb-4ccc-879b-4db837b1a0dc",
    "PlanId": "8bd2c583-81aa-41dd-961d-ed8a5cde50c1",
    "StripeToken": "sample string 2",
    "StripeCustomerId": "sample string 3",
    "CompanyName": "sample string 4",
    "UserId": "sample string 5",
    "Active": true,
    "Deleted": true,
    "TimeZone": "sample string 8",
    "User": {
      "$id": "3",
      "Id": "sample string 1",
      "Email": "sample string 2",
      "EmailConfirmed": true,
      "UserName": "sample string 10",
      "FirstName": "sample string 11",
      "LastName": "sample string 12",
      "Address1": "sample string 13",
      "Address2": "sample string 14",
      "City": "sample string 15",
      "State": "sample string 16",
      "Country": "sample string 17",
      "ZipCode": "sample string 18",
      "DateRegistered": "2018-09-18T10:25:40.7951086+00:00",
      "RegistrationCompleted": true,
      "LastLogin": "2018-09-18T10:25:40.7951086+00:00",
      "TermsConditions": true,
      "MobileNumber": "sample string 21",
      "ProfileImage": "sample string 22",
      "FullName": "sample string 12, sample string 11",
      "Roles": [
        {
          "$id": "4",
          "Id": "sample string 1",
          "Name": "sample string 2",
          "Users": [
            {
              "$ref": "3"
            },
            {
              "$ref": "3"
            }
          ]
        },
        {
          "$ref": "4"
        }
      ]
    },
    "Plan": {
      "$id": "5",
      "Id": "20a83174-ac3e-4a6d-b92d-26b09d5efa47",
      "PlanName": "sample string 2",
      "Description": "sample string 3",
      "LimitedApps": true,
      "AppLimit": 1,
      "LimitedLocations": true,
      "LocationLimit": 1,
      "LimitedOffers": true,
      "OfferLimit": 1,
      "Amount": 1,
      "WithCall": true,
      "SortNo": 8,
      "Billable": true
    },
    "MerchantLocations": [
      {
        "$id": "6",
        "Id": "7e630789-38a9-454b-9ecf-b6ff3c8ee471",
        "MerchantId": "d22c3170-4547-4ce5-a07d-2e5b53f6e370",
        "Active": true,
        "Name": "sample string 4",
        "Address1": "sample string 5",
        "Address2": "sample string 6",
        "City": "sample string 7",
        "State": "sample string 8",
        "ZipCode": "sample string 9",
        "PhoneNumber": "sample string 10",
        "Deleted": true,
        "Main": true,
        "Latitude": 1.1,
        "Longitude": 1.1,
        "GeoLocation": null,
        "GeoSpot": true,
        "Merchant": {
          "$ref": "2"
        },
        "CompleteAddress": "sample string 5, sample string 6, sample string 7, sample string 8, sample string 9"
      },
      {
        "$ref": "6"
      }
    ]
  },
  "App": {
    "$id": "7",
    "Id": "9ed53cab-55bb-428f-9bc2-11e5090c0fe4",
    "MerchantId": "3c0f3da8-838e-4618-8725-315ea02da992",
    "KeyId": "e1c3d398-2326-4eff-ac2d-8a74567ea868",
    "Name": "sample string 4",
    "Description": "sample string 5",
    "Created": "2018-09-18T10:25:40.7951086+00:00",
    "Modified": "2018-09-18T10:25:40.7951086+00:00",
    "Photo": "sample string 7",
    "Deleted": true,
    "Merchant": {
      "$ref": "2"
    },
    "Key": {
      "$id": "8",
      "Id": "c92aa578-7644-4c96-967a-6fcfdee06410",
      "MerchantId": "c2fbc20e-e1ca-41a0-8a26-ff1eedc648e4",
      "Name": "sample string 3",
      "SecretKey": "sample string 4",
      "Created": "2018-09-18T10:25:40.7951086+00:00",
      "Deleted": true,
      "Assigned": true,
      "Merchant": {
        "$ref": "2"
      }
    }
  },
  "Shares": [
    {
      "$id": "9",
      "Id": "846114ac-1178-477d-a99f-6e6316fa5f3a",
      "FromConsumerId": "bf47d055-2481-4793-b335-95ed69b016a6",
      "ToConsumerId": "4ffc89f5-f675-4f9f-ae36-446437254577",
      "OfferId": "63aaf00e-bb9e-4ea6-ac41-a27f3e8edee9",
      "Redeemed": true,
      "Timestamp": "2018-09-18T10:25:40.7951086+00:00",
      "ReceiptImage": "sample string 4",
      "TotalAmount": "sample string 5",
      "RedeemedOn": "2018-09-18T10:25:40.7951086+00:00",
      "MerchantLocationId": "b9facc66-342f-4648-beaa-255ac8ecc6c7",
      "UserName": "sample string 6",
      "Consumer": {
        "$id": "10",
        "Id": "73e671ff-5a34-4dbe-a1cf-35a59e79da85",
        "Gender": "sample string 2",
        "Address1": "sample string 3",
        "Address2": "sample string 4",
        "City": "sample string 5",
        "State": "sample string 6",
        "ZipCode": "sample string 7",
        "Image": "sample string 8",
        "Deleted": true
      },
      "Consumer1": {
        "$ref": "10"
      },
      "Offer": {
        "$ref": "1"
      }
    },
    {
      "$ref": "9"
    }
  ]
}

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Object graph for type 'FaceOffers.Entities.MerchantConsumer' contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Object graph for type 'FaceOffers.Entities.MerchantConsumer' contains cycles and cannot be serialized if reference tracking is disabled.