Endpoints documentation

Base API URL

Staging environment: https://public-api.tgb-preprod.com Production environment: https://public-api.tgbwidget.com
post
https://public-api.tgbwidget.com
/v1/login
Login

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_LOGIN_CREDENTIALS if incorrect pair of login/password passed
  • INACTIVE_USER if user is restricted to access the API
post
https://public-api.tgbwidget.com
/v1/refresh-tokens
RefreshTokens

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_JWT_TOKEN if Refresh Token not found or revoked
  • INACTIVE_USER if user is restricted to access the API
get
https://public-api.tgbwidget.com
/v1/organizations/list
GetOrganizationsList

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_JWT_TOKEN if Access Token is invalid (for example signature is invalid)
  • EXPIRED_JWT_TOKEN if Access Token is expired. Please refresh tokens
  • UNAUTHORIZED_USER if no Access Token is passed or endpoint usage is not allowed to your user
  • INACTIVE_USER if user is restricted to access the API
get
https://public-api.tgbwidget.com
/v1/organization/:id
GetOrganizationById

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_JWT_TOKEN if Access Token is invalid (for example signature is invalid)
  • EXPIRED_JWT_TOKEN if Access Token is expired. Please refresh tokens
  • UNAUTHORIZED_USER if no Access Token is passed or endpoint usage is not allowed to your user
  • INACTIVE_USER if user is restricted to access the API
get
https://public-api.tgbwidget.com
/v1/crypto-to-usd-rate?currency={currencyCode}
Get Crypto Rate
post
https://public-api.tgbwidget.com
/v1/deposit-address
CreateDepositAddress
receiptEmail is optional. The Giving Block won't send receipt email If organization has isReceiptEnabled as false (available in response from GetOrganizationsList method) or your API account has default setting that tells us to not send any receipt emails for transactions created through the API. In case if you need The Giving Block to send receipt emails - ask us to set up your API account accordingly and make sure you send receiptEmail in CreateDepositAddress request.
If donation is not anonymous - fields firstName, lastName, addressLine1, addressLine2, country, state, city, zipcode are required.
Returned pledgeId field is an unique identifier for the donation. It will be sent along with transactions' notifications as pledgeId to link events to donations.
Some notes on qrCode property: it is base64 encoded QR code image that represents depositAddress . That being said, when you decode that QR code, you'll get a text that is in depositAddress field. This image can be used to display on your donation page to give to the donor an easy way to enter depositAddress to make a donation.
post
https://public-api.tgbwidget.com
/v1/currencies/list
List Currencies

Available Currencies

See Deposit Currencies documentation section

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_JWT_TOKEN if Access Token is invalid (for example signature is invalid)
  • EXPIRED_JWT_TOKEN if Access Token is expired. Please refresh tokens
  • UNAUTHORIZED_USER if no Access Token is passed or endpoint usage is not allowed to your user
  • INACTIVE_USER if user is restricted to access the API​
post
https://public-api.tgbwidget.com
/v1/transaction/list
GetTransactionList

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_JWT_TOKEN if Access Token is invalid (for example signature is invalid)
  • EXPIRED_JWT_TOKEN if Access Token is expired. Please refresh tokens
  • UNAUTHORIZED_USER if no Access Token is passed or endpoint usage is not allowed to your user
  • INACTIVE_USER if user is restricted to access the API
post
https://public-api.tgbwidget.com
/v1/organizations/total-raised
GetTotalRaisedStats

Possible errors

Error Codes:
  • INVALID_REQUEST in case if invalid POST body passed
  • INVALID_JWT_TOKEN if Access Token is invalid (for example signature is invalid)
  • EXPIRED_JWT_TOKEN if Access Token is expired. Please refresh tokens
  • UNAUTHORIZED_USER if no Access Token is passed or endpoint usage is not allowed to your user
  • INACTIVE_USER if user is restricted to access the API

Error Codes

Code
Description
EXPIRED_JWT_TOKEN
Expired JWT token used, refresh tokens to continue using the API
INVALID_JWT_TOKEN
Invalid JWT token used, try login again
UNAUTHORIZED_USER
Access to the endpoint is forbidden
INACTIVE_USER
API user is disabled
INVALID_LOGIN_CREDENTIALS
Wrong pair of login/password used
INVALID_REQUEST
Request validation failed