How and why to update your Button integration to use our order reporting API.
We’re making some changes to the ways that your orders are reported in our system, and we wanted to discuss moving your integration from SDK reporting to API reporting in the near term.
We have deprecated order reporting via the SDK in favor of reporting orders directly using our API from your API calls. We aim to migrate all partners to this new way of reporting over the next month or so. This update will provide you with a range of benefits including:
Migrating to the Order Reporting API is simple and will be a one-time effort that gives you ongoing reliable reporting for order attribution & affiliation.
Whenever your app is opened from Button, the URL will also contain a Button Attribution Token. The Button SDK will automatically extract and store this token.
When you post an order to your API, you will need to check for the existence of this token, and if present include it in the order payload, so that the API can then report it to Button.
NSString *buttonToken = [Button sharedButton].referrerToken;
Each time you create an order in your API, this will be reported to Button. If there is a
btn_ref present in the order from your client, then you should also include this as the
btn_ref field in the order posted to Button.
Order interactions to report:
btn_refwill be valid for affiliation, so updating and deleting orders is important for ensuring correct billing.
We've put together an interactive tool that lets you make the full lifecycle of Order requests against our API and get real-time feedback and validation that we're handling everything properly.
We've made libraries for a few common languages to make it really easy to get set up. These libraries are totally open source so even if you use a different language, they are a great reference for implementation.
Don't use one of these languages? Or want to build your own? You can find the full details of the underlying API in the API reference.
In your next app update, remove SDK Order Reporting -- you can roll that update out on a timeline that works for you without any impact or double-counting. You will however have to use this build to perform the verification in Step 4 to ensure that you're not seeing SDK orders.
The Button Partner Test App will walk you through making a purchase in your newly configured App & API, show you the data that we see and allow you to confirm that it's all working correctly.
If something's not working, the App will let you know and help to either figure it out or get in touch.
Once you roll API Order Reporting out to production, let us know and we'll start listening to your API and will ignore orders from the SDK.
It's important that orders contain the Button Attribution token
btn_ref when available - this controls attribution & affiliation.
If you're seeing a
403 Forbidden response it's most likely that your API key encoding isn't right, take a look at the API authentication section.
Button supports linking from the web with attribution. Make sure that you've completed the Interactive App Setup guide.