Checkout API

Public API used by the Checkout SDK to load checkout data, register customers, and poll payment status. These endpoints use your public key and are safe for client-side usage.

These endpoints are called automatically by the Checkout SDK. You don't need to call them directly unless building a custom integration or using the pre-registration optimization.

To submit a payment, use POST /merchant-api/remittances/{id}/pay from your backend with your API key (Bearer token). The Checkout API does not have a payment submission endpoint -- charges require server-side authentication.

Authentication

All Checkout API endpoints use the X-Public-Key header instead of a Bearer token. The public key is safe to include in client-side code.

Header
X-Public-Key: 550e8400-e29b-41d4-a716-446655440000

Send the UUID only. Keys are issued as pk_prod_<uuid> / pk_stag_<uuid> — the SDK strips that prefix for you and uses it to pick the environment host, but a direct API call must send the bare UUID. A prefixed value is rejected with 400 and errorCode: checkout.invalid-key; an unknown UUID returns 401.

Do not use your Merchant API secret key with these endpoints. The Checkout API accepts only your public key, which is designed for client-side usage.

Rate Limits

The Checkout API enforces the following rate limits:

LimitValue
Requests per minute per IP60
Payment attempts per remittance5

Exceeding rate limits returns 429 Too Many Requests. The SDK handles rate limit responses automatically with appropriate error messages.

Load Checkout Data

GET/checkout-api/checkout/{remittanceId}

Loads the initial checkout data for a remittance, including merchant information, amounts, conversion rates, and the MercadoPago public key needed for card tokenization.

Path Parameters

Name Type Required Description
remittanceIdstring (UUID)The remittance identifier (path parameter).
cURL
curl --request GET \
  --url https://pay.staging.glin.com.br/checkout-api/checkout/550e8400-e29b-41d4-a716-446655440000 \
  --header 'X-Public-Key: YOUR_PUBLIC_KEY'

Response

json
{
  "remittanceId": "550e8400-e29b-41d4-a716-446655440000",
  "merchantName": "Acme Inc",
  "amount": 500.00,
  "currency": "USD",
  "paymentCurrency": "BRL",
  "convertedAmount": 2845.00,
  "conversionRate": 5.69,
  "mercadoPagoPublicKey": "APP_USR-..."
}

Register Customer

POST/checkout-api/customer/register

Registers a new customer with their tax ID, name, email, and phone. This triggers a background compliance check (KYC). The customer transitions from REGISTERED to ACTIVE once the check completes (typically 5-15 seconds).

You can call this endpoint early (before payment) to pre-register the customer and eliminate the compliance wait at payment time. Pass the returned customerId to the SDK via data.customerId. For card payments, also pass data.customer.taxId so the SDK can tokenize the card. See the pre-registration optimization.

Request Body

Name Type Required Description
taxIdstringCustomer CPF or CNPJ (numbers only, no formatting).
namestringFull name of the customer.
emailstringEmail address of the customer.
phonestringCustomer phone number in E.164 format, for example +5511999999999.

Example Request

cURL
curl --request POST \
  --url https://pay.staging.glin.com.br/checkout-api/customer/register \
  --header 'X-Public-Key: YOUR_PUBLIC_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "taxId": "12345678900",
  "name": "Maria Silva",
  "email": "maria@example.com",
  "phone": "+5511999999999"
}'

Response

json
{
  "customerId": 12345,
  "status": "REGISTERED"
}

Customer Status

GET/checkout-api/customer/{customerId}/status

Checks the compliance status of a registered customer. When the status transitions to ACTIVE, the customer has cleared compliance checks and can proceed with payment.

Path Parameters

Name Type Required Description
customerIdnumberThe merchant-scoped customer identifier returned from registration (path parameter). This is unique per merchant.
cURL
curl --request GET \
  --url https://pay.staging.glin.com.br/checkout-api/customer/12345/status \
  --header 'X-Public-Key: YOUR_PUBLIC_KEY'

Response

json
{
  "customerId": 12345,
  "status": "ACTIVE",
  "dueDiligenceStatus": "APPROVED"
}

The compliance check is usually completed within a few seconds. If using the pre-registration flow, poll this endpoint to determine when the customer is ready.

Payment Status

GET/checkout-api/checkout/{remittanceId}/status

Returns the current payment status for a remittance. The SDK uses this internally to determine whether the payment was approved, rejected, or requires additional action (such as 3D Secure authentication).

Poll this endpoint after pending card, 3D Secure, or PIX responses. A single remittance may contain multiple card attempts, and the latest order/payment status reflects the current attempt. Use cancelReason to show recovery messages when a card attempt is canceled.

Path Parameters

Name Type Required Description
remittanceIdstring (UUID)The remittance identifier (path parameter).
cURL
curl --request GET \
  --url https://pay.staging.glin.com.br/checkout-api/checkout/550e8400-e29b-41d4-a716-446655440000/status \
  --header 'X-Public-Key: 550e8400-e29b-41d4-a716-446655440000'

Response

json
{
  "remittanceStatus": "ORDERING",
  "orderStatus": "CREATED",
  "paymentStatus": "PROCESSING",
  "paymentMethod": "CARD",
  "paymentProvider": "MERCADOPAGO",
  "cancelReason": null,
  "threeDsRetryable": null,
  "threeDSecure": null,
  "successRedirectUrl": "https://your-site.com/order/success?id=12345"
}

When to stop polling

Stop as soon as any of these is true. A checkout that expires or is canceled before a payment exists reports it only on remittanceStatus — orderStatus and paymentStatus stay null for its whole life, so a poller that watches only those two never terminates.

  • paymentStatus is CONFIRMED, CANCELED, REJECTED or FAILED
  • orderStatus is PAID, CANCELED, EXPIRED or REJECTED
  • remittanceStatus is EXPIRED or CANCELED
json
{
  "remittanceStatus": "EXPIRED",
  "successRedirectUrl": "https://your-site.com/order/success?id=12345"
}

Also give your poller a deadline. Payment is confirmed asynchronously, so treat expiresInSeconds from GET /checkout-api/checkout/{'{'}remittanceId{'}'} as the upper bound and rely on the redirect or a webhook past that point rather than polling indefinitely.

3D Secure challenge

A card provider may raise the bank challenge after the pay call has already returned. When that happens, threeDSecure appears on the status response. Present it by POSTing creq as a form field to externalResourceUrl — the ACS does not serve the challenge from a plain GET. threeDsRetryable is true when a declined card may be retried with 3D Secure forced on.

json
{
  "remittanceStatus": "ORDERING",
  "orderStatus": "CREATED",
  "paymentStatus": "PROCESSING",
  "paymentMethod": "CARD",
  "threeDSecure": {
    "externalResourceUrl": "https://acs.example-bank.com/challenge",
    "creq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6..."
  }
}

Errors

Failures return the HTTP status plus a stable errorCode and an English message. Branch on errorCode; the message is for your logs, not for your customer.

json
{
  "errorCode": "checkout.expired",
  "message": "Remittance has expired",
  "status": 410
}
  • 400 checkout.invalid-key — X-Public-Key missing, or sent with the pk_prod_/pk_stag_ prefix instead of the bare UUID
  • 401 checkout.unauthorized — the key is unknown or has been deactivated
  • 403 checkout.forbidden — the key belongs to a different merchant than the remittance
  • 404 checkout.not-found — no such remittance
  • 409 checkout.unavailable — the remittance is no longer in a state that can be paid
  • 410 checkout.expired — the payment link expired; issue a new remittance
  • 429 checkout.rate-limited — too many requests from this IP (60/minute)
  • 429 checkout.payment-attempts-exceeded — 20 payment submissions per checkout per hour
  • 429 checkout.preparation-attempts-exceeded — 40 preparation submissions per checkout per hour