# Generate/Replace Invoice **PUT /api/billing/invoice/yard/{yardId}/carrier/{carrierId}/periodCode/{periodCode}** Generates the invoice for the provided yard, carrier and period. This can take long if the number of movements is high. If an invoice already exists for the given parameters, it will be replaced with the newly generated invoice. If the invoice doesn't really need to get updated, please use `GET` and `POST` methods, an invoice will be returned instantly if it is already generated, and can be generated otherwise ## Servers - GCP Development: https://api-dev.gatego.io (GCP Development) - Production: https://api.gatego.io (Production) ## Parameters ### Path parameters - **carrierId** (integer(int64)) - **periodCode** (string) - **yardId** (integer(int64)) ## Responses ### 200 OK #### Body: application/json (object) - **id** (integer(int64)) Invoice ID - **yard_id** (integer(int64)) Yard ID - **carrier_id** (integer(int64)) Carrier ID - **invoice_number** (string) Invoice number - **invoice_date** () - **period_code** (string) Code representing the billing period - **period_start** () - **period_end** () - **truck_config** (object) - **trucks_section** (object) - **trucks_missing_checkin_section** (object) - **trailer_config** (object) - **trailers_section** (object) - **trailers_missing_checkin_section** (object) - **adjustments_section** (object) - **total_amount** (number) The total amount billed in this invoice - **currency** (string) The currency used in this invoice ### 400 Bad Request ### 412 Bad Request Conflict, eg. tried to generate an invoice for a yard when is disabled by config ### 409 Bad Request Precondition Failed, eg. tried to generate an invoice for a yard/carrier when config is missing ### 401 Not Authorized ### 403 Not Allowed [Powered by Bump.sh](https://bump.sh)