Platform Integration

Connect partner merchants to your platform with token exchange and split payments.

Overview

If you operate a platform that facilitates payments on behalf of partner merchants, Glin's platform integration lets you link your account with your partners' accounts. Once linked, you can create remittances on their behalf and optionally take a platform fee using split payments.

Token Exchange

The token exchange flow creates a linked token that represents the relationship between your platform and a partner merchant. This linked token is then used for all subsequent API calls made on behalf of that partner.

How It Works

  1. Your platform has its own API token from the Glin merchant dashboard.
  2. Your partner shares their API token with you through your onboarding flow.
  3. You call the token exchange endpoint, sending the partner's token in the request body while authenticating with your own platform token.
  4. Glin returns a linked token that represents the platform-partner relationship.
  5. Use the linked token for all subsequent API calls on behalf of that partner.
POST/merchant-api/token-exchange/

Request

bash
curl --request POST \
  --url https://pay.staging.glin.com.br/merchant-api/token-exchange/ \
  --header 'Authorization: Bearer PLATFORM_OWN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data 'PARTNER_TOKEN'
The Authorization header contains your platform's own token. The request body contains the partner merchant's token as a plain string.
Store the linked token securely on your server. You will need it for every API call made on behalf of this partner. Do not expose it to client-side code.

Split Payments

When creating a remittance with a linked token, you can optionally include splitAmount and splitCurrency fields to specify a platform fee. The split amount is deducted from the remittance total and sent to your platform account.

How Splits Work

For example, if you create a $92 remittance with a $2 split amount, the partner merchant receives $90 and your platform receives $2. The customer is charged the full remittance amount ($92).

POST/merchant-api/remittances/

Request with Split

bash
curl --request POST \
  --url https://pay.staging.glin.com.br/merchant-api/remittances/ \
  --header 'Authorization: Bearer LINKED_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "clientReferenceId": "split-order-123",
  "amount": 92.00,
  "splitAmount": 2.00,
  "currency": "USD",
  "expiresAt": "2026-03-01T19:00:00Z",
  "successUrl": "https://your-site.com/success",
  "cancelUrl": "https://your-site.com/cancel"
}'
The splitAmount and splitCurrency fields are optional. If omitted, the full remittance amount goes to the partner merchant with no platform fee.

Integration Summary

StepEndpointAuth Token
Exchange tokensPOST /merchant-api/token-exchange/Platform's own token
Create remittancePOST /merchant-api/remittances/Linked token
Check statusGET /merchant-api/remittances/{id}Linked token