### GET /v2/subscribes Source: https://docs.mulenpay.com/subsc/subsc_getlist.html Retrieves a list of subscriptions. Returns an array of subscription objects with details like ID, description, status, currency, amount, and dates. ```APIDOC ## GET /v2/subscribes ### Description Retrieves a list of subscriptions. ### Method GET ### Endpoint /v2/subscribes ### Response #### Success Response (200) - **items** (array of Subscribe) - List of subscriptions - **id** (integer) - Subscription ID - **description** (string) - Description - **status** (integer) - Status - **currency** (string) - Payment currency (rub) - **amount** (string) - Payment amount with kopecks as string, e.g., 100.50 - **start_date** (string) - Start date - **next_pay_date** (string) - Next payment date - **interval** (string) - Billing interval, possible values: Day, Week, Month #### Response Example { "items": [ { "id": 1, "description": "string", "status": 0, "currency": "rub", "amount": "1000.50", "start_date": "string", "next_pay_date": "string", "interval": null } ] } #### Error Responses - **401 Unauthorized** - Unauthorized - Example: {"error": "unauthorized", "status": 401} - **422 Unprocessable Entity** - Validation error - Example: {"error": "param is missing or the value is empty: article", "status": 422} ``` -------------------------------- ### GET /v2/payments Source: https://docs.mulenpay.com/pays/pays_getlist.html Получение списка платежей. Возвращает массив платежей с деталями. Требуется авторизация. ```APIDOC ## GET /v2/payments ### Description Получение списка платежей. ### Method GET ### Endpoint /v2/payments ### Response #### Success Response (200) - **items** (array of Payment) - Список платежей - **id** (integer) - ID платежа - **uuid** (string) - UUID платежа - **amount** (string) - Сумма платежа - **currency** (string) - Валюта платежа - **description** (string) - Описание платежа - **status** (integer) - Статус платежа (0: Создан, 1: В обработке, 2: Отменен, 3: Обработан, 4: Ошибка, 5: Холд, 6: Холд) #### Response Example { "items": [ { "id": 1, "uuid": "string", "amount": "string", "currency": "string", "description": "string", "status": 3 } ] } #### Error Responses ##### 401 Unauthorized { "error": "unauthorized", "status": 401 } ##### 422 Unprocessable Entity { "error": "param is missing or the value is empty: article", "status": 422 } ``` -------------------------------- ### Пример успешного ответа (200) для GET /v2/subscribes Source: https://docs.mulenpay.com/subsc/subsc_getlist.html Ответ со списком подписок. Содержит массив items с полями id, description, status, currency, amount, start_date, next_pay_date, interval. Поле amount представлено строкой с копейками, например "1000.50". ```json { "items": [ { "id": 1, "description": "string", "status": 0, "currency": "rub", "amount": "1000.50", "start_date": "string", "next_pay_date": "string", "interval": null } ] } ``` -------------------------------- ### GET /v2/shops/{shopId}/balances Source: https://docs.mulenpay.com/bal/bal_getbalances.html Получение балансов магазина по его ID. Возвращает список балансов с указанием валюты, общего баланса, суммы на холде и доступной суммы. ```APIDOC ## GET /v2/shops/{shopId}/balances ### Description Получение балансов магазина по его ID. ### Method GET ### Endpoint /v2/shops/{shopId}/balances ### Parameters #### Path Parameters - **shopId** (integer) - Required - ID магазина ### Response #### Success Response (200) - **success** (boolean) - Флаг успеха - **data** (object) - Объект с данными - **data.balances** (array) - Список балансов магазина - **data.balances.shop_id** (integer) - ID магазина - **data.balances.currency** (string) - Валюта баланса - **data.balances.balance** (number) - Общий баланс - **data.balances.hold** (number) - Сумма на холде - **data.balances.available** (number) - Доступная сумма (balance - hold) #### Response Example ```json { "success": true, "data": { "balances": [ { "shop_id": 5, "currency": "rub", "balance": 1000.5, "hold": 200, "available": 800.5 } ] } } ``` #### Error Responses - **401 Unauthorized** - Неавторизованный доступ - **403 Forbidden** - Магазин не найден или не принадлежит текущему пользователю - **422 Unprocessable Entity** - Ошибка валидации данных ``` -------------------------------- ### GET /v2/payments/{id} Source: https://docs.mulenpay.com/pays/pays_getdata.html Retrieves payment details by the payment ID. Returns payment information including status, amount, currency, and description. ```APIDOC ## GET /v2/payments/{id} ### Description Retrieves payment details by the payment ID. ### Method GET ### Endpoint /v2/payments/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Payment ID ### Response #### Success Response (200) - **success** (boolean) - Flag indicating success - **payment** (object) - Payment details - **id** (integer) - Payment ID - **uuid** (string) - UUID of the payment - **amount** (string) - Payment amount - **currency** (string) - Payment currency - **description** (string) - Payment description - **status** (integer) - Payment status (0: Created, 1: Processing, 2: Cancelled, 3: Processed, 4: Error, 5: Hold, 6: Hold) #### Response Example ```json { "success": true, "payment": { "id": 1, "uuid": "string", "amount": "string", "currency": "string", "description": "string", "status": 3 } } ``` #### Error Responses - **401 Unauthorized** - Unauthorized request ```json { "error": "unauthorized", "status": 401 } ``` - **422 Unprocessable Entity** - Validation error ```json { "error": "param is missing or the value is empty: article", "status": 422 } ``` ``` -------------------------------- ### 200 Response for GET /v2/payments/{id}/receipt Source: https://docs.mulenpay.com/fiscal/fiscal_getdata.html Пример успешного ответа сервера при запросе данных о чеке. ```json { "status": "success", "items": [ { "id": 1, "daemon_code": "DAEMON123", "device_code": "DEVICE456", "warnings": [ "Warning 1", "Warning 2" ], "error": [ "Error 1", "Error 2" ], "ecr_registration_number": "REG123456", "fiscal_document_attribute": 1, "fiscal_document_number": 1001, "fiscal_receipt_number": 5001, "fn_number": "FN123456", "fns_site": "https://fns.ru", "receipt_datetime": "2023-10-01T12:00:00Z", "shift_number": 1, "total": 1000.5, "ofd_inn": "1234567890", "ofd_receipt_url": "https://ofd.example.com/receipt/1", "status": "success", "uuid": "invoice_123", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } ] } ``` -------------------------------- ### GET /v2/payments/{id}/receipt Source: https://docs.mulenpay.com/fiscal/fiscal_getdata.html Получение данных о чеке для указанного платежа. Требуется указать ID платежа в пути запроса. ```APIDOC ## GET /v2/payments/{id}/receipt ### Description Получение данных о чеке для указанного платежа. ### Method GET ### Endpoint /v2/payments/{id}/receipt ### Parameters #### Path Parameters - **id** (integer) - Required - ID платежа, для которого нужно получить чек ### Response #### Success Response (200) - **status** (string) - Статус ответа - **items** (array of Receipt) - Список чеков - **id** (integer) - Уникальный идентификатор чека - **daemon_code** (string) - Код демона, если применимо - **device_code** (string) - Код устройства, если применимо - **warnings** (array of string) - Список предупреждений, связанных с чеком - **error** (array of string) - Список ошибок, связанных с чеком - **ecr_registration_number** (string) - Регистрационный номер ККТ - **fiscal_document_attribute** (integer) - Атрибут фискального документа - **fiscal_document_number** (integer) - Номер фискального документа - **fiscal_receipt_number** (integer) - Номер фискального чека - **fn_number** (string) - Номер фискального накопителя - **fns_site** (string) - Сайт ФНС - **receipt_datetime** (string date-time) - Дата и время создания чека - **shift_number** (integer) - Номер смены - **total** (number float) - Общая сумма чека - **ofd_inn** (string) - ИНН ОФД - **ofd_receipt_url** (string) - URL для получения чека у ОФД - **status** (string) - Статус чека - **uuid** (string) - Уникальный идентификатор заказа - **created_at** (string date-time) - Дата и время создания записи о чеке - **updated_at** (string date-time) - Дата и время последнего обновления записи о чеке #### Response Example { "status": "success", "items": [ { "id": 1, "daemon_code": "DAEMON123", "device_code": "DEVICE456", "warnings": [ "Warning 1", "Warning 2" ], "error": [ "Error 1", "Error 2" ], "ecr_registration_number": "REG123456", "fiscal_document_attribute": 1, "fiscal_document_number": 1001, "fiscal_receipt_number": 5001, "fn_number": "FN123456", "fns_site": "https://fns.ru", "receipt_datetime": "2023-10-01T12:00:00Z", "shift_number": 1, "total": 1000.5, "ofd_inn": "1234567890", "ofd_receipt_url": "https://ofd.example.com/receipt/1", "status": "success", "uuid": "invoice_123", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } ] } #### Error Responses ##### 401 Unauthorized - **status** (string) - Статус ошибки - **message** (string) - Сообщение об ошибке ##### 404 Not Found - **status** (string) - Статус ошибки - **message** (string) - Сообщение об ошибке ``` -------------------------------- ### POST /payments/callback Source: https://docs.mulenpay.com/call/call_makeresponse.html Отправляет запрос на callback по настроенному URL продавца (магазина), если он задан. Принимает данные о платеже в теле запроса и возвращает статус обработки. ```APIDOC ## POST /payments/callback ### Description Отправляет запрос на callback по настроенному URL продавца (магазина), если он задан. ### Method POST ### Endpoint /payments/callback ### Parameters #### Request Body - **id** (integer) - Optional - ID платежа - **amount** (number(float)) - Optional - Сумма платежа - **currency** (string) - Optional - Валюта платежа (например, RUB) - **uuid** (string) - Optional - Внешний идентификатор платежа - **payment_status** (string) - Optional - Статус платежа для колбэка (например, 'success') #### Enumerated Values - **payment_status**: success, cancel ### Request Example { "id": 12345, "amount": 100.5, "currency": "RUB", "uuid": "external-uuid-123", "payment_status": "success" } ### Response #### Success Response (200) Запрос обратного вызова успешно отправлен #### Error Responses - **400** (Bad Request) - Некорректные данные о платеже или отсутствует URL для обратного вызова - **404** (Not Found) - Платеж не найден ``` -------------------------------- ### POST /v2/payments Source: https://docs.mulenpay.com/pays/pays_create.html Создает новый платеж с указанными параметрами. Требуется тело запроса с информацией о платеже. Возвращает URL для перенаправления на оплату и идентификатор платежа. ```APIDOC ## POST /v2/payments ### Description Создает новый платеж с указанными параметрами. ### Method POST ### Endpoint /v2/payments ### Parameters #### Request Body - **body** (PaymentRequest) - Optional - Параметры платежа. - **currency** (string) - Required - Валюта платежа. - **amount** (string) - Required - Сумма платежа. - **uuid** (string) - Required - Уникальный идентификатор платежа. - **shopId** (integer) - Required - Идентификатор магазина. - **description** (string) - null - Описание платежа. - **website_url** (string) - null - URL сайта. - **subscribe** (null) - null - Подписка. - **holdTime** (null) - null - Время удержания. - **language** (string) - null - Язык. - **client** (string) - null - Email клиента. - **items** (array) - null - Список товаров. - **items[].description** (string) - null - Описание товара. - **items[].quantity** (integer) - null - Количество. - **items[].price** (integer) - null - Цена. - **items[].vat_code** (integer) - null - Код НДС. - **items[].payment_subject** (integer) - null - Предмет оплаты. - **items[].payment_mode** (integer) - null - Режим оплаты. - **items[].product_code** (string) - null - Код товара. - **items[].country_of_origin_code** (string) - null - Код страны происхождения. - **items[].customs_declaration_number** (string) - null - Номер таможенной декларации. - **items[].excise** (string) - null - Акциз. - **items[].measurement_unit** (integer) - null - Единица измерения. - **sign** (string) - null - Подпись. ### Request Example { "currency": "rub", "amount": "1000.50", "uuid": "invoice_123", "shopId": 5, "description": "Покупка булочек", "website_url": "https://example.com", "subscribe": null, "holdTime": null, "language": "ru", "client": "test@test.ru", "items": [ { "description": "string", "quantity": 0, "price": 0, "vat_code": 0, "payment_subject": 1, "payment_mode": 1, "product_code": "string", "country_of_origin_code": "string", "customs_declaration_number": "string", "excise": "string", "measurement_unit": 0 } ], "sign": "string" } ### Response #### Success Response (201) - **success** (boolean) - Флаг успеха - **paymentUrl** (string) - URL для оплаты - **id** (integer) - ID платежа #### Response Example { "success": true, "paymentUrl": "https://mulenpay.ru/", "id": 1 } #### Error Response (401) - **error** (string) - Описание ошибки - **status** (integer) - HTTP статус #### Response Example { "error": "unauthorized", "status": 401 } #### Error Response (422) - **error** (string) - Описание ошибки - **status** (integer) - HTTP статус #### Response Example { "error": "param is missing or the value is empty: article", "status": 422 } ``` -------------------------------- ### Запрос создания платежа (POST /v2/payments) Source: https://docs.mulenpay.com/pays/pays_create.html Тело запроса для создания платежа через POST /v2/payments. Содержит обязательные поля currency, amount, uuid, shopId и опциональные поля для описания, клиента и товаров. ```json { "currency": "rub", "amount": "1000.50", "uuid": "invoice_123", "shopId": 5, "description": "Покупка булочек", "website_url": "https://example.com", "subscribe": null, "holdTime": null, "language": "ru", "client": "test@test.ru", "items": [ { "description": "string", "quantity": 0, "price": 0, "vat_code": 0, "payment_subject": 1, "payment_mode": 1, "product_code": "string", "country_of_origin_code": "string", "customs_declaration_number": "string", "excise": "string", "measurement_unit": 0 } ], "sign": "string" } ``` -------------------------------- ### Структура JSON-запроса создания платежа Source: https://docs.mulenpay.com/pays/pays_request.html Пример тела запроса для инициации платежа, содержащий информацию о валюте, сумме, идентификаторе магазина и перечне товаров. ```json { "currency": "rub", "amount": "1000.50", "uuid": "invoice_123", "shopId": 5, "description": "Покупка булочек", "website_url": "https://example.com", "subscribe": null, "holdTime": null, "language": "ru", "items": [ { "description": "string", "quantity": 0, "price": 0, "vat_code": 0, "payment_subject": 1, "payment_mode": 1, "product_code": "string", "country_of_origin_code": "string", "customs_declaration_number": "string", "excise": "string", "measurement_unit": 0 } ], "sign": "string" } ``` -------------------------------- ### Пример тела запроса для POST /payments/callback Source: https://docs.mulenpay.com/call/call_makeresponse.html Пример JSON объекта, передаваемого в теле запроса для отправки callback уведомления. ```json { "id": 12345, "amount": 100.5, "currency": "RUB", "uuid": "external-uuid-123", "payment_status": "success" } ``` -------------------------------- ### Пример ответа 200 Source: https://docs.mulenpay.com/bal/bal_getbalances.html Успешный ответ с балансами магазина. Содержит флаг success и массив balances с деталями по каждой валюте. ```json { "success": true, "data": { "balances": [ { "shop_id": 5, "currency": "rub", "balance": 1000.5, "hold": 200, "available": 800.5 } ] } } ``` -------------------------------- ### Пример ответа 403 Source: https://docs.mulenpay.com/bal/bal_getbalances.html Ответ при отсутствии доступа к магазину. Сообщение указывает, что магазин не найден или не принадлежит текущему пользователю. ```json { "success": false, "message": "Магазин не найден или не принадлежит текущему пользователю" } ``` -------------------------------- ### Пример JSON подписки Source: https://docs.mulenpay.com/subsc/subsc_subscribe.html Пример JSON-объекта подписки с полями id, description, status, currency, amount, start_date, next_pay_date и interval. Поле interval может быть null или принимать значения Day, Week, Month. ```json { "id": 1, "description": "string", "status": 0, "currency": "rub", "amount": "1000.50", "start_date": "string", "next_pay_date": "string", "interval": null } ``` -------------------------------- ### PUT /v2/payments/{id}/refund Source: https://docs.mulenpay.com/pays/pays_return.html Документация по операции возврата платежа. ```APIDOC ## [PUT] /v2/payments/{id}/refund ### Description Возврат платежа по идентификатору платежа. ### Method PUT ### Endpoint /v2/payments/{id}/refund ### Parameters #### Path Parameters - **id** (string) - Required - Идентификатор платежа. ### Response #### Success Response (200) - **success** (boolean) - Указывает, что возврат выполнен успешно. #### Response Example { "success": true } #### Error Responses - **401 Unauthorized** - Неавторизованный доступ. - **error** (string) - Описание ошибки. - **status** (integer) - Код статуса HTTP. - **422 Unprocessable Entity** - Ошибка валидации данных. - **error** (string) - Описание ошибки. - **status** (integer) - Код статуса HTTP. ``` -------------------------------- ### Ответ 200 при успешной отмене списания Source: https://docs.mulenpay.com/pays/pays_cansel.html Пример успешного ответа на DELETE /v2/payments/{id}/hold. Возвращает объект с полем success: true. ```json { "success": true } ``` -------------------------------- ### 200 OK Response Source: https://docs.mulenpay.com/pays/pays_getlist.html Успешный ответ сервера, содержащий массив объектов платежей. ```json { "items": [ { "id": 1, "uuid": "string", "amount": "string", "currency": "string", "description": "string", "status": 3 } ] } ``` -------------------------------- ### Пример JSON-объекта чека Source: https://docs.mulenpay.com/fiscal/fiscal_receipt.html Пример JSON-представления фискального чека со всеми полями, включая идентификаторы, предупреждения, ошибки, фискальные данные и временные метки. ```json { "id": 1, "daemon_code": "DAEMON123", "device_code": "DEVICE456", "warnings": [ "Warning 1", "Warning 2" ], "error": [ "Error 1", "Error 2" ], "ecr_registration_number": "REG123456", "fiscal_document_attribute": 1, "fiscal_document_number": 1001, "fiscal_receipt_number": 5001, "fn_number": "FN123456", "fns_site": "https://fns.ru", "receipt_datetime": "2023-10-01T12:00:00Z", "shift_number": 1, "total": 1000.5, "ofd_inn": "1234567890", "ofd_receipt_url": "https://ofd.example.com/receipt/1", "status": "success", "uuid": "invoice_123", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } ``` -------------------------------- ### Ответ 422 при ошибке валидации Source: https://docs.mulenpay.com/pays/pays_cansel.html Пример ответа с ошибкой валидации. Сообщает о отсутствии обязательного параметра article. ```json { "error": "param is missing or the value is empty: article", "status": 422 } ``` -------------------------------- ### Ответ 401 при отсутствии авторизации Source: https://docs.mulenpay.com/pays/pays_cansel.html Пример ответа с ошибкой unauthorized. Возвращает код статуса 401. ```json { "error": "unauthorized", "status": 401 } ``` -------------------------------- ### Пример ответа 422 Source: https://docs.mulenpay.com/bal/bal_getbalances.html Ответ при ошибке валидации данных. Содержит сообщение и список ошибок по полям. ```json { "success": false, "message": "Ошибка валидации", "errors": { "shop_id": [ "Поле shop_id должно быть целым числом." ] } } ``` -------------------------------- ### Пример успешного ответа (200) Source: https://docs.mulenpay.com/pays/pays_getdata.html Пример ответа при успешном получении платежа. Содержит флаг success и объект payment с полями id, uuid, amount, currency, description, status. ```json { "success": true, "payment": { "id": 1, "uuid": "string", "amount": "string", "currency": "string", "description": "string", "status": 3 } } ``` -------------------------------- ### Ответ 201 при создании платежа Source: https://docs.mulenpay.com/pays/pays_create.html Пример успешного ответа (201) на создание платежа. Содержит флаг успеха, URL для оплаты и ID платежа. ```json { "success": true, "paymentUrl": "https://mulenpay.ru/", "id": 1 } ``` -------------------------------- ### Структура объекта платежа Source: https://docs.mulenpay.com/pays/pays_payment.html Пример JSON-объекта, представляющего платеж с основными полями. ```json { "id": 1, "uuid": "string", "amount": "string", "currency": "string", "description": "string", "status": 3 } ``` -------------------------------- ### PUT /v2/payments/{id}/hold Source: https://docs.mulenpay.com/pays/pays_confirm.html Confirms the hold on funds for a specific payment. This operation is used to finalize the capture of funds that were previously reserved. ```APIDOC ## PUT /v2/payments/{id}/hold ### Description Confirms the hold on funds for a specific payment. This operation is used to finalize the capture of funds that were previously reserved. ### Method PUT ### Endpoint /v2/payments/{id}/hold ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payment. ### Response #### Success Response (200) - **success** (boolean) - Indicates whether the hold confirmation was successful. #### Response Example { "success": true } #### Error Response (401) - **error** (string) - Error message indicating unauthorized access. - **status** (integer) - HTTP status code. #### Error Response Example { "error": "unauthorized", "status": 401 } #### Error Response (422) - **error** (string) - Error message describing validation failure. - **status** (integer) - HTTP status code. #### Error Response Example { "error": "param is missing or the value is empty: article", "status": 422 } ``` -------------------------------- ### DELETE /v2/subscribes/{id} Source: https://docs.mulenpay.com/subsc/subsc_cansel.html Cancels a subscription identified by the given ID. Returns a success flag if the operation succeeds, or an error response for unauthorized or invalid requests. ```APIDOC ## DELETE /v2/subscribes/{id} ### Description Cancels a subscription by its unique identifier. ### Method DELETE ### Endpoint /v2/subscribes/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the subscription to cancel. ### Response #### Success Response (200) - **success** (boolean) - Indicates whether the cancellation was successful. #### Response Example { "success": true } #### Error Responses - **401 Unauthorized** - Returns an error object with an "unauthorized" message. { "error": "unauthorized", "status": 401 } - **422 Unprocessable Entity** - Returns an error object with a validation message. { "error": "param is missing or the value is empty: article", "status": 422 } ``` -------------------------------- ### Пример структуры объекта баланса Source: https://docs.mulenpay.com/bal/bal_balance.html JSON-объект, представляющий текущее состояние баланса магазина. ```json { "shop_id": 5, "currency": "rub", "balance": 1000.5, "hold": 200, "available": 800.5 } ``` -------------------------------- ### DELETE /v2/payments/{id}/hold Source: https://docs.mulenpay.com/pays/pays_cansel.html Cancels a hold on funds for a specific payment. This operation is used to release the reserved amount. The endpoint returns a success flag or an error message depending on the outcome. ```APIDOC ## DELETE /v2/payments/{id}/hold ### Description Cancels a hold on funds for a specific payment. This operation is used to release the reserved amount. ### Method DELETE ### Endpoint /v2/payments/{id}/hold ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payment. ### Response #### Success Response (200) - **success** (boolean) - Indicates the operation was successful. #### Response Example { "success": true } #### Error Response (401) - **error** (string) - Error message indicating unauthorized access. - **status** (integer) - HTTP status code. #### Response Example { "error": "unauthorized", "status": 401 } #### Error Response (422) - **error** (string) - Error message indicating validation failure. - **status** (integer) - HTTP status code. #### Response Example { "error": "param is missing or the value is empty: article", "status": 422 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.