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": "f046615a-12be-47a6-b5e7-47d4298776a3",
  "MerchantId": "2d61f3db-13cd-43a1-8c19-b01a1a342382",
  "AppId": "011a9e45-6714-4f44-9d16-faa1f8b81576",
  "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-12-12T05:11:09.1566081+00:00",
  "EndDate": "2018-12-12T05:11:09.1566081+00:00",
  "ExpiryDate": "2018-12-12T05:11:09.1566081+00:00",
  "Limited": true,
  "RedemptionLimit": 10,
  "Share": true,
  "Created": "2018-12-12T05:11:09.1566081+00:00",
  "Deleted": true,
  "Published": true,
  "OfferImage": "sample string 14",
  "Pause": true,
  "Private": true,
  "Merchant": {
    "$id": "2",
    "Id": "a4f92254-ca0d-4973-880e-1727dde29773",
    "PlanId": "c6ddc898-2cff-467d-90b8-8f9cf5738acf",
    "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-12-12T05:11:09.1566081+00:00",
      "RegistrationCompleted": true,
      "LastLogin": "2018-12-12T05:11:09.1566081+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": "cd74ff13-2fe3-4a96-835b-7f547498096a",
      "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": "4fc995b3-60ff-45ea-8e16-a0a0a8cbe0c0",
        "MerchantId": "3cdda07a-66d9-4655-b6df-10d23295a67d",
        "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,
        "StoreLocationId": "sample string 14",
        "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": "40953254-992a-4f56-86b7-e55a48088552",
    "MerchantId": "78fcc647-9208-458f-8d0e-637238834b80",
    "KeyId": "6f29e9ae-268c-4fef-8694-cdb84975cdc4",
    "Name": "sample string 4",
    "Description": "sample string 5",
    "Created": "2018-12-12T05:11:09.1566081+00:00",
    "Modified": "2018-12-12T05:11:09.1566081+00:00",
    "Photo": "sample string 7",
    "Deleted": true,
    "Merchant": {
      "$ref": "2"
    },
    "Key": {
      "$id": "8",
      "Id": "2e6db2c8-aa21-4ec4-95b1-8446b49a0bda",
      "MerchantId": "878e0a90-209d-4c82-8a91-927776459964",
      "Name": "sample string 3",
      "SecretKey": "sample string 4",
      "Created": "2018-12-12T05:11:09.1566081+00:00",
      "Deleted": true,
      "Assigned": true,
      "Merchant": {
        "$ref": "2"
      }
    }
  },
  "Shares": [
    {
      "$id": "9",
      "Id": "3910589e-0f32-42f2-a79e-903fdfd5d56f",
      "FromConsumerId": "64e8c232-a545-4e56-be71-0ec9a882cca1",
      "ToConsumerId": "49674399-f04e-4f0c-9701-16f3f41d47cc",
      "OfferId": "5d2295bb-bb29-4772-832e-1dd235bbbba4",
      "Redeemed": true,
      "Timestamp": "2018-12-12T05:11:09.1566081+00:00",
      "ReceiptImage": "sample string 4",
      "TotalAmount": "sample string 5",
      "RedeemedOn": "2018-12-12T05:11:09.1566081+00:00",
      "MerchantLocationId": "c0ce5613-eecf-4458-89c2-e7b14e956885",
      "UserName": "sample string 6",
      "Consumer": {
        "$id": "10",
        "Id": "979c350c-361c-4984-a2f2-6f7f146d0c3b",
        "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": "118a1429-f3a7-4efc-bc02-101024c6af14",
  "MerchantId": "71f91a43-183f-4934-a472-29ed68063c1e",
  "AppId": "5b836eab-f518-40f1-a474-b6deb5354bf9",
  "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-12-12T05:11:09.315785+00:00",
  "EndDate": "2018-12-12T05:11:09.315785+00:00",
  "ExpiryDate": "2018-12-12T05:11:09.315785+00:00",
  "Limited": true,
  "RedemptionLimit": 10,
  "Share": true,
  "Created": "2018-12-12T05:11:09.315785+00:00",
  "Deleted": true,
  "Published": true,
  "OfferImage": "sample string 14",
  "Pause": true,
  "Private": true,
  "Merchant": {
    "$id": "2",
    "Id": "90b5cc64-ea57-4b2d-b017-1be6ba255200",
    "PlanId": "54829db1-6d17-437c-bf1e-16b51ea09fcc",
    "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-12-12T05:11:09.315785+00:00",
      "RegistrationCompleted": true,
      "LastLogin": "2018-12-12T05:11:09.315785+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": "21315342-f667-4848-86df-f905b2b28736",
      "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": "ba6291e2-5b84-48c3-b664-d30c39bd6ab8",
        "MerchantId": "3aa7ebbf-b439-4fcf-9c62-4fb3088a2311",
        "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,
        "StoreLocationId": "sample string 14",
        "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": "00a9cf08-825a-4fae-9bf8-2afb55e88372",
    "MerchantId": "4688be1b-4d68-49c5-a0d4-431f7ba7cb80",
    "KeyId": "d6c4b054-7489-43de-b749-2a0b94d68fae",
    "Name": "sample string 4",
    "Description": "sample string 5",
    "Created": "2018-12-12T05:11:09.315785+00:00",
    "Modified": "2018-12-12T05:11:09.315785+00:00",
    "Photo": "sample string 7",
    "Deleted": true,
    "Merchant": {
      "$ref": "2"
    },
    "Key": {
      "$id": "8",
      "Id": "0d4e6122-c42f-47aa-9f96-550b775cb33f",
      "MerchantId": "4fd9cf48-a01a-4b12-8637-b4a2acdde27b",
      "Name": "sample string 3",
      "SecretKey": "sample string 4",
      "Created": "2018-12-12T05:11:09.315785+00:00",
      "Deleted": true,
      "Assigned": true,
      "Merchant": {
        "$ref": "2"
      }
    }
  },
  "Shares": [
    {
      "$id": "9",
      "Id": "84c9b8d3-f9e6-4dd7-9a3e-37fe875e3caa",
      "FromConsumerId": "618e67c3-869c-49ab-9fa5-5b9754408d0b",
      "ToConsumerId": "87009297-8993-4047-9eea-479d3fc38783",
      "OfferId": "45eacdab-d2b2-480b-a41b-fa92f70bbce5",
      "Redeemed": true,
      "Timestamp": "2018-12-12T05:11:09.315785+00:00",
      "ReceiptImage": "sample string 4",
      "TotalAmount": "sample string 5",
      "RedeemedOn": "2018-12-12T05:11:09.315785+00:00",
      "MerchantLocationId": "97c305fc-f54c-4b9e-86a2-6bea6d680eea",
      "UserName": "sample string 6",
      "Consumer": {
        "$id": "10",
        "Id": "47c70a95-fb1f-42d3-b776-5bc4c0a07878",
        "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.