Base URL

https://api.linkrunner.io/api/v1

Authentication

Generate your server code from https://www.linkrunner.io/settings?s=data-apis In the request header add the below attribute:
linkrunner-key: YOUR-SERVER-KEY

Capture payment

POST: /capture-payment

Request Body

{
    "user_id": "666",
    "payment_id": "ABC", // optional but recommended
    "amount": 25096, // Send amount in one currency only
    "type": "FIRST_PAYMENT", // optional
    // "type": "SECOND_PAYMENT", // optional
    "status": "PAYMENT_COMPLETED" // optional
}
NOTE: If you accept payments in multiple currencies convert them to one currency before calling the API. Deduplication: We perform idempotent deduplication using a combination of 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
If 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
If status is omitted, it defaults to PAYMENT_COMPLETED.

Responses

  1. 201 Payment captured
  2. 401 Invalid server key

Remove captured payment

POST: /remove-payment

Request Body

{
    "user_id": "666",
    "payment_id": "ABC"
}
NOTE: 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

  1. 200 Payment entry/entries deleted
  2. 400 No payment found with the given payment id or user id
  3. 401 Invalid server key