🔒 Acceso Protegido

Esta documentación requiere autenticación

Skip to content

Quickstart

Using the API OnSpot PLATFORMS

4. API Documentation

Once the publicKey and secretKey are obtained:

  • Access the API documentation via the link provided in the registration email, or from the API Documentation section within the OnSpot platform.

5. Available Endpoints

The API provides two main endpoints:

  1. Generate Token - For obtaining an authentication token.
  2. Create Payouts - For sending user payouts.

Endpoint 1: Generate Token

URL: https://api.onspotintl.com/platform/generate-token-api

6. How to Use

To consume the Generate Token endpoint:

  • Add the following headers:
    • publicKey: Your public key.
    • secretKey: Your secret key.
    • environment: Specify "test" or "live" to indicate the environment.

⚠️ Each environment has its own unique keys. Ensure you use the correct pair for the environment.

Request Example Postman

Request Example cURL

bash
curl -X POST https://api.onspot.com/auth/generate-token \
-H "publicKey: your-public-key" \
-H "secretKey: your-secret-key" \
-H "environment: live"

Response Example

  • On success:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNLZXkiOiIyOTAzZDNkNWY3YTQ2ZWM4NGM2MmRlNzg4NWNhYWQzODEzMWU5ZGFhMGI1NDkyZGFhOTVhYTg1NjE5YWMzNjdkIiwiaWQiOiJmNzk3YWIyNi1mMTBlLTc1YTUtYWFhZi0yMTM4Mzc4Mjk0MmUiLCJpYXQiOjE3MzI5NjU5NDgsImV4cCI6MTczMjk2OTU0OH0.2VQRklfR-srrdld4BpBdKfHpFeqeA-84l8rUj4KOAXQ"

The token is valid for one hour and must be used for subsequent API calls.

Endpoint 2: Create Payouts

URL: https://api.onspotintl.com/accreditation/payouts/create

7. How to Use

To consume the Create Payouts endpoint:

  • Add the following headers:
    • Authorization: Include the previously generated token as a Bearer Token.
    • environment: Specify "test" or "live" to indicate the environment.

⚠️ Tokens are environment-specific. A token generated for "test" cannot be used in "live", and vice versa.

  • Include the payload in the body as an array of objects representing the payouts.

Request Example Postman

⚠️ WARNING: documentType ENUM contains

typescript
{
// National Identification Document (Documento Nacional de Identidad):
// Used in many countries (e.g., Peru, Argentina, Spain) as a primary form of identification.
DNI = 'DNI',

// Passport:
// A travel document issued by a country's government for international travel and identity verification.
PASSPORT = 'PASSPORT',

// Unique Taxpayer Registry (Registro Único de Contribuyentes):
// Used in countries like Peru for tax identification of individuals and companies.
RUC = 'RUC',

// Foreigner's Identification Card (Carné de Extranjería):
// Used in some countries (e.g., Peru) to identify foreign residents legally staying in the country.
CE = 'CE',

// Tax Identification Number (Número de Identificación Tributaria):
// Used in some countries (e.g., Colombia) for tax purposes and business identification.
NIT = 'NIT',

// Taxpayer Identification Registry (Registro Único Tributario):
// A similar tax document used in countries like Colombia to identify taxpayers.
RUT = 'RUT',

// Citizenship Card (Cédula de Ciudadanía):
// The primary identification document for citizens in countries like Colombia.
CC = 'CC',

// Temporary Protection Permit (Permiso de Protección Temporal):
// Used in countries like Colombia to grant temporary legal status to migrants.
PPT = 'PPT',
}

Request Example cURL

bash
curl -X POST https://api.onspot.com/accreditation/payouts/create \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "environment: live" \
-H "Content-Type: application/json" \
-d '[
{
"type": "BUSINESS",
"documentType": "PASSPORT",
"documentNumber": "75798566878",
"legalName": "TestStudio",
"businessRepresentative": {
"firstName": "",
"lastName": ""
},
"customerEmail": "teststudio@yopmail.com",
"amount": "6700",
"currency": "USD",
"description": "Testing"
},
{
"type": "INDIVIDUAL",
"documentType": "CC",
"documentNumber": "1017209836",
"legalName": "",
"firstName": "Aries",
"lastName": "Studio",
"customerEmail": "eduardmarbell193777@hotmail.com",
"amount": "98l00",
"currency": "USD",
"description": "Testing10"
}
]'

Response Example

  • On success:
json
[
[
{
"uuid": "068ee2eb-2442-4198-b07b-819385d7e13d",
"email": "pruebasuserapionspot@yopmail.com",
"action": "success",
"message": "created successfully"
},
{
"uuid": "0bd9137c-31e1-4af3-9465-e17bf53a4f20",
"email": "studioTesting@yopmail.com",
"action": "success",
"message": "created successfully"
}
]
]

Confirming Data or Errors

8. Check Payouts and Error Logs

  • Use the OnSpot platform to:
    • View successful payouts in the Payouts section.
    • Check the Error Logs section for any issues.
  • Switch between "test" and "live" environments using the toggle button at the top of the platform.

⚠️ Data from "test" will not appear when the platform is in "live" mode, and vice versa.


Final Recommendations

9. Important Notes

  • Contact Support: OnSpot BackOffice contact information is available in the platform for any assistance.
  • Bank Transfers: Use the banking information provided in the platform to make transfers to OnSpot.
    • If the transferred amount is less than the sum of payouts created in PROD, OnSpot will activate payouts only up to the transferred balance.

Subsections

OnspotIntl Documentation