API Reference

Translink API Documentation

Introduction

The Translink API offers a range of tools to integrate payment processing into your applications. Whether you’re building an e-commerce platform, financial application, or managing multiple currencies, Translink API can help you handle payments and track transactions seamlessly.

Base URL

https://api.translink.com/v1

All requests should be sent via HTTPS. HTTP requests will be rejected.


Authentication

Translink uses API keys for authentication. You must include the API key in the header of every request.

Authentication Example

Authorization: Bearer YOUR_API_KEY

API Endpoints

1. Payments

Create Payment

Create a new payment request.

  • Endpoint:

     
    POST /payments
  • Request Parameters:

    ParameterTypeDescription
    amountFloatThe amount of the payment (required).
    currencyStringThe currency for the payment (e.g., “USD”).
    descriptionStringA description for the transaction (optional).
    payment_methodStringPayment method such as credit_card, bank_transfer (required).
  • Example Request:

    {
    "amount": 100.00,
    "currency": "USD",
    "description": "Payment for Order #1234",
    "payment_method": "credit_card"
    }
  • Response:

     
    {
    "payment_id": "pay_abc123",
    "status": "pending",
    "amount": 100.00,
    "currency": "USD",
    "created_at": "2024-09-20T12:34:56Z"
    }

2. Retrieve Payment

Retrieve details of a specific payment using its ID.

  • Endpoint:

     
    GET /payments/{payment_id}
  • Response Example:

     
    {
    "payment_id": "pay_abc123",
    "status": "completed",
    "amount": 100.00,
    "currency": "USD",
    "created_at": "2024-09-20T12:34:56Z",
    "updated_at": "2024-09-20T13:45:00Z"
    }

3. Refund Payment

Issue a refund for a specific payment.

  • Endpoint:

     
    POST /payments/{payment_id}/refund
  • Request Parameters:

    ParameterTypeDescription
    amountFloatThe amount to refund (optional, defaults to full amount).
  • Response Example:

     
    {
    "refund_id": "ref_abc123",
    "payment_id": "pay_abc123",
    "status": "pending",
    "amount": 100.00,
    "currency": "USD",
    "created_at": "2024-09-21T10:00:00Z"
    }

4. List Transactions

Retrieve a list of all transactions for a specific account.

  • Endpoint:

     
    GET /transactions
  • Request Parameters:

    ParameterTypeDescription
    start_dateStringFilter transactions starting from this date (optional).
    end_dateStringFilter transactions up to this date (optional).
    statusStringFilter by status: completed, pending, failed (optional).
  • Response Example:

     
    [
    {
    "transaction_id": "txn_001",
    "payment_id": "pay_abc123",
    "status": "completed",
    "amount": 100.00,
    "currency": "USD",
    "created_at": "2024-09-20T12:34:56Z"
    },
    {
    "transaction_id": "txn_002",
    "payment_id": "pay_def456",
    "status": "failed",
    "amount": 50.00,
    "currency": "EUR",
    "created_at": "2024-09-21T14:22:10Z"
    }
    ]

Error Handling

Translink API returns standardized error codes and messages for all failed requests. Below is the structure of the error response:

  • Error Response Example:

     
    {
    "error": {
    "code": "INVALID_REQUEST",
    "message": "The 'amount' parameter is required."
    }
    }

Common Error Codes

CodeDescription
INVALID_REQUESTMissing or invalid parameters.
AUTHENTICATION_FAILEDIncorrect or missing API key.
PAYMENT_FAILEDPayment processing error.

For more information on how to use specific endpoints or additional parameters, please refer to the full API documentation or contact our support at [email protected].