<!-- ZenPays documentation · https://docs.zenpayz.com/docs/rest-api/endpoints/billing/payment-links/resolve-short-code -->

# Resolve Short Code

Resolve a short code to retrieve the associated payment link details.

:::note
This is a **public endpoint** — no authentication headers are required.
:::

<EndpointHeader verb="GET" path="/merchant/api/v1/payment-links/resolve/:shortCode" />

## Request

### Path Parameters

<ParamTable
  rows={[
    { name: "shortCode", type: "string", required: true, desc: "The payment link short code (e.g. `ZP-XYZ789`)" },
  ]}
/>

## Response

### Success (200 OK)

```json
{
  "success": true,
  "data": {
    "linkId": "pl_a1b2c3d4e5f6g7h8",
    "title": "Pro Plan Payment",
    "description": "Payment for Pro Plan subscription",
    "amount": 4999,
    "currency": "INR",
    "status": "ACTIVE",
    "usageType": "SINGLE",
    "merchantName": "Acme Corp",
    "merchantLogo": "https://example.com/logo.png",
    "paymentUrl": "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8",
    "expiresAt": "2024-02-15T23:59:59.000Z"
  },
  "message": "Payment link resolved successfully",
  "error": null,
  "meta": {
    "request_id": "req_xxxxx",
    "timestamp": "2024-01-15T10:30:00.000Z",
    "processing_time_ms": 20,
    "api_version": "v1",
    "endpoint": "GET /payment-links/resolve/:shortCode",
    "user_type": "merchant"
  }
}
```

### Error Responses

<ErrorTable
  rows={[
    { code: "PAYMENT_LINK_NOT_FOUND", status: "404", message: "Short code does not resolve to any payment link" },
    { code: "PAYMENT_LINK_EXPIRED", status: "410", message: "Payment link has expired" },
    { code: "PAYMENT_LINK_INACTIVE", status: "410", message: "Payment link is inactive" },
  ]}
/>

<CodeRail>

## Examples

<Tabs groupId="language">
  <TabItem value="curl" label="cURL" default>

```bash
curl -X GET https://api.zenpayz.com/merchant/api/v1/payment-links/resolve/ZP-XYZ789
```

  </TabItem>
  <TabItem value="javascript" label="JavaScript">

```javascript
const response = await fetch('https://api.zenpayz.com/merchant/api/v1/payment-links/resolve/ZP-XYZ789', {
  method: 'GET',
});

const result = await response.json();
console.log(result.data.linkId); // pl_a1b2c3d4e5f6g7h8
console.log(result.data.paymentUrl); // "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8"
```

  </TabItem>
  <TabItem value="sdk" label="SDK">

```javascript
const link = await zenpays.paymentLinks.resolveShortCode('ZP-XYZ789');

console.log(link.linkId); // pl_a1b2c3d4e5f6g7h8
console.log(link.paymentUrl); // "https://pay.zenpayz.com/pl_a1b2c3d4e5f6g7h8"
```

  </TabItem>
</Tabs>

</CodeRail>

## Related Endpoints

- [Pay Payment Link](/docs/rest-api/endpoints/billing/payment-links/pay-payment-link)
- [Get Payment Link](/docs/rest-api/endpoints/billing/payment-links/get-payment-link)
