Envelopes

Estimate envelope cost

Changed on

What creating the envelope would cost, creating and charging nothing. Takes the creation body and checks it as creation does (max_total_credits aside); answers as an assignment's estimate: the envelope counts as one document (documents is 1, an extra one when the plan's allowance doesn't cover it), each signer's notifications and identity check count once for the whole envelope, and each digital-certificate signature on every document it is made on, as creation charges them.

Copy as Markdown Open in ChatGPT Open in Claude

post/v1/accounts/{accountId}/envelopes/estimate-cost

Request

  • Base URL
    https://api.assinafy.com.br
  • Auth
    • HTTP bearer
    • or API key in header X-Api-Key

Path parameters

accountIdstring required

Workspace account ID.

Request body

namestring required

What the invitation calls what is being signed, in place of a document's name. < is refused (400).

messagestring nullable

Optional message sent to every signer; their invitation adds the names of the documents they are on.

max_total_creditsnumber

Optional ceiling on what this request may spend, as on an assignment: refused with 409 and code CreditCeilingExceeded, nothing created or charged, when the envelope's total credits are above it. A value that is not a number of credits, zero or more, answers 400; numeric text counts, as a form-encoded body sends it. The estimate ignores it.

Example request

{
  "name": "Contrato de prestação de serviços",
  "message": "Segue o contrato e seus anexos.",
  "max_total_credits": 1.5,
  "signers": [
    {
      "id": "fa8c140cb49b79f940aab95fddd",
      "verification_method": "Email",
      "notification_methods": [
        "Email"
      ]
    }
  ],
  "documents": [
    {
      "id": "615601fab04c0a3147bb1246",
      "entries": [
        {
          "fields": [
            {
              "display_settings": {
                "left": 69,
                "top": 282,
                "width": 421,
                "height": 45.86,
                "fontFamily": "Arial",
                "fontSize": 22,
                "backgroundColor": "#D5EBFF"
              }
            }
          ]
        }
      ],
      "signer_ids": [
        "fa8c140cb49b79f940aab95fddd"
      ],
      "copy_receiver_ids": [
        "cr8c140cb49b79f940aab95fddd"
      ]
    }
  ]
}

Response

Cost estimate and balances

statusinteger

HTTP status code, mirrored in the body.

messagestring

Human-readable message; empty on success.

Example response

{
  "status": 200,
  "data": {
    "documents": 1,
    "credits": 0.9,
    "needs_extra_document": true,
    "extra_document_cost": 1,
    "total_credits": 1.9,
    "breakdown": [
      {
        "code": "NotificationWhatsapp",
        "name": "Whatsapp Notification",
        "cost": 0.9,
        "quantity": 2,
        "unit_cost": 0.45
      }
    ],
    "credit_balance": 10,
    "has_sufficient_resources": true
  }
}

Changes