> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doglytdc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Payment Link

> Requests a payment link for one of your products.

#### Scope

```bash theme={null}
write payments
```

## What it does

Requests a payment link for one of your products. Returns `202`; the link becomes ready after your approval.

## Use cases

* Generate links per campaign
* Sell via chat or through an AI

**product\_id** `string\<uuid\>` *required*

ID of an active product in your account.

## Response

**status** `string`

Always `approval_required`.

**approval\_id** `string\<uuid\>`

ID of the pending approval.

**expires\_at** `string\<date-time\>`

Deadline to approve.

## Errors

| Status | Description |
| - | - |
| `400` | `invalid_product`. |
| `404` | Product does not exist in this account. |
| `401` | Invalid or revoked key. |
| `403` | Missing scopes (`insufficient_scope`). |
| `429` | Rate limit exceeded (`rate_limited`). |

```bash cURL theme={null}
curl --request POST \
  --url https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-pay/v1/payment-links \
  -u "$DPAY_CLIENT_ID:$DPAY_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"8f0c2a8e-1b7d-4a55-9a3e-1c2d3e4f5a6b"}'
```

```json 202 theme={null}
{
  "status": "approval_required",
  "approval_id": "0e9d8c7b-6a5f-4e3d-9c2b-1a0f9e8d7c6b",
  "expires_at": "2026-11-06T18:40:00Z",
  "message": "Autorize no DoglyTdc Pay › Integrações › MCP."
}
```

```json 401 theme={null}
{ "error": "unauthorized", "message": "Chave de API inválida." }
```

```json 403 theme={null}
{ "error": "insufficient_scope", "message": "Esta chave precisa dos escopos: write, payments." }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.