Graph API Version

Page Nativeoffers

Reading

Edge to get native offers owned by the page.

Graph API Explorer
GET /v2.9/{page-id}/nativeoffers HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{page-id}/nativeoffers'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/nativeoffers",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/nativeoffers",
    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:@"/{page-id}/nativeoffers"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of NativeOffer nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
200Permissions error

Creating

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

Parameters

NameDescription
barcode_type
enum {CODE128, CODE128B, EAN, PDF417, QR, UPC_A, UPC_E, DATAMATRIX, CODE93}

Barcode type for in-store offers.

barcode_value
string

Barcode value for in-store offers.

details
UTF-8 encoded string

Additional primary text describing the native offer.

Required
disable_location
boolean

Whether or not to disable location features, such as the map and nearby notification.

discounts
list<Object>

An array of OfferDiscount objects.

Required
type
enum {percentage_off, free_stuff, cash_discount, bogo}
Required
text
string
value1
float
value2
float
currency
ISO 4217 Currency Code
override
string
Default value:
expiration_time
datetime

The unix time representing when the offer expires.

Required
instore_code
string

The code used to redeem the native offer in-store. This code should not contain any spaces.

location_type
enum {online, offline, both}
Default value: online

A OfferAvailabilityLocation enum value.

max_save_count
int64
Default value: 0

Maximum number of allowed saves, 0 is unlimited.

online_code
string

The code used to redeem the native offer online. This code should not contain any spaces.

page_set_id
numeric string or integer

The ID of Place Page Set which represents the locations where this in-store offer is valid for.

redemption_link
URL

The URL to the site where a user can redeem the offer.

terms
UTF-8 encoded string

Limitations, terms and conditions on the use of the native offer.

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
200Permissions error
262Incorrect permission to publish pages
100Invalid parameter
2826The barcode service returned an error; please try again later, or try different type and value parameters.
2825The given page is not eligible for Offers at this time.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.