---
name: local-payments
description: >-
  Guides through local payment methods via Smart Glocal API: local card
  payments with country-specific parameters, Pix (Brazil), UPI (India), and
  e-wallet (Vietnam). Covers required sender fields per country.
---

# Local Card and APM Payments

## Purpose

Use this skill to accept payments via local cards (11 countries) and alternative payment methods — Pix (Brazil), UPI (India), and e-wallet (Vietnam). Each method has specific sender parameters and flow variations.

## Primary references

- [Local cards overview](https://developer.smart-glocal.com/payments/local-cards)
- [Pix (Brazil)](https://developer.smart-glocal.com/payments/payment-pix)
- [UPI (India)](https://developer.smart-glocal.com/payments/india-accounts)
- [E-wallet (Vietnam)](https://developer.smart-glocal.com/payments/country-ewallet)
- [Payment parameters](https://developer.smart-glocal.com/payments/params)

## Preconditions

- [ ] Base payment flow understood (see [one-time-payment](https://developer.smart-glocal.com/assets/skills/one-time-payment/SKILL.md))
- [ ] Currency matches the target country (BRL for Brazil, INR for India, etc.)
- [ ] Sender's document and contact info available for the country

---

## Local Cards

The flow is the same as a [standard card payment](https://developer.smart-glocal.com/assets/skills/one-time-payment/SKILL.md), but with additional fields in `participant_details.sender`.

### Required Fields by Country

| Country | Currency | Required sender fields |
|---------|----------|----------------------|
| Brazil | BRL | `full_name`, `email` |
| Chile | CLP | `full_name`, `email` |
| Colombia | COP | `full_name`, `email`, `document` |
| India | INR | `full_name`, `email`, `document`, `msisdn` |
| Indonesia | IDR | `full_name`, `email`, `document` |
| Mexico | MXN | `full_name`, `email` |
| Nigeria | NGN | `full_name`, `email` |
| Philippines | PHP | `full_name`, `email`, `document` |
| Thailand | THB | `full_name`, `email`, `document` |
| Türkiye | TRY | `full_name`, `email`, `document` |
| Vietnam | VND | `full_name`, `email`, `document` |

> **The currency must match the country.** For example, Brazil requires BRL.

### Example: Local Payment in India

```bash
curl -X POST https://demo.smart-glocal.com/api/v2/session/create \
  -H "Content-Type: application/json" \
  -H "X-PARTNER-PROJECT: shop1" \
  -H "X-PARTNER-SIGN: <signature>" \
  -d '{
    "amount_details": {
      "amount": 50000,
      "currency": "inr"
    },
    "payment_details": {
      "type": "card"
    },
    "customer": {
      "email": "buyer@example.com"
    },
    "participant_details": {
      "sender": {
        "full_name": "Raj Kumar",
        "email": "raj@example.com",
        "document": "ABCDE1234F",
        "msisdn": "919876543210"
      }
    }
  }'
```

For **cross-border** payments to India, additional fields are required: `state`, `city`, `street`, `postal_code`, `building`.

---

## Pix (Brazil)

Instant payments in Brazilian reais (BRL). The buyer pays via QR code or deep link.

### Flow

```
session/create → session/start/payment (with pix)
  → ready_to_confirm → session/confirm
  → action_required (QR/deeplink) → payment_finished
```

### Request

```bash
curl -X POST https://demo.smart-glocal.com/api/v2/session/create \
  -H "Content-Type: application/json" \
  -H "X-PARTNER-PROJECT: shop1" \
  -H "X-PARTNER-SIGN: <signature>" \
  -d '{
    "amount_details": {
      "amount": 8007,
      "currency": "BRL"
    },
    "payment_details": {
      "type": "internet_banking",
      "internet_banking": {
        "type": "pix",
        "pix": {
          "name": "Name Surname",
          "email": "email@example.com",
          "document": "12333315123"
        }
      }
    },
    "customer": {
      "reference": "user_123"
    },
    "participant_details": {
      "sender": {
        "country_iso2": "BR"
      }
    },
    "payment_options": {
      "return_url": "https://your-site.com/return"
    }
  }'
```

| Field | Description |
|-------|-------------|
| `internet_banking.type` | Always `pix` |
| `pix.name` | Payer's name |
| `pix.email` | Payer's email |
| `pix.document` | CPF (11 digits) or CNPJ (14 digits) |
| `participant_details.sender.country_iso2` | `BR` |

### After confirm

You will receive `action_required` with `customer_interaction.redirect.url` — this is the Pix deep link. Display a QR code or redirect the buyer.

### Recurring Pix

Add `"recurrent": true` in `payment_options`. After a successful payment, you get a recurring token. Subsequent payments use the `recurrent` type with the token (see [recurring skill](https://developer.smart-glocal.com/assets/skills/recurring/SKILL.md)).

---

## UPI (India)

Instant bank-to-bank transfers via UPI without card details.

### Flow

Same as standard payment, but `payment_details.type` = `bank_account` with `system_type: "upi"`.

### Request

```bash
curl -X POST https://demo.smart-glocal.com/api/v2/session/create \
  -H "Content-Type: application/json" \
  -H "X-PARTNER-PROJECT: shop1" \
  -H "X-PARTNER-SIGN: <signature>" \
  -d '{
    "amount_details": {
      "amount": 50000,
      "currency": "inr"
    },
    "payment_details": {
      "type": "bank_account",
      "bank_account": {
        "system_type": "upi",
        "upi": {}
      }
    },
    "customer": {
      "reference": "user_123"
    },
    "participant_details": {
      "sender": {
        "full_name": "Raj Kumar",
        "email": "raj@example.com",
        "document": "ABCDE1234F",
        "msisdn": "919876543210"
      }
    }
  }'
```

Standard flow follows: `start/payment` → `ready_to_confirm` → `confirm` → `action_required` (UPI app deep link) → `payment_finished`.

---

## E-wallet (Vietnam)

Payment via local e-wallets in Vietnamese dong (VND).

### Flow

Same as Pix, but `internet_banking.type` = `country_ewallet` with `country_iso2: "VN"`.

### Request

```bash
curl -X POST https://demo.smart-glocal.com/api/v2/session/create \
  -H "Content-Type: application/json" \
  -H "X-PARTNER-PROJECT: shop1" \
  -H "X-PARTNER-SIGN: <signature>" \
  -d '{
    "amount_details": {
      "amount": 100000,
      "currency": "VND"
    },
    "payment_details": {
      "type": "internet_banking",
      "internet_banking": {
        "type": "country_ewallet",
        "country_ewallet": {
          "country_iso2": "VN"
        }
      }
    },
    "customer": {
      "reference": "user_123",
      "contacts": [{
        "email": "buyer@example.com"
      }]
    },
    "participant_details": {
      "sender": {
        "full_name": "Nguyen Van A",
        "document": "123456789"
      }
    },
    "payment_options": {
      "return_url": "https://your-site.com/return"
    }
  }'
```

> Recurring payments via e-wallet are **not available**.

---

## Local Payment Methods Summary

| Method | `payment_details.type` | Key field | Countries |
|--------|----------------------|-----------|-----------|
| Local card | `card` | Standard flow + required sender fields | 11 countries |
| Pix | `internet_banking` | `internet_banking.type: "pix"` | Brazil |
| UPI | `bank_account` | `bank_account.system_type: "upi"` | India |
| E-wallet | `internet_banking` | `internet_banking.type: "country_ewallet"` | Vietnam |
