## Cancel a payment request

**post** `/v3/payment_requests/{paymentRequestId}/cancel`

Cancels an unpaid payment request: the underlying payment intent is
canceled and the request moves to `canceled`. A request that is already
paid, canceled, or expired returns 409.

### Path Parameters

- `paymentRequestId: string`

### Returns

- `PaymentRequest object { id, amount, checkout_url, 9 more }`

  - `id: string`

    Unique identifier of the payment request.

  - `amount: number`

    Amount in the currency's minor units.

  - `checkout_url: string`

    URL the recipient opens to pay:
    `https://zero.linqapp.com/pay/{slug}?session=...`, where `{slug}`
    is your partner checkout slug.

  - `created_at: string`

  - `currency: string`

  - `object: string`

  - `status: "requested" or "succeeded" or "canceled" or "expired"`

    Lifecycle status of the payment request.

    - `"requested"`

    - `"succeeded"`

    - `"canceled"`

    - `"expired"`

  - `description: optional string`

  - `expires_at: optional string`

    When an unpaid request auto-expires.

  - `metadata: optional map[string]`

  - `paid_at: optional string`

    When the request was paid. Absent until it succeeds.

  - `updated_at: optional string`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/payment_requests/$PAYMENT_REQUEST_ID/cancel \
    -X POST \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "amount": 497,
  "checkout_url": "https://zero.linqapp.com/pay/tomo?session=tok_abc123",
  "created_at": "2019-12-27T18:11:19.117Z",
  "currency": "usd",
  "object": "payment_request",
  "status": "requested",
  "description": "description",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "metadata": {
    "foo": "string"
  },
  "paid_at": "2019-12-27T18:11:19.117Z",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```
