Skip to main content

Apply an add-on to a customer

caution

This endpoint is deprecated and will be removed on September 1st, 2023. It has been replaced with the endpoint to create one-off invoices.

Route

POST
/api/v1/applied_add_ons

Usage

LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request POST "$LAGO_URL/api/v1/applied_add_ons" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"applied_add_on": {
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"add_on_code": "code",
"amount_cents": 123,
"amount_currency": "EUR"
}
}'

Arguments

{
"applied_add_on": {
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"add_on_code": "code",
"amount_cents": 123,
"amount_currency": "EUR"
}
}
AttributesTypeDescription
external_customer_idString      RequiredCustomer unique identifier in your application
add_on_codeString      RequiredCode identifying the add-on.
It must match the code property of the add-on
amount_centsInteger      OptionalAmount (excluding tax) to apply to the customer.
If defined, it overrides the amount_cents property of the add-on
amount_currencyString      OptionalCurrency of the amount to apply to the customer.
If defined, it overrides the amount_currency property of the add-on.
It must match the currency of the customer's plan.

Responses

The add-on was assigned to the customer.

Returns an applied add-on object.

The applied add-on object

This object represents an add-on assigned to a customer of your business.

Schema

{
"applied_add_on": {
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
"lago_add_on_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
"add_on_code": "add-on-code",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"lago_customer_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"amount_cents": 123,
"amount_currency": "EUR",
"created_at": "2022-04-29T08:59:51Z"
}
}
AttributesDescription
lago_id     String     Not nullUnique identifer of the applied add-on in Lago application.
lago_add_on_id     String     Not nullUnique identifer of the add-on in Lago application.
add_on_code     String     Not nullCode identifying the add-on.
external_customer_id     String     Not nullUnique identifer of the customer in your application.
lago_customer_id     String     Not nullUnique identifer of the customer in Lago application.
amount_cents     Integer     Not nullAmount in cents (excluding tax).
amount_currency     String     Not nullCurrency of the amount.
created_at     String     Not null    
ISO 8601 datetime in UTC
Date of assignation of the add-on to the customer.