Graph API Version

Offer

Reading

Entity to describe an offer. One needs to be whitelisted to use this API. Please contact the support group and ask them to reach out to the team that is responsible for this API to request to be whitelisted.

Examples

Graph API Explorer
GET /v2.10/{sales-promo-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{sales-promo-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{sales-promo-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{sales-promo-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{sales-promo-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription

id

numeric string

The ID of the offer

availability_location

enum

Where an offer can be redeemed (online/offline/both)

description

string

The description of the offer

destination_uri

string

A link to the offer page on the company website

discount_code

string

The offer code providing the discount

expiration_time

datetime

The time after which this offer is no longer valid

page

The page on which the offer is published

schedule_time

datetime

The time which the offer is scheduled to be published

start_time

datetime

The time which the offer starts

terms_and_conditions

string

The legal terms and conditions of the offer

title

string

The title of the offer

Edges

No edges

Validation Rules

ErrorDescription
100Invalid parameter

Creating

You can make a POST request to offers_v3 edge from the following paths:
When posting to this edge, an Offer will be created.

Parameters

NameDescription
availability_location
enum {both, offline, online}
Default value: offline

Where an offer can be redeemed (online/offline/both)

description
UTF-8 encoded string
Default value:

The description of the offer

destination_uri
URL
Default value:

A link to the offer page on the company website

discount_code
UTF-8 encoded string
Default value:

The offer code that provides the discount. This can be a string that is less than 20 characters without white space

expiration_time
datetime
Default value: 1506902400

The unix timestamp after which the offer is no longer valid. This can be any date between fifteen minutes and one year from the time of the API call. By default, either seven days later or end of the month of the the API call, whichever gives the longest duration

hidden
boolean
Default value: false

Should hide from all UI surfaces?

photo_uris
list<URL>

The URIs of photos associated with the offer. Photos should be less than 4 MB and saved as JPG, PNG, GIF or TIFF files

referrer
UTF-8 encoded string
Default value: graph_api

referrer

schedule_time
datetime

The unix timestamp on which the offer is scheduled to be published. This can be any date between fifteen minutes and six months from the time of the API call

start_time
datetime

The unix timestamp on which the offer starts. This can be any date between fifteen minutes and six months from the time of the API call

terms_and_conditions
UTF-8 encoded string
Default value:

The legal terms and conditions of the offer

video_ids
list<numeric string or integer>
Default value: Vector

Video IDs associated with the offer. This can be an array of unpublished facebook video_ids

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
100Invalid parameter

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.