Revenue is stored for all users, including organic ones. Payments from users with no matching click are stored without campaign attribution. Each request must identify the user with
user_id or install_instance_id. You can verify your events are being captured on the Events page.Base URL
Authentication
Generate your server code from https://dashboard.linkrunner.io/settings?s=data-apis In the request header add the below attribute:Capture payment
Request Body
type and payment_id. For each unique combination of payment type and payment ID, only one record will be created. If you send multiple requests with the same type and payment_id combination, only the first will be recorded and subsequent ones will be ignored. To ensure proper deduplication, always provide a unique payment_id for each transaction of a given type.
Payment types
- FIRST_PAYMENT: User’s first payment
- SECOND_PAYMENT: User’s second payment
- WALLET_TOPUP: Adding funds to a wallet
- FUNDS_WITHDRAWAL: Withdrawing funds
- SUBSCRIPTION_CREATED: Subscription started
- SUBSCRIPTION_RENEWED: Subscription renewed
- ONE_TIME: One-time payment
- RECURRING: Recurring payment
- DEFAULT: Generic/unspecified payment type
type is omitted, it defaults to DEFAULT.
Payment status
- PAYMENT_INITIATED: Payment has been initiated
- PAYMENT_COMPLETED: Payment completed successfully
- PAYMENT_FAILED: Payment attempt failed
- PAYMENT_CANCELLED: Payment was cancelled
status is omitted, it defaults to PAYMENT_COMPLETED.
End-user IP address
These calls come from your server, so Linkrunner never sends your server’s IP to ad networks as the user’s IP. By default it sends the device IP captured when the app was installed. If you know the IP of the user’s device at the time of the payment, pass it asclient_ip_address. Linkrunner forwards it to ad networks (for example Meta client_ip_address) to improve matching.
- Send only the device’s public IP. Private, loopback and link-local addresses are ignored.
- Leave it out if you don’t have it. Linkrunner then uses the install-time device IP.
Responses
- 201 Payment captured
- 401 Invalid server key
Remove captured payment
Request Body
user_id or payment_id is required in order to remove a payment entry. If you pass user_id, all the payments attributed to that user will be removed!
Responses
- 200 Payment entry/entries deleted
- 400 No payment found with the given payment id or user id
- 401 Invalid server key
Meta Ecommerce Events
If you are trackingPurchase events to sync with Meta Catalog Sales, you must first map the purchase event with the standard commerce event in the Linkrunner Dashboard before sending it.
Note: Any Payment event you send should be mapped with Purchase for Commerce Event Manager. For example, map FIRST_PAYMENT with Purchase or DEFAULT with Purchase.
While you can include any custom attributes in the event_data object, Meta requires specific fields for ecommerce events to correctly attribute catalog sales. Your event_data object should include the following fields:
For comprehensive details on each field requirement, refer to our Meta Commerce Manager documentation.
type field is omitted from the request body, which means it defaults to DEFAULT. Ensure this default payment type is properly mapped with Purchase in your Linkrunner dashboard.
To verify your events are being correctly received by Meta, please follow our Testing Ecommerce Events guide.