Изменение статуса

Обновление статуса на платёжной странице.

PATCHhttps://pipay.su/api/v2/orders/:order_id/status

Обновляет статус заказа. Для статуса dispute можно загрузить файл.

Параметры пути:

Параметр Тип Обязательно Описание
order_id string Да Уникальный идентификатор заказа.

Параметры тела запроса:

Параметр Тип Обязательно Описание
status string Да Новый статус заказа.
file file/base64 Conditional Single file to upload. Обязательно for dispute status. Can be sent as multipart/form-data file or base64 string (with необязательно data:image/png;base64, prefix). Max size: 200KB.
files array Нет Array of base64-encoded file strings (for JSON requests). Each file should be base64 string, необязательноly prefixed with data:mime/type;base64,. Max size per file: 200KB.
media array Нет Array of files (for multipart/form-data requests). Alternative to files for JSON. Max 3 files per invoice. Max size per file: 200KB.
utr string Нет RRN (референс-номер) для автозавершённого платежа (INR)
reason string Нет Reason for status change (необязательно description)

File Upload Formats:

  1. Multipart/form-data (recommended):

    • file: single file upload

    • media[]: array of files (multiple file inputs with same name)

    • Content-Тип: multipart/form-data

  2. JSON with base64:

    • file: single base64-encoded string (e.g., "data:image/png;base64,iVBORw0KGgo...")

    • files: array of base64-encoded strings

    • Content-Тип: application/json

File Upload Limits:

  • Maximum file size: 200KB (204800 bytes)

  • Maximum files per invoice: 3

  • File is обязательно for dispute/in_check status

  • Supported formats: images (JPG, PNG, etc.), PDF, and other document types

Possible Status Values:

  • dispute- апеляция (Отправка чека доступна)

  • in_check- инициация проверки оплаты от пользователя "Я оплатил". (Отправка чека доступна)

  • canceled- инициация отмены оплаты от пользователя "Отменить платеж". (Отправка чека не доступна)

Ответ:

  • { "message": "Order status updated successfully."}

Ответы с ошибкой:

  • { "message": "Платёж не найден."}

Пример тела запроса

json
{
  "status": "in_check",
  "utr": "123245",
  "reason": "subStatus",
  "otp": "otp"
}

Примеры ответов

Set Payment Status (200)

json
{
  "data": {
    "id": "a4beef6f5-9939-4c6d-be0f-18e9e24bbf13g",
    "order_id": "a4beef6f5-9939-4c6d-be0f-18e9e24bbf13g",
    "orderId": "65ada1d8-5c9c-4291-8ab1-c3ec24c82989",
    "external_id": "65ada1d8-5c9c-4291-8ab1-c3ec24c82989",
    "status": false,
    "state": "in_check",
    "type": "payin",
    "reason": null,
    "amount": "5842.00",
    "init_amount": "5842.00",
    "userId": "739620040610",
    "invoice": {
      "address": "2202208438626294",
      "bank": {
        "code": "sber",
        "name": "Сбербанк"
      },
      "message": null,
      "recipient": "Дмитрий Игоревич К",
      "method": {
        "name": "P2P",
        "logo": {
          "name": "image/c2c.png",
          "url": "https://domain.com/image/c2c.png"
        },
        "currency": "RUB"
      },
      "media": [],
      "created_at": "2025-05-17T00:07:47.000000Z",
      "updated_at": "2025-05-17T00:22:54.000000Z"
    },
    "success_uri": null,
    "fail_uri": null,
    "currency": "RUB",
    "created_at": "2025-05-17T00:07:46.000000Z",
    "updated_at": "2025-05-16T21:29:41.000000Z"
  },
  "status": true,
  "message": "Payment status updated successfully."
}

200 in_check utr (200)

json
{
  "data": {
    "id": "a4beef6f5-9939-4c6d-be0f-18e9e24bbf13g",
    "order_id": "a4beef6f5-9939-4c6d-be0f-18e9e24bbf13g",
    "orderId": "65ada1d8-5c9c-4291-8ab1-c3ec24c82989",
    "external_id": "65ada1d8-5c9c-4291-8ab1-c3ec24c82989",
    "status": false,
    "state": "in_check",
    "type": "payin",
    "reason": null,
    "amount": "5842.00",
    "init_amount": "5842.00",
    "userId": "739620040610",
    "invoice": {
      "address": "2202208438626294",
      "bank": {
        "code": "sber",
        "name": "Сбербанк"
      },
      "message": null,
      "recipient": "Дмитрий Игоревич К",
      "method": {
        "name": "P2P",
        "logo": {
          "name": "image/c2c.png",
          "url": "https://domain.com/image/c2c.png"
        },
        "currency": "RUB"
      },
      "media": [],
      "created_at": "2025-05-17T00:07:47.000000Z",
      "updated_at": "2025-05-17T00:22:54.000000Z"
    },
    "success_uri": null,
    "fail_uri": null,
    "currency": "RUB",
    "created_at": "2025-05-17T00:07:46.000000Z",
    "updated_at": "2025-05-16T21:29:41.000000Z"
  },
  "status": true,
  "message": "Payment status updated successfully."
}

422 Unprocessable Content (422)

json
{
  "message": "The selected status is invalid.",
  "errors": {
    "status": [
      "The selected status is invalid."
    ]
  }
}