# Raw API quickstart

Create a payment intent from your server. The amount is yours to set\: you do not need Mayarin's catalog, carts, links or invoices, so price the order in your own backend and send the total. See [bring your own catalog](/sdk/typescript/commerce#bring-your-own-catalog).

```bash
curl https://api.mayarin.xyz/v1/payment-intents \
  --request POST \
  --header 'Authorization: Bearer sk_...' \
  --header 'Content-Type: application/json' \
  --header 'Mayarin-Version: 2026-08-11' \
  --header 'Idempotency-Key: order-4711' \
  --data '{
    "merchant": {
      "id": "merchant_123",
      "name": "Bukit Bakery",
      "city": "Kuala Lumpur",
      "countryCode": "MY"
    },
    "amount": { "amount": "45.00", "asset": "MYR" }
  }'
```

Confirm the intent, then query the payment\:

```bash
curl --request POST https://api.mayarin.xyz/v1/payment-intents/pi_.../confirm
curl https://api.mayarin.xyz/v1/payments/pi_...
```

For production, prefer a webhook over continuous polling. Polling remains useful when restoring UI state after a browser refresh.
