Redirect Checkout

Create a remittance via API and redirect your customer to Glin's hosted checkout page. No frontend integration required.

Overview

The Redirect Checkout is the simplest way to accept payments with Glin. Your server creates a remittance through the Merchant API, receives a checkoutUrl in the response, and redirects the customer to that URL. Glin handles the entire payment experience -- collecting customer details, processing the payment, and redirecting the customer back to your site.

How It Works

  1. Your server creates a remittance via POST /merchant-api/remittances/
  2. Redirect the customer to the checkoutUrl from the response
  3. Customer fills in their details and pays on Glin's hosted page
  4. On success, the customer is redirected to your successUrl
  5. Glin sends a webhook to your registered endpoint with payment confirmation

Create a Remittance

POST/merchant-api/remittances/
Use your Merchant API key in the Authorization header. You can find it in your merchant dashboard.

Request

bash
curl --request POST \
  --url https://pay.staging.glin.com.br/merchant-api/remittances/ \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "clientReferenceId": "order-12345",
  "amount": 500.00,
  "currency": "USD",
  "expiresAt": "2026-03-01T19:00:00Z",
  "successUrl": "https://your-site.com/order/success?id=12345",
  "cancelUrl": "https://your-site.com/order/cancel?id=12345"
}'

Response

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "created",
  "clientReferenceId": "order-12345",
  "amount": 500.00,
  "currency": "USD",
  "payoutAmount": 500.00,
  "payoutCurrency": "USD",
  "expiresAt": "2026-03-01T19:00:00Z",
  "successUrl": "https://your-site.com/order/success?id=12345",
  "cancelUrl": "https://your-site.com/order/cancel?id=12345",
  "checkoutUrl": "https://pay.glin.com.br/remittances/550e8400-e29b-41d4-a716-446655440000",
  "shortUrl": "https://www.glin.com.br/pay/K7M2QXPTRW"
}

Redirect the Customer

After creating the remittance, redirect the customer to the checkoutUrl returned in the response. This can be a server-side redirect (HTTP 302) or a client-side redirect using window.location.href.

javascript
// Client-side redirect
window.location.href = response.checkoutUrl;
The checkoutUrl expires at the time specified in expiresAt. Make sure to redirect the customer promptly after creating the remittance.

Webhook Notification

When the payment completes, Glin sends a webhook notification to your registered endpoint. Use webhooks to reliably confirm payment status on your server -- do not rely solely on the customer being redirected to your successUrl.

In remittance_paid, object.payment.method identifies the successful method and object.payment.installments identifies the selected installment count. Failed payment attempts are not reported in this object.

Configure your webhook endpoint in the Integrations section of your merchant dashboard.

Field Reference

Name Type Required Description
idstring (UUID)—Unique identifier for the remittance.
statusstring—Current status of the remittance. Starts as "created".
clientReferenceIdstring—Your own reference ID to correlate the remittance with your internal order.
amountnumber—Payment amount in the specified currency.
currencystring—ISO 4217 currency code (e.g. "USD", "BRL").
payoutAmountnumber—What you receive, in your payout currency (payoutCurrency). Present here because this example prices in the payout currency. Price in BRL instead and you get estimatedPayout — a quote at the current rate — until a payer starts checkout and fixes it.
payoutCurrencystring—Currency of payoutAmount: the payout currency on your contract.
expiresAtstring (ISO 8601)—Expiration timestamp. The checkout link becomes invalid after this time.
successUrlstring (URL)—URL to redirect the customer to after a successful payment.
cancelUrlstring (URL)—URL to redirect the customer to if they cancel the checkout.
checkoutUrlstring (URL)—Glin-hosted checkout page URL. Redirect your customer here to complete payment.