---
agentTools:
  projectIndex: https://troops.readme.io/llms.txt
---

# Create UC Invoice

Uploads an invoice for a UC

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Introduction",
    "version": "1.0.0",
    "description": "The Troops Integration API is organized around\n[REST](https://en.wikipedia.org/wiki/Representational_state_transfer). It\nallows you to query and manipulate the following resources within your TEA\ntree:\n\n- Candidates and their related assets.\n- TEAs\n- Certain references:\n  - Business sectors\n  - Countries\n  - Jobs\n- Paychecks\n- Evolia syncing\n"
  },
  "paths": {
    "/api/integrations/invoices": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "operationId": "Create UC Invoice",
        "description": "Uploads an invoice for a UC",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "uc_ref": {
                    "type": "string",
                    "example": "erp:12345/0",
                    "description": "Reference of the customer, can be specified in two ways:\n\n- `troops:{uuid_of_uc}`: inner troops identifier of client will be used\n- `erp:{erp_id}`: identifier from ERP system will be used\n\nBy default considers that specified ERP identifier  \n"
                  },
                  "external_ref": {
                    "type": "string",
                    "example": "AB2022090001",
                    "description": "A unique external reference for the invoice"
                  },
                  "file": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "example": "paycheck",
                        "description": "A user friendly title for the document"
                      },
                      "file": {
                        "$ref": "#/components/schemas/FileBase64"
                      }
                    }
                  },
                  "started_on": {
                    "type": "string",
                    "format": "date",
                    "example": "2021-07-21T00:00:00.000Z",
                    "description": "Starting date of the period covered by the invoice"
                  },
                  "ended_on": {
                    "type": "string",
                    "format": "date",
                    "example": "2021-07-28T00:00:00.000Z",
                    "description": "Ending date of the period covered by the invoice"
                  },
                  "net_pay": {
                    "type": "number",
                    "example": 174.1,
                    "description": "Net amount billed to the UC"
                  },
                  "gross_pay": {
                    "type": "number",
                    "example": 200,
                    "description": "Total amount to be paid, including VAT"
                  },
                  "currency": {
                    "type": "string",
                    "example": "EUR",
                    "description": "Three-letter ISO code of the currency used"
                  },
                  "replace_previous": {
                    "type": "boolean",
                    "example": false,
                    "default": false,
                    "description": "If set to true, all existing records for the specified external reference will be removed. If it's false, such a request shall fail."
                  },
                  "client_side_dsc_file": {
                    "type": "object",
                    "nullable": true,
                    "properties": {
                      "control_mode": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          "controlled",
                          "none"
                        ]
                      },
                      "identifier": {
                        "type": "string",
                        "nullable": true,
                        "example": "C1296BB6-50AC-4097-9C3E-1016476CC3C9"
                      },
                      "hash_function": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          "md5",
                          "crc",
                          "sha256"
                        ]
                      },
                      "fingerprint": {
                        "type": "string",
                        "nullable": true,
                        "example": "66b1132a0173910b01ee3a15ef4e69583bbf2f7f1e4462c99efbe1b9ab5bf808"
                      }
                    }
                  }
                },
                "required": [
                  "uc_ref",
                  "external_ref",
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returned in case the request was handled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceId"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Create UC Invoice"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "The entire API is authenticated, so to use it you will require an API\nkey. To acquire one, please send a request to your account manager at\nTroops or to help@troops.fr.\n\nWhen making requests, you need to specify the API key using the Bearer\nscheme in the Authorization header, e.g. `Authorization: Bearer\nthis-is-my-secret-token`.\n\nYour API keys carry many privileges, so be sure to keep them secure! Do\nnot share your secret API keys in publicly accessible areas such as\nGitHub, client-side code, and so forth.\n\nAll API requests must be made over HTTPS. Calls made over plain HTTP\nwill fail. API requests without authentication will also fail.\n"
      }
    },
    "schemas": {
      "UUID": {
        "type": "string",
        "format": "uuid",
        "description": "UUID",
        "example": "123e4567-e89b-12d3-a456-426655440000"
      },
      "ResourceId": {
        "type": "object",
        "description": "Resource Identifier. One of properties \"id\" or \"uuid\" might be null.",
        "properties": {
          "uuid": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UUID"
              },
              {
                "type": "string",
                "nullable": true,
                "example": null
              }
            ]
          },
          "id": {
            "anyOf": [
              {
                "type": "integer",
                "example": 2
              },
              {
                "type": "integer",
                "nullable": true,
                "example": null
              },
              {
                "$ref": "#/components/schemas/UUID"
              },
              {
                "type": "string",
                "nullable": true,
                "example": null
              }
            ]
          }
        },
        "example": {
          "id": null,
          "uuid": "123e4567-e89b-12d3-a456-426655440000"
        }
      },
      "FileBase64": {
        "type": "string",
        "description": "A Base64 encoded binary file",
        "example": "/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k="
      }
    },
    "responses": {
      "NotFound": {
        "description": "Returned in case the requested item can not be found"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api-staging.troops.fr",
      "description": "PreProduction (Staging) server"
    },
    {
      "url": "https://api.troops.fr",
      "description": "Production server"
    },
    {
      "url": "https://api-dev.troops.online",
      "description": "Development server"
    },
    {
      "url": "https://api-{envID}.troops.online",
      "description": "Development server (Dynamic feature env)",
      "variables": {
        "envID": {
          "default": "dev",
          "description": "dev, r-********, 1202004111967626"
        }
      }
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 184,
      "2": 241,
      "3": 90,
      "4": 97,
      "5": 249,
      "6": 184,
      "7": 0,
      "8": 76,
      "9": 125,
      "10": 22,
      "11": 209
    }
  }
}
```