Start Attempt
POST/api/v1/payments/{id}/attempts
- operationId
- payments.StartAttempt
- Permission
- payment.create
- Idempotency
- required
An Idempotency-Key header is required.
Parameters
| Field | in | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | Yes | |
| Idempotency-Key | header | string | Yes | |
| PG-Version | header | string |
Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
| method | enum | Values: `promptpay`, `truemoney`, `linepay`, `shopeepay`, `bank_transfer`, `direct_debit`, `installment` | |
| payment_id | string |
Example
Generated from the schema — a shape, not a sample.
{
"method": "promptpay",
"payment_id": "string"
}Responses
200 OK
Response headers: `X-Request-Id`
| Field | Type | Required | Description |
|---|---|---|---|
| amount | Money | ||
| checkout_url | string | ||
| created_at | string (date-time) | (date-time) | |
| customer_email | string | ||
| customer_name | string | ||
| customer_phone | string | ||
| description | string | ||
| expires_at | string (date-time) | (date-time) | |
| id | string | ||
| late | boolean | ||
| metadata | object | ||
| method | enum | Values: `promptpay`, `truemoney`, `linepay`, `shopeepay`, `bank_transfer`, `direct_debit`, `installment` | |
| mode | string | ||
| next_action | any | derived from current attempt action_type and action_payload | |
| number | string | ||
| reference | string | ||
| refunded_minor | integer | ||
| return_url | string | ||
| status | enum | Values: `created`, `requires_action`, `failed`, `processing`, `succeeded`, `expired`, `canceled` | |
| succeeded_at | string (date-time) | (date-time) |
{
"amount": {
"currency": "string",
"minor": 0
},
"checkout_url": "string",
"created_at": "2026-10-01T09:00:00Z",
"customer_email": "string",
"customer_name": "string",
"customer_phone": "string",
"description": "string",
"expires_at": "2026-10-01T09:00:00Z",
"id": "string",
"late": false,
"metadata": {},
"method": "promptpay",
"mode": "string",
"next_action": null,
"number": "string",
"reference": "string",
"refunded_minor": 0,
"return_url": "string",
"status": "created",
"succeeded_at": "2026-10-01T09:00:00Z"
}default Error
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | |
| detail | string | ||
| details | object | ||
| errors | object[] | ||
| errors.code | string | ||
| errors.field | string | ||
| errors.message | string | ||
| instance | string | ||
| status | integer | Yes | |
| title | string | Yes | |
| type | string |
{
"code": "string",
"detail": "string",
"details": {},
"errors": [
{
"code": "string",
"field": "string",
"message": "string"
}
],
"instance": "string",
"status": 0,
"title": "string",
"type": "string"
}Errors
Derived from the modules this operation touches, because the snapshot carries no x-errors list yet — it may list codes this operation cannot return.
Try it
POST/payments/%7Bid%7D/attemptsMakes a real call in test mode with your own key. The key stays in this tab and is never sent anywhere but the API.
No API base URL is configured for this environment, so try-it is unavailable.
Starts with pg_test_. A live key is refused before any request is made.
curl -X POST '<API_BASE_URL>/api/v1/payments/%7Bid%7D/attempts' \
-H 'Authorization: Bearer pg_test_…' \
-H 'PG-Version: 2026-09-01' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: <uuid v7>' \
-d '{
"method": "promptpay",
"payment_id": "string"
}'