# Ask a customer to pay

`POST /payments/requests` · Rivier · shop

Ask a customer to pay: a payment link or a checkout on the business's own Stripe account, for one amount in one currency, with the platform fee set by the platform. An agent inside the project's limits (amount cap, currency, allowed customers) creates it; outside them, or with no limits set, it waits for the owner's approval. Repeat with the same idempotency key to get the same request.

- Scope: shop:write
- Mcp: rivier_payments_request_payment
- Graphql: Mutation.shopPaymentRequestCreate
- Sdk: shop.paymentRequest.create
- Cli: shop payment request create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "amountMinor": {
      "type": "integer",
      "minimum": 1,
      "maximum": 99999999
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Za-z]{3}$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "link",
        "checkout"
      ],
      "default": "link"
    },
    "customer": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "default": "Payment"
    },
    "successUrl": {
      "type": "string",
      "format": "uri",
      "maxLength": 500
    },
    "cancelUrl": {
      "type": "string",
      "format": "uri",
      "maxLength": 500
    },
    "expiresInMinutes": {
      "type": "integer",
      "minimum": 30,
      "maximum": 1440
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 8,
      "maxLength": 100
    }
  },
  "required": [
    "amountMinor",
    "currency"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/payments/requests' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "amountMinor": 0,
  "currency": "string"
}'
```
