> ## Documentation Index
> Fetch the complete documentation index at: https://getlago.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mark an order form as signed

> This endpoint records the customer's signature on an order form, and creates the order that carries the quoted deal out.
Only a `generated` order form can be signed, so a `422` is returned once the order form has been signed, has expired or has been voided.
An `execute_at` landing on or after the day the quoted deal stops being executable is rejected as well, so the order can never be scheduled past the term it bills.
A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight.
This is a premium feature.

<RequestExample>
  ```bash cURL theme={"dark"}
  LAGO_URL="https://api.getlago.com"
  ORDER_FORM_ID="__ORDER_FORM_ID__"
  API_KEY="__YOUR_API_KEY__"

  curl --location --request POST "$LAGO_URL/api/v1/order_forms/$ORDER_FORM_ID/mark_as_signed" \
    --header "Authorization: Bearer $API_KEY" \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "order_form": {
        "signed_document": "data:application/pdf;base64,JVBERi0xLjQKJcfs...",
        "execution_mode": "execute_in_lago",
        "execute_at": "2026-07-01T00:00:00Z"
      }
    }'
  ```

  ```python Python theme={"dark"}
  from lago_python_client.client import Client
  from lago_python_client.exceptions import LagoApiError
  from lago_python_client.models import OrderFormMarkAsSigned

  client = Client(api_key='__YOUR_API_KEY__')

  try:
      client.order_forms.mark_as_signed(
          '__ORDER_FORM_ID__',
          OrderFormMarkAsSigned(
              signed_document='data:application/pdf;base64,JVBERi0xLjQKJcfs...',
              execution_mode='execute_in_lago',
              execute_at='2026-07-01T00:00:00Z',
          ),
      )
  except LagoApiError as e:
      repair_broken_state(e)  # do something on error or raise your own exception
  ```

  ```ruby Ruby theme={"dark"}
  require 'lago-ruby-client'

  client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')

  client.order_forms.mark_as_signed(
    '__ORDER_FORM_ID__',
    {
      signed_document: 'data:application/pdf;base64,JVBERi0xLjQKJcfs...',
      execution_mode: 'execute_in_lago',
      execute_at: '2026-07-01T00:00:00Z',
    },
  )
  ```

  ```js Javascript theme={"dark"}
  await client.orderForms.markOrderFormAsSigned("__ORDER_FORM_ID__", {
    order_form: {
      signed_document: "data:application/pdf;base64,JVBERi0xLjQKJcfs...",
      execution_mode: "execute_in_lago",
      execute_at: "2026-07-01T00:00:00Z",
    },
  });
  ```

  ```go Go theme={"dark"}
  import (
  	"context"
  	"fmt"
  	"time"

  	lago "github.com/getlago/lago-go-client"
  )

  func main() {
  	lagoClient := lago.New().SetApiKey("__YOUR_API_KEY__")
  	ctx := context.Background()

  	executeAt := time.Date(2026, time.July, 1, 0, 0, 0, 0, time.UTC)
  	orderForm, err := lagoClient.OrderForm().MarkAsSigned(ctx, "__ORDER_FORM_ID__", &lago.OrderFormMarkAsSignedInput{
  		SignedDocument: "data:application/pdf;base64,JVBERi0xLjQKJcfs...",
  		ExecutionMode:  lago.OrderExecutionModeExecuteInLago,
  		ExecuteAt:      &executeAt,
  	})
  	if err != nil {
  		// Error is *lago.Error
  		panic(err)
  	}

  	// orderForm is *lago.OrderForm
  	fmt.Println(orderForm)
  }
  ```
</RequestExample>


## OpenAPI

````yaml POST /order_forms/{lago_id}/mark_as_signed
openapi: 3.1.0
info:
  title: Lago API documentation
  description: >-
    Lago API allows your application to push customer information and metrics
    (events) from your application to the billing application.
  version: 1.52.0
  license:
    name: AGPLv3
    url: https://github.com/getlago/lago-openapi/blob/main/LICENSE
  contact:
    email: tech@getlago.com
servers:
  - url: https://api.getlago.com/api/v1
    description: US Lago cluster
  - url: https://api.eu.getlago.com/api/v1
    description: EU Lago cluster
security:
  - bearerAuth: []
tags:
  - name: activity_logs
    description: Everything about Activity logs
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/audit-logs/activity-logs-object
  - name: analytics
    description: Everything about Analytics
  - name: api_logs
    description: Everything about API logs
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/audit-logs/api-logs-object
  - name: billable_metrics
    description: Everything about Billable metric collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/billable-metrics/object
  - name: features
    description: Everything about Feature collection
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/entitlements/features/feature-object
  - name: entitlements
    description: Everything about Entitlement collection
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/entitlements/plan-entitlements/plan-entitlement-object
  - name: billing_entities
    description: Everything about Billing Entities
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/billing-entities/object
  - name: customers
    description: Everything about Customer collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/customers/object
  - name: plans
    description: Everything about Plan collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/plans/object
  - name: subscriptions
    description: Everything about Subscription collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/subscriptions/subscription-object
  - name: events
    description: Everything about Event collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/events/event-object
  - name: organizations
    description: Everything about Organization collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/organizations/organization-object
  - name: taxes
    description: Everything about Tax collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/taxes/tax-object
  - name: coupons
    description: Everything about Coupon collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/coupons/coupon-object
  - name: add_ons
    description: Everything about Add-on collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/add-ons/add-on-object
  - name: fees
    description: Everything about Fees
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/invoices/invoice-object#fee-object
  - name: invoices
    description: Everything about Invoice collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/invoices/invoice-object
  - name: wallets
    description: Everything about Wallet collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/wallets/wallet-object
  - name: credit_notes
    description: Everything about Credit notes collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/credit-notes/credit-note-object
  - name: webhooks
    description: Everything about Webhooks
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/webhooks/format---signature#1-retrieve-the-public-key
  - name: webhook_endpoints
    description: Everything about Webhook Endpoints
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/webhook-endpoints/webhook-endpoint-object
  - name: payment_receipts
    description: Everything about Payment receipts
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/payment-receipts/payment-receipt-object
  - name: payment_requests
    description: Everything about PaymentRequests
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/payment-requests/payment-request-object
  - name: payments
    description: Everything about Payments
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/payments/payment-object
  - name: payment_methods
    description: Everything about Payment Methods
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/payment-methods/payment-method-object
  - name: quotes
    description: Everything about Quote collection
  - name: order_forms
    description: Everything about Order form collection
  - name: orders
    description: Everything about Order collection
externalDocs:
  description: Lago Github
  url: https://github.com/getlago
paths:
  /order_forms/{lago_id}/mark_as_signed:
    parameters:
      - $ref: '#/components/parameters/lago_order_form_id'
    post:
      tags:
        - order_forms
      summary: Mark an order form as signed
      description: >-
        This endpoint records the customer's signature on an order form, and
        creates the order that carries the quoted deal out.

        Only a `generated` order form can be signed, so a `422` is returned once
        the order form has been signed, has expired or has been voided.

        An `execute_at` landing on or after the day the quoted deal stops being
        executable is rejected as well, so the order can never be scheduled past
        the term it bills.

        A concurrent write on the same quote is reported as a `422` rather than
        retried, so a duplicated call can fail while the first one is still in
        flight.

        This is a premium feature.
      operationId: markOrderFormAsSigned
      requestBody:
        description: Mark order form as signed payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderFormMarkAsSignedInput'
        required: false
      responses:
        '200':
          description: Order form marked as signed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderForm'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  parameters:
    lago_order_form_id:
      name: lago_id
      in: path
      description: >-
        Unique identifier assigned to the order form within the Lago
        application. This ID is exclusively created by Lago and serves as a
        unique identifier for the order form's record within the Lago system.
      required: true
      schema:
        type: string
        format: uuid
        example: 1a901a90-1a90-1a90-1a90-1a901a901a90
  schemas:
    OrderFormMarkAsSignedInput:
      type: object
      description: >-
        Parameters available when marking an order form as signed. Every
        parameter is optional, so an empty body records the signature without
        attaching a document, and creates an order that is not scheduled for
        execution.
      required: []
      properties:
        order_form:
          type: object
          required: []
          properties:
            signed_document:
              type: string
              description: >-
                The document signed by the customer, as a base64 data URI
                (`data:<content_type>;base64,<data>`). Accepted content types
                are `application/pdf`, `image/jpeg` and `image/png`, for a
                maximum of 10 MB. Once attached, it is exposed as
                `signed_document_url` on the order form.
              example: data:application/pdf;base64,JVBERi0xLjQKJcfs...
            execution_mode:
              $ref: '#/components/schemas/OrderExecutionModeEnum'
              description: >-
                How the order created from the order form is carried out. It
                becomes mandatory as soon as `execute_at` is provided.
            execute_at:
              type: string
              format: date-time
              description: >-
                The date and time in UTC (ISO 8601) when Lago executes the order
                created from the order form. It must be in the future, requires
                `execution_mode` to be set, and must fall strictly before the
                day the quoted deal stops being executable, otherwise signing is
                rejected with a `422`. When it is omitted, the order is created
                but not scheduled, and waits to be executed on demand.
              example: '2026-07-01T00:00:00Z'
    OrderForm:
      type: object
      required:
        - order_form
      properties:
        order_form:
          $ref: '#/components/schemas/OrderFormObject'
    OrderExecutionModeEnum:
      type: string
      description: >
        How the order created from the order form is carried out. It can be any
        of the following values:
          - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
          - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
      enum:
        - execute_in_lago
        - order_only
      example: execute_in_lago
    OrderFormObject:
      type: object
      required:
        - lago_id
        - number
        - status
        - void_reason
        - expires_at
        - signed_at
        - voided_at
        - signed_document_url
        - lago_organization_id
        - lago_customer_id
        - lago_quote_id
        - lago_quote_version_id
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          format: uuid
          description: Unique identifier of the order form, created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        number:
          type: string
          description: The unique number assigned to the order form by Lago.
          example: OF-2026-0001
        status:
          $ref: '#/components/schemas/OrderFormStatusEnum'
        void_reason:
          $ref: '#/components/schemas/OrderFormVoidReasonEnum'
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The date and time in UTC (ISO 8601) after which the order form is
            meant to expire. It is `null` when the order form never expires. It
            is validated when the quote is approved, where a value on or after
            the day the quoted deal stops being executable is rejected rather
            than clamped. Expiry is then swept hourly and compared by calendar
            date, so signing keeps succeeding until the sweep moves the order
            form to `expired`.
          example: '2026-06-30T23:59:59Z'
        signed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The date and time in UTC (ISO 8601) when the order form was marked
            as signed. It is `null` unless the `status` is `signed`.
          example: '2026-04-29T08:59:51Z'
        voided_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The date and time in UTC (ISO 8601) when the order form stopped
            being actionable. It is set both when the order form is voided and
            when it expires, and is `null` otherwise.
          example: '2026-04-29T08:59:51Z'
        signed_document_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            The URL of the signed document attached to the order form. It is
            `null` when no document was uploaded.
          example: >-
            https://api.getlago.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/OF-2026-0001
        lago_organization_id:
          type: string
          format: uuid
          description: Unique identifier of the organization, created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        lago_customer_id:
          type: string
          format: uuid
          description: >-
            Unique identifier of the customer the order form is addressed to,
            created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        lago_quote_id:
          type: string
          format: uuid
          description: >-
            Unique identifier of the quote the order form comes from, created by
            Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        lago_quote_version_id:
          type: string
          format: uuid
          description: >-
            Unique identifier of the approved quote version the order form was
            generated from, created by Lago. A quote version carries at most one
            order form.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        created_at:
          type: string
          format: date-time
          description: The date and time in UTC (ISO 8601) when the order form was created.
          example: '2026-04-29T08:59:51Z'
        updated_at:
          type: string
          format: date-time
          description: >-
            The date and time in UTC (ISO 8601) when the order form was last
            updated.
          example: '2026-04-29T08:59:51Z'
    ApiErrorUnauthorized:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
          format: int32
          example: 401
        error:
          type: string
          example: Unauthorized
    ApiErrorForbidden:
      type: object
      required:
        - status
        - error
        - code
      properties:
        status:
          type: integer
          format: int32
          example: 403
        error:
          type: string
          example: Forbidden
        code:
          type: string
          example: feature_unavailable
    ApiErrorNotFound:
      type: object
      required:
        - status
        - error
        - code
      properties:
        status:
          type: integer
          format: int32
          example: 404
        error:
          type: string
          example: Not Found
        code:
          type: string
          example: object_not_found
    ApiErrorUnprocessableEntity:
      type: object
      required:
        - status
        - error
        - code
        - error_details
      properties:
        status:
          type: integer
          format: int32
          example: 422
        error:
          type: string
          example: Unprocessable entity
        code:
          type: string
          example: validation_errors
        error_details:
          type: object
    OrderFormStatusEnum:
      type: string
      description: >
        The status of the order form. It can be any of the following values:
          - `generated`: the order form is waiting for the customer's signature.
          - `signed`: the customer has signed, and an order has been created from the order form.
          - `expired`: the order form reached its `expires_at` without being signed.
          - `voided`: the order form has been voided before being signed.

        Only a `generated` order form is actionable. Reaching `expired` or
        `voided` also voids the quote version the order form was generated from;
        signing does not, since the deal it quotes goes on to be executed.
      enum:
        - generated
        - signed
        - expired
        - voided
      example: generated
    OrderFormVoidReasonEnum:
      type:
        - string
        - 'null'
      description: >
        The reason why the order form is no longer actionable. It is `null`
        unless the `status` is `voided` or `expired`. It can be any of the
        following values:
          - `manual`: the order form has been voided explicitly, through the API or the Lago user interface.
          - `expired`: the order form reached its `expires_at` without being signed.
          - `invalid`: reserved for an order form Lago voids because it can no longer be executed. No flow writes it yet.
      enum:
        - null
        - manual
        - expired
        - invalid
      example: manual
  responses:
    Unauthorized:
      description: Unauthorized error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorUnauthorized'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorForbidden'
    NotFound:
      description: Not Found error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorNotFound'
    UnprocessableEntity:
      description: Unprocessable entity error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorUnprocessableEntity'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````