LAGO_URL="https://api.getlago.com"
ORDER_ID="__ORDER_ID__"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/orders/$ORDER_ID/execute" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"order": {
"execution_mode": "execute_in_lago"
}
}'
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import OrderExecute
client = Client(api_key='__YOUR_API_KEY__')
try:
client.orders.execute('__ORDER_ID__', OrderExecute(execution_mode='execute_in_lago'))
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.orders.execute('__ORDER_ID__', { execution_mode: 'execute_in_lago' })
await client.orders.executeOrder("__ORDER_ID__", {
order: { execution_mode: "execute_in_lago" },
});
import (
"context"
"fmt"
lago "github.com/getlago/lago-go-client"
)
func main() {
lagoClient := lago.New().SetApiKey("__YOUR_API_KEY__")
ctx := context.Background()
order, err := lagoClient.Order().Execute(ctx, "__ORDER_ID__", &lago.OrderExecuteInput{
ExecutionMode: lago.OrderExecutionModeExecuteInLago,
})
if err != nil {
// Error is *lago.Error
panic(err)
}
// order is *lago.Order
fmt.Println(order)
}
{
"order": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"number": "OR-2026-0001",
"status": "created",
"order_type": "subscription_creation",
"execution_mode": "execute_in_lago",
"currency": "USD",
"executed_at": "2026-07-01T00:00:00Z",
"execution_record": {
"executed_at": "2026-07-01T00:00:00Z",
"execution_mode": "execute_in_lago",
"invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"subscription_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"terminated_subscription_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"applied_coupon_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"wallet_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"errors": [
"plan_not_found"
]
},
"lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_order_form_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2026-04-29T08:59:51Z",
"updated_at": "2026-04-29T08:59:51Z",
"billing_snapshot": {
"addOns": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"type": "add_on",
"payload": {
"code": "setup_fee",
"units": 1,
"unitAmountCents": 10000,
"totalAmountCents": 10000,
"fromDatetime": "2026-01-01T00:00:00Z",
"toDatetime": "2026-12-31T23:59:59Z"
},
"overrides": {
"description": "Onboarding package, discounted for the first year",
"units": 2,
"unitAmountCents": 8000,
"totalAmountCents": 16000,
"invoiceDisplayName": "Onboarding",
"fromDatetime": "2026-01-01T00:00:00Z",
"toDatetime": "2026-12-31T23:59:59Z"
}
}
],
"plans": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "plan",
"payload": {
"code": "premium_plan",
"subscriptionExternalId": "sub_1234567890",
"subscriptionName": "Premium plan - Acme Corp",
"billingTime": "calendar",
"startDate": "2026-01-01T00:00:00Z",
"endDate": "2027-01-01T00:00:00Z",
"paymentMethodId": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"charges": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"billableMetric": {
"code": "api_calls"
},
"chargeModel": "standard"
}
],
"fixedCharges": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"addOn": {
"code": "seats"
},
"chargeModel": "standard"
}
]
},
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"overrides": {
"amountCents": 50000,
"amountCurrency": "USD",
"invoiceDisplayName": "Premium",
"name": "Premium plan - Acme Corp",
"description": "Negotiated premium plan",
"trialPeriod": 30,
"minimumCommitment": {
"amountCents": 100000,
"invoiceDisplayName": "Annual commitment"
},
"usageThresholds": [
{
"amountCents": 100000,
"recurring": false,
"thresholdDisplayName": "First 1,000 EUR of usage"
}
],
"charges": [
{
"billableMetricCode": "api_calls",
"chargeModel": "standard",
"properties": {
"amount": "0.02"
},
"minAmountCents": 10000,
"invoiceDisplayName": "API calls"
}
],
"fixedCharges": [
{
"addOnCode": "seats",
"units": "10",
"properties": {
"amount": "5"
},
"invoiceDisplayName": "Seats"
}
]
}
}
],
"coupons": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"type": "coupon",
"payload": {
"code": "welcome_offer",
"type": "fixed_amount",
"amountCents": 10000,
"currency": "USD",
"percentageRate": 10.5,
"frequency": "once",
"frequencyDuration": 3
},
"overrides": {
"amountCents": 15000,
"amountCurrency": "USD",
"percentageRate": 15,
"frequency": "recurring",
"frequencyDuration": 6
}
}
],
"walletCredits": [
{
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"type": "wallet_credit",
"payload": {
"paidCredits": "100.0",
"grantedCredits": "20.0",
"rateAmount": "1.0",
"currency": "USD",
"expirationAt": "2027-01-01T00:00:00Z",
"appliesTo": {
"feeTypes": [
"charge"
],
"billableMetricCodes": [
"api_calls"
]
},
"recurringTransactionRules": [
{
"trigger": "interval",
"interval": "monthly",
"thresholdCredits": "10.0",
"method": "fixed",
"targetOngoingBalance": "100.0",
"grantsTargetTopUp": false,
"paidCredits": "100.0",
"grantedCredits": "20.0",
"startedAt": "2026-01-01T00:00:00Z",
"expirationAt": "2027-01-01T00:00:00Z",
"transactionName": "Monthly top-up",
"invoiceRequiresSuccessfulPayment": false
}
]
}
}
]
}
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 403,
"error": "Forbidden",
"code": "feature_unavailable"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Execute an order
This endpoint carries out an order on demand, without waiting for its execute_at schedule. It runs synchronously, so the response carries the resulting status and, when the execution fails, the reason it failed.
An execute_in_lago order applies the quoted deal, creating the subscriptions, coupons, wallets or one-off invoice it describes; an order_only order is simply marked as executed. What the execution produced is listed in execution_record.
Executing is idempotent: an order that has already been executed is returned untouched. An order whose previous execution failed is executed again, and a 422 is returned when the order carries no execution mode and none is provided in the body.
Restating an execution_mode that differs from the one stored on the order updates it first, which only succeeds while the order is still created: a failed order can be retried, but not switched to another mode. That update also re-validates the order’s own execute_at against the day the quoted deal stops being executable, so a 422 is possible even though no date was sent. An order carrying no execute_at is not bounded that way, and a deal whose term has passed then only fails when the execution runs.
A 404 is not limited to an unknown order: when the execution cannot find a catalog record the quote pinned, such as a deleted plan, charge, coupon or the subscription being amended, the missing resource is reported as a 404 and the order is left failed.
Concurrency is reported two ways. A mode change losing the race on the quote comes back as a 422 validation error, while the execution itself losing it comes back as a 422 carrying a lock code, because a scheduled execution relies on that error to be retried.
This is a premium feature.
LAGO_URL="https://api.getlago.com"
ORDER_ID="__ORDER_ID__"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/orders/$ORDER_ID/execute" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"order": {
"execution_mode": "execute_in_lago"
}
}'
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import OrderExecute
client = Client(api_key='__YOUR_API_KEY__')
try:
client.orders.execute('__ORDER_ID__', OrderExecute(execution_mode='execute_in_lago'))
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.orders.execute('__ORDER_ID__', { execution_mode: 'execute_in_lago' })
await client.orders.executeOrder("__ORDER_ID__", {
order: { execution_mode: "execute_in_lago" },
});
import (
"context"
"fmt"
lago "github.com/getlago/lago-go-client"
)
func main() {
lagoClient := lago.New().SetApiKey("__YOUR_API_KEY__")
ctx := context.Background()
order, err := lagoClient.Order().Execute(ctx, "__ORDER_ID__", &lago.OrderExecuteInput{
ExecutionMode: lago.OrderExecutionModeExecuteInLago,
})
if err != nil {
// Error is *lago.Error
panic(err)
}
// order is *lago.Order
fmt.Println(order)
}
{
"order": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"number": "OR-2026-0001",
"status": "created",
"order_type": "subscription_creation",
"execution_mode": "execute_in_lago",
"currency": "USD",
"executed_at": "2026-07-01T00:00:00Z",
"execution_record": {
"executed_at": "2026-07-01T00:00:00Z",
"execution_mode": "execute_in_lago",
"invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"subscription_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"terminated_subscription_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"applied_coupon_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"wallet_ids": [
"1a901a90-1a90-1a90-1a90-1a901a901a90"
],
"errors": [
"plan_not_found"
]
},
"lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_order_form_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2026-04-29T08:59:51Z",
"updated_at": "2026-04-29T08:59:51Z",
"billing_snapshot": {
"addOns": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"type": "add_on",
"payload": {
"code": "setup_fee",
"units": 1,
"unitAmountCents": 10000,
"totalAmountCents": 10000,
"fromDatetime": "2026-01-01T00:00:00Z",
"toDatetime": "2026-12-31T23:59:59Z"
},
"overrides": {
"description": "Onboarding package, discounted for the first year",
"units": 2,
"unitAmountCents": 8000,
"totalAmountCents": 16000,
"invoiceDisplayName": "Onboarding",
"fromDatetime": "2026-01-01T00:00:00Z",
"toDatetime": "2026-12-31T23:59:59Z"
}
}
],
"plans": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "plan",
"payload": {
"code": "premium_plan",
"subscriptionExternalId": "sub_1234567890",
"subscriptionName": "Premium plan - Acme Corp",
"billingTime": "calendar",
"startDate": "2026-01-01T00:00:00Z",
"endDate": "2027-01-01T00:00:00Z",
"paymentMethodId": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"charges": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"billableMetric": {
"code": "api_calls"
},
"chargeModel": "standard"
}
],
"fixedCharges": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"addOn": {
"code": "seats"
},
"chargeModel": "standard"
}
]
},
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"overrides": {
"amountCents": 50000,
"amountCurrency": "USD",
"invoiceDisplayName": "Premium",
"name": "Premium plan - Acme Corp",
"description": "Negotiated premium plan",
"trialPeriod": 30,
"minimumCommitment": {
"amountCents": 100000,
"invoiceDisplayName": "Annual commitment"
},
"usageThresholds": [
{
"amountCents": 100000,
"recurring": false,
"thresholdDisplayName": "First 1,000 EUR of usage"
}
],
"charges": [
{
"billableMetricCode": "api_calls",
"chargeModel": "standard",
"properties": {
"amount": "0.02"
},
"minAmountCents": 10000,
"invoiceDisplayName": "API calls"
}
],
"fixedCharges": [
{
"addOnCode": "seats",
"units": "10",
"properties": {
"amount": "5"
},
"invoiceDisplayName": "Seats"
}
]
}
}
],
"coupons": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"type": "coupon",
"payload": {
"code": "welcome_offer",
"type": "fixed_amount",
"amountCents": 10000,
"currency": "USD",
"percentageRate": 10.5,
"frequency": "once",
"frequencyDuration": 3
},
"overrides": {
"amountCents": 15000,
"amountCurrency": "USD",
"percentageRate": 15,
"frequency": "recurring",
"frequencyDuration": 6
}
}
],
"walletCredits": [
{
"localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
"type": "wallet_credit",
"payload": {
"paidCredits": "100.0",
"grantedCredits": "20.0",
"rateAmount": "1.0",
"currency": "USD",
"expirationAt": "2027-01-01T00:00:00Z",
"appliesTo": {
"feeTypes": [
"charge"
],
"billableMetricCodes": [
"api_calls"
]
},
"recurringTransactionRules": [
{
"trigger": "interval",
"interval": "monthly",
"thresholdCredits": "10.0",
"method": "fixed",
"targetOngoingBalance": "100.0",
"grantsTargetTopUp": false,
"paidCredits": "100.0",
"grantedCredits": "20.0",
"startedAt": "2026-01-01T00:00:00Z",
"expirationAt": "2027-01-01T00:00:00Z",
"transactionName": "Monthly top-up",
"invoiceRequiresSuccessfulPayment": false
}
]
}
}
]
}
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 403,
"error": "Forbidden",
"code": "feature_unavailable"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}LAGO_URL="https://api.getlago.com"
ORDER_ID="__ORDER_ID__"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/orders/$ORDER_ID/execute" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"order": {
"execution_mode": "execute_in_lago"
}
}'
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import OrderExecute
client = Client(api_key='__YOUR_API_KEY__')
try:
client.orders.execute('__ORDER_ID__', OrderExecute(execution_mode='execute_in_lago'))
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.orders.execute('__ORDER_ID__', { execution_mode: 'execute_in_lago' })
await client.orders.executeOrder("__ORDER_ID__", {
order: { execution_mode: "execute_in_lago" },
});
import (
"context"
"fmt"
lago "github.com/getlago/lago-go-client"
)
func main() {
lagoClient := lago.New().SetApiKey("__YOUR_API_KEY__")
ctx := context.Background()
order, err := lagoClient.Order().Execute(ctx, "__ORDER_ID__", &lago.OrderExecuteInput{
ExecutionMode: lago.OrderExecutionModeExecuteInLago,
})
if err != nil {
// Error is *lago.Error
panic(err)
}
// order is *lago.Order
fmt.Println(order)
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier assigned to the order within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the order's record within the Lago system.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
Body
Execute order payload
Parameters available when executing an order. The body is optional, as the execution mode is normally chosen when the order form is signed.
Show child attributes
Show child attributes
Response
Order executed
Show child attributes
Show child attributes
Was this page helpful?