Docflow payment requests

Завести заявку на оплату

Changed on

Заводит черновик заявки. Основание — нейтральная тройка: входящий документ ЭДО (docflow / edo_message), карточка документооборота (docflow / flow_document) или основание словами (docflow / manual). Отказ проверки называет поле (422, code docflow.payment_request.field, поле field): юрлицо, получатель, БИК, сумма, валюта, срок, назначение. По одной бумаге (счёт, закупка, договор с суммой, долг) заявок может быть несколько, пока заявки на согласовании, на доработке и согласованные вместе не больше суммы бумаги; сумма, которая в остаток заведомо не поместится, — 422 docflow.payment_request.over_claim с полем amount и суммами total, claimed, remaining, currency. Заявка на ту же сумму по той же бумаге — не отказ: карточка заявки называет её в possible_duplicates. Счёт, принесённый файлом, передаётся полем invoice_card: карточка входящего счёта и заявка на ней заводятся одной транзакцией (нужно право docflow.flow:write), отказ заявки откатывает карточку; файл кладут в карточку следом сессией загрузки.

post/api/v1/docflow/payment-requests

Request

  • Base URL: https://erp.akeda.ru
  • URL: https://erp.akeda.ru/api/v1/docflow/payment-requests
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://erp.akeda.ru/oauth2/authorize, token URL https://erp.akeda.ru/oauth2/token, scopes: akeda:delegate)

Headers

X-Tenantstring required

Slug выбранного кабинета; кабинет не является юрлицом

Request body

company_idstring uuid required
contact_idstring uuid
item_idstring uuid
amountstring required

Сумма; не больше двух знаков копеек, лишние нули отбрасываются

currencystring
due_datestring date required
purposestring required
priority'high' | 'normal' | 'low'

Приоритет оплаты, как в заявке на расходование денежных средств 1С:ERP

payment_method'bank' | 'cash'

Форма оплаты: безналичная или наличные (без банковских реквизитов, платит касса)

justificationstring

Обоснование — какую задачу решает платёж и почему сейчас; читает согласующий. Черновик сохраняется без него, отправка на согласование — нет

department_idstring uuid
project_idstring uuid
vat_rate'' | 'none' | '0' | '5' | '7' | '10' | '20' | '22'

Ставка НДС: пусто — не указана, none — без НДС, иначе процент

vat_amountstring

Сумма НДС в составе суммы заявки; у ставки none не хранится

payee_account_idstring uuid

Response

Черновик заявки

idstring uuid required
numberstring required
status'draft' | 'on_approval' | 'rework' | 'approved' | 'rejected' | 'cancelled' required

Состояние документа заявки: черновик, на согласовании, на доработке, согласована, отклонена, отозвана

progress'draft' | 'on_approval' | 'rework' | 'approved' | 'rejected' | 'cancelled' | 'scheduled' | 'sent' | 'exported' | 'partially_paid' | 'paid' | 'payment_cancelled' required

Ход заявки глазами автора: состояние документа, после согласования — состояние оплаты; exported — платёжка выгружена файлом для интернет-банка (то же слово, что у казначея)

company_idstring uuid required
company_namestring required
contact_idstring uuid
contact_namestring required
item_idstring uuid
item_namestring required
amountstring required
currencystring required
due_datestring date required
purposestring required
justificationstring required

Обоснование автора для согласующего

priority'high' | 'normal' | 'low' required

Приоритет оплаты

payment_method'bank' | 'cash' required

Форма оплаты

department_idstring uuid
department_namestring
project_idstring uuid
project_namestring
vat_rate'' | 'none' | '0' | '5' | '7' | '10' | '20' | '22'

Ставка НДС: пусто — не указана, none — без НДС

vat_amountstring

Сумма НДС

reason_code'late' | 'no_documents' | 'no_funds' | 'duplicate' | 'other'

Типовая причина отклонения казначеем: подана вне срока, нет документов, нет денег на дату, дубль, другое

can_copyboolean

Можно ли завести новую заявку по образцу этой

payee_account_idstring uuid
can_reworkboolean

Можно ли вернуть заявку на доработку: она согласована, платёжка ещё не в банке, а человек — автор или согласующий

can_refresh_payeeboolean

Можно ли обновить получателя из контрагента: автор, заявка с контрагентом — черновик, на доработке или согласованная до банка

schedule_idstring uuid
schedule_periodstring

Период регулярной заявки, за который заведена заявка

schedule_namestring

Название регулярной заявки

can_recallboolean

Можно ли вернуть заявку в черновик: автор, заявка на согласовании и ещё не согласована

can_repeatboolean

Можно ли повторить отклонённую или отозванную заявку новым черновиком

destination'' | 'calendar' | 'treasury' required

Куда ушла согласованная заявка: снимок флага маршрута

reasonstring

Причина отказа, возврата на доработку или отклонения казначеем

finance_request_idstring uuid
approval_autoboolean required

Согласована автоматически: маршрута для заявки нет и согласование не обязательно, прохода согласования не было

rejected_by_financeboolean required

Согласованную заявку отклонил казначей в модуле finance; причина — в reason

created_byinteger
created_by_namestring required
created_atstring date-time required
updated_atstring date-time required
versioninteger required
can_editboolean required
can_submitboolean required
can_cancelboolean required

Changes

    • warning

      added the new partially_paid enum value to the response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added