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": "beb82397-0e27-4648-90c8-87027b6c3bd9",
  "MerchantId": "80c70580-929d-4d4e-92f1-f7a401f3193f",
  "AppId": "b408c6ca-c080-4d41-94eb-88fbd1ed2cdf",
  "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-06-16T01:23:10.7501288+00:00",
  "EndDate": "2018-06-16T01:23:10.7501288+00:00",
  "ExpiryDate": "2018-06-16T01:23:10.7501288+00:00",
  "Limited": true,
  "RedemptionLimit": 10,
  "Share": true,
  "Created": "2018-06-16T01:23:10.7501288+00:00",
  "Deleted": true,
  "Published": true,
  "OfferImage": "sample string 14",
  "Pause": true,
  "Private": true,
  "Merchant": {
    "$id": "2",
    "Id": "4cea8bd4-9bbc-46bd-926d-c41e8b2b0736",
    "PlanId": "b966c171-f390-49bb-8f9b-77c5c69c640b",
    "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-06-16T01:23:10.7501288+00:00",
      "RegistrationCompleted": true,
      "LastLogin": "2018-06-16T01:23:10.7501288+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": "b23e0f50-cf24-4a88-b329-2e31ed00c95c",
      "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": "ac0d268b-fe9e-4855-a59b-2cd10cb5acd9",
        "MerchantId": "8a600a70-e72c-4b62-aae0-1246fc537ef2",
        "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,
        "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": "859be719-26a2-4ec6-8414-f1cc5a852ba5",
    "MerchantId": "00999738-22db-4df3-9201-445935d1bbc1",
    "KeyId": "2dc3cb42-3500-4850-9de3-bef1027295d8",
    "Name": "sample string 4",
    "Description": "sample string 5",
    "Created": "2018-06-16T01:23:10.7501288+00:00",
    "Modified": "2018-06-16T01:23:10.7501288+00:00",
    "Photo": "sample string 7",
    "Deleted": true,
    "Merchant": {
      "$ref": "2"
    },
    "Key": {
      "$id": "8",
      "Id": "08253931-a538-451f-836b-1d1e23fe9b77",
      "MerchantId": "7a531eca-d257-4daf-b8a5-45ace7029fa7",
      "Name": "sample string 3",
      "SecretKey": "sample string 4",
      "Created": "2018-06-16T01:23:10.7501288+00:00",
      "Deleted": true,
      "Assigned": true,
      "Merchant": {
        "$ref": "2"
      }
    }
  },
  "Shares": [
    {
      "$id": "9",
      "Id": "de2938a7-dff0-4775-84f2-5f55201de69b",
      "FromConsumerId": "d2105fd9-d52c-429a-ba27-406b214e8ed8",
      "ToConsumerId": "26aa6ec5-05c5-45ba-a25c-4219b9539715",
      "OfferId": "43db0406-d9b9-4ee0-93c8-922fab4ce457",
      "Redeemed": true,
      "Timestamp": "2018-06-16T01:23:10.7501288+00:00",
      "ReceiptImage": "sample string 4",
      "TotalAmount": "sample string 5",
      "RedeemedOn": "2018-06-16T01:23:10.7501288+00:00",
      "MerchantLocationId": "62c4a86f-1436-4274-aeea-9c61b013d957",
      "UserName": "sample string 6",
      "Consumer": {
        "$id": "10",
        "Id": "c0348f3e-0344-4714-ac07-7069c04884b8",
        "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": "46526602-733d-4515-b1ee-ab2d7d10ba72",
  "MerchantId": "b628708e-ec9f-4a98-b8ca-8d4883052cd6",
  "AppId": "f485b355-88dd-4bb3-af4f-e22db014e3e0",
  "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-06-16T01:23:10.9063779+00:00",
  "EndDate": "2018-06-16T01:23:10.9063779+00:00",
  "ExpiryDate": "2018-06-16T01:23:10.9063779+00:00",
  "Limited": true,
  "RedemptionLimit": 10,
  "Share": true,
  "Created": "2018-06-16T01:23:10.9063779+00:00",
  "Deleted": true,
  "Published": true,
  "OfferImage": "sample string 14",
  "Pause": true,
  "Private": true,
  "Merchant": {
    "$id": "2",
    "Id": "124ee3f6-0a71-43dd-bc8a-8331c94b70c7",
    "PlanId": "29b76206-0ccd-40ba-b3a9-cd40467c4b9a",
    "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-06-16T01:23:10.9063779+00:00",
      "RegistrationCompleted": true,
      "LastLogin": "2018-06-16T01:23:10.9063779+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": "168c8328-8950-45b7-b848-cbd9ce767e2f",
      "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": "0909c33d-46e0-4891-8c7a-c3139fdf462e",
        "MerchantId": "0f21ba1b-3ec7-4670-a3e7-53681f8976b3",
        "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,
        "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": "a5b42b87-bcdb-4c39-903c-f492d1127aab",
    "MerchantId": "c462f14c-ebe2-4fef-9c99-ae441cb63a30",
    "KeyId": "62b34752-7218-4b1f-8a47-5358ba92c1b2",
    "Name": "sample string 4",
    "Description": "sample string 5",
    "Created": "2018-06-16T01:23:10.9063779+00:00",
    "Modified": "2018-06-16T01:23:10.9063779+00:00",
    "Photo": "sample string 7",
    "Deleted": true,
    "Merchant": {
      "$ref": "2"
    },
    "Key": {
      "$id": "8",
      "Id": "9689b892-285d-4e0d-9035-3c4b210d4c0e",
      "MerchantId": "5cda91a3-407a-40bb-9b63-90ec3ce59838",
      "Name": "sample string 3",
      "SecretKey": "sample string 4",
      "Created": "2018-06-16T01:23:10.9063779+00:00",
      "Deleted": true,
      "Assigned": true,
      "Merchant": {
        "$ref": "2"
      }
    }
  },
  "Shares": [
    {
      "$id": "9",
      "Id": "b8a50935-485b-4c18-8d6e-f89a9fd24f1f",
      "FromConsumerId": "cd04d12c-f184-43c5-a420-24e068ff0199",
      "ToConsumerId": "ddda864e-3788-4898-b6b9-5551289f0c2d",
      "OfferId": "1e06a940-f4df-4f56-a20c-06f7237e77a1",
      "Redeemed": true,
      "Timestamp": "2018-06-16T01:23:10.9063779+00:00",
      "ReceiptImage": "sample string 4",
      "TotalAmount": "sample string 5",
      "RedeemedOn": "2018-06-16T01:23:10.9063779+00:00",
      "MerchantLocationId": "8b1f6894-75ce-4ae5-92c0-3fd153b6fe20",
      "UserName": "sample string 6",
      "Consumer": {
        "$id": "10",
        "Id": "b2c6c392-5e2d-4c94-a095-9fb4977794bd",
        "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.