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

# Upload contingency resolution

> Upload a DIAN contingency numbering resolution for a registered Colombian supplier.

Uploads a contingency (*talonario o papel*) numbering resolution for the supplier, so it can [transmit invoices issued during a contingency](https://docs.invopop.com/guides/co-dian-invoicing.md#transmitting-invoices-issued-during-a-contingency). Use the details on the DIAN's form 1876 for the [contingency range](https://docs.invopop.com/guides/co-dian-registration.md#contingency-range).

> [!NOTE]
>
> Contingency resolutions can't be fetched from the DIAN, so they're kept as uploaded. Uploading one with the same prefix again replaces it. The silo entry must belong to the authenticated workspace and have been registered with the Colombia app first.


## OpenAPI

````yaml POST /apps/gov-co/v1/entries/{silo_entry_id}/resolutions/contingency
openapi: 3.1.0
info:
  contact:
    email: dev@invopop.com
    name: Invopop Developers
  description: >-
    Set of end-points for the Colombia app, covering the DIAN enablement and
    numbering resolutions of registered suppliers.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: Colombia Service API
  version: 0.1.0
servers:
  - description: production
    url: https://api.invopop.com
security:
  - InvopopAuth: []
paths:
  /apps/gov-co/v1/entries/{silo_entry_id}/resolutions/contingency:
    post:
      summary: Upload a contingency resolution
      description: >-
        Upload a contingency (talonario o papel) numbering resolution for a
        registered supplier, replacing any uploaded with the same prefix.
      operationId: uploadContingencyResolution
      parameters:
        - $ref: '#/components/parameters/SiloEntryID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContingencyResolution'
      responses:
        '200':
          description: The uploaded contingency resolution, as stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resolution'
        '400':
          description: >-
            The request is malformed or a resolution field is missing or
            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: resolution must have a prefix
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    SiloEntryID:
      name: silo_entry_id
      in: path
      required: true
      description: ID of the `org.Party` silo entry the supplier was registered with.
      schema:
        type: string
        example: 5b45453c-cdd0-11ed-afa1-0242ac120002
  schemas:
    ContingencyResolution:
      type: object
      required:
        - resolution_number
        - prefix
        - min_number
        - max_number
        - start_date
        - end_date
      properties:
        resolution_number:
          type: string
          description: >-
            Number of the DIAN contingency numbering resolution, as shown on
            form 1876.
          example: '18764000012345'
        prefix:
          type: string
          description: |-
            Series prefix authorized by the resolution. Use it as the
            `series` of the contingency invoices.
          example: CONT
        min_number:
          type: integer
          format: int64
          description: First invoice code authorized in the range.
          example: 1
        max_number:
          type: integer
          format: int64
          description: Last invoice code authorized in the range.
          example: 5000
        start_date:
          type: string
          format: date
          description: First day the resolution is valid.
          example: '2026-01-01'
        end_date:
          type: string
          format: date
          description: Last day the resolution is valid.
          example: '2027-12-31'
    Resolution:
      type: object
      properties:
        prefix:
          type: string
          description: |-
            Series prefix authorized by the resolution. Use it as the
            invoice `series`.
          example: SETP
        resolution_number:
          type: string
          description: Number of the DIAN numbering resolution.
          example: '18760000001'
        min_number:
          type: integer
          format: int64
          description: First invoice code authorized in the range.
          example: 990000000
        max_number:
          type: integer
          format: int64
          description: Last invoice code authorized in the range.
          example: 995000000
        start_date:
          type: string
          format: date
          description: First day the resolution is valid.
          example: '2019-01-19'
        end_date:
          type: string
          format: date
          description: Last day the resolution is valid.
          example: '2030-01-19'
        technical_key:
          type: string
          description: |-
            Technical key the DIAN assigned to the range, used to compute
            each invoice's CUFE. Empty for contingency resolutions.
          example: fc8eac422eba16e22ffd8c6f94b3f40a6e38162c
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable description of the error.
          example: the DIAN TestSetId is required
  responses:
    Unauthorized:
      description: Missing or invalid authentication token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: missing enrollment
    NotFound:
      description: |-
        The referenced silo entry has no registered supplier account in the
        authenticated workspace. Run the registration workflow first.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: not found
    InternalServerError:
      description: An unexpected server-side error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal error
  securitySchemes:
    InvopopAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        Authenticate using a valid Invopop enrollment token in the `Bearer`
        scheme.

        Example: `Authorization: Bearer <token>`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.