Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: external_customer_id is always received as null #397

Closed
rawwerks opened this issue Sep 3, 2024 · 4 comments
Closed

[BUG]: external_customer_id is always received as null #397

rawwerks opened this issue Sep 3, 2024 · 4 comments

Comments

@rawwerks
Copy link

rawwerks commented Sep 3, 2024

Describe the bug
The value of external_customer_id is not being received by Lago via the events API, it is always null.

To Reproduce

curl --location --request POST "https://localhost:3000/api/v1/events" \
  --header "Authorization: Bearer my-key" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "event": {
      "transaction_id": "test00001",
      "external_customer_id": "placeholder",
      "code": "test-curl",
      "properties": {
          "cost": "1"
      }
    }
}'

Expected behavior
The external_customer_id should be equal to "placeholder", instead it is null:

{
  "event": {
    "transaction_id": "test00001",
    "external_customer_id": null,
    "external_subscription_id": null,
    "code": "test-curl",
    "timestamp": 1725407284,
    "properties": {
      "cost": "1"
    }
  }
}

Additional context
here is the return, in case helpful:

{"event":{"lago_id":"ada83cb6-8d95-4a1e-b1dc-089dd0a365c1","transaction_id":"test00001","lago_customer_id":null,"code":"test-curl","timestamp":"2024-09-03T23:48:04.258Z","properties":{"cost":"1"},"lago_subscription_id":null,"external_subscription_id":null,"created_at":"2024-09-03T23:48:05Z"}}%   

related: BerriAI/litellm#5477

@rawwerks
Copy link
Author

rawwerks commented Sep 3, 2024

oh wait...this is a new change: https://docs.getlago.com/guide/migration/migration-to-v1.2.0#2-mandatory-external-subscription-id-field-in-event-payloads

so can you explain what an external_subscription_id is supposed to be?

@rawwerks
Copy link
Author

rawwerks commented Sep 4, 2024

even with this field, the external_customer_id is still null:

curl --location --request POST "https://localhost:3000/api/v1/events" \
  --header "Authorization: Bearer my-key" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "event": {
      "transaction_id": "test00002",
      "external_customer_id": "placeholder",
      "external_subscription_id": "wtf is this supposed to be?",
      "code": "test-curl",
      "properties": {
          "cost": "1"
      }
    }
}'

shows payload:

{
  "event": {
    "transaction_id": "test00002",
    "external_customer_id": null,
    "external_subscription_id": "wtf is this supposed to be?",
    "code": "test-curl",
    "timestamp": 1725407985,
    "properties": {
      "cost": "1"
    }
  }
}

and returns:

{"event":{"lago_id":"56b51d8a-4886-4347-a369-afb9038d6791","transaction_id":"test00002","lago_customer_id":null,"code":"test-curl","timestamp":"2024-09-03T23:59:45.499Z","properties":{"cost":"1"},"lago_subscription_id":null,"external_subscription_id":"wtf is this supposed to be?","created_at":"2024-09-03T23:59:45Z"}}%   

@rawwerks
Copy link
Author

rawwerks commented Sep 4, 2024

@rawwerks rawwerks closed this as completed Sep 4, 2024
@jdenquin
Copy link
Contributor

jdenquin commented Sep 4, 2024

@rawwerks yes this field is not used anymore and not supported, the source of truth is now external_subscription_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants