Skip to content

Instantly share code, notes, and snippets.

@zeiv
Last active July 25, 2018 14:13
Show Gist options
  • Save zeiv/bec69ac477cf27b63729d245e45c0895 to your computer and use it in GitHub Desktop.
Save zeiv/bec69ac477cf27b63729d245e45c0895 to your computer and use it in GitHub Desktop.
trade.io Affiliate Partner API Conversion Endpoint

Introduction

Please Note: The current state of the documentation is written with ICO clients in mind, to be used for roadshow events. Examples and clarifications are given to reflect this.

Authentication

Requests should be authenticated using a bearer token which we will provide, like Authorization: Bearer TOKEN_HERE

API Host

The planned API host is https://affiliates.apis.trade.io, with an available test API on https://affiliates-test.apis.trade.io. This may be subject to change, however ample notice will be given.

Conversions

To create a conversion, this endpoint should be called whenever a user funds the project.

POST /conversions

Body

Required Params:

  • product_id - the ID of the product. In the case of ICO Roadshows, it will be an event ID which we provide.
  • email - the email address of the user funding the project.
  • amount - the amount as a decimal the user is funding the project.
  • amount_currency - the amount currency (fiat or crypto) the user is funding with, as a 3-character currency code string.

Optional Params:

  • sending_wallet - the sending wallet address the user is funding the project with, in case of using a cryptocurrency.
  • receiving_wallet - the receiving wallet address or smart contract for funding the project.
  • mobile - the funding user's mobile phone number.
  • country - the funding user's country.
  • meta - any additional arbitrary metadata, as a serialized JSON string.
{
  "product_id": "event-id-here",
  "email": "user_email@example.com",
  "amount": "4000",
  "amount_currency": "MYR",
  "meta": "{\"paytrust_88_confirmation\": \"exampleconfirmation123456\"}"
}
Response

Success Reponse: 202 CREATED, no body.

Error Response Example:

422 Unprocessable Entity

{
  "error": {
    "message": "Invalid Product ID"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment