POST
/
v1
/
c
/
usage
/
bulk
curl --request POST \
  --url https://api.wingback.com/v1/c/usage \
  --header 'wb-key: <wb-key>' \
  --data '[
  {
    "customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
    "feature_slug": "FEATURE_A",
    "units": 10
  },
  {
    "customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
    "feature_slug": "FEATURE_B",
    "units": 1
  }
]'
[
  {
    "index": 0,
    "status": 400,
    "feedback": {
      "contract": {
        "type": "error",
        "value": "Contract not found"
      }
    }
  },
  {
    "index": 6,
    "status": 400,
    "feedback": {
      "activation": {
        "type": "error",
        "value": "timestamp provided is before contract activation date 2023-03-19T05:03:51.756Z"
      }
    }
  }
]

This endpoint allows you to upload a significant volume of usage events for multiple customers simultaneously. For detailed instructions and best practices on implementation, please refer to the Metering Guide.

The endpoint conducts preliminary validation immediately and a more in-depth validation later during the creation of billing events. If any issues are detected during the initial validation, they will be communicated in the response body, with the index corresponding to the erroneous entry. A 4xx error indicates an issue with the data you provided and should not be retried. Entries that pass validation do not return any feedback and can be deemed as successfully committed. In case of a failure (5xx) or connection issues, we recommend implementing an exponential back-off retry strategy.

Rate limits

This endpoint is designed for periodic uploads of (pre-)aggregated usage data in larger batches. By default, we guarantee a throughput capacity of 100 requests and 150,000 usage events per minute, per customer. However, our infrastructure is capable of scaling significantly beyond these limits. If your application’s demands approach or exceed these constraints, please get in touch with us.

curl --request POST \
  --url https://api.wingback.com/v1/c/usage \
  --header 'wb-key: <wb-key>' \
  --data '[
  {
    "customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
    "feature_slug": "FEATURE_A",
    "units": 10
  },
  {
    "customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
    "feature_slug": "FEATURE_B",
    "units": 1
  }
]'
[
  {
    "index": 0,
    "status": 400,
    "feedback": {
      "contract": {
        "type": "error",
        "value": "Contract not found"
      }
    }
  },
  {
    "index": 6,
    "status": 400,
    "feedback": {
      "activation": {
        "type": "error",
        "value": "timestamp provided is before contract activation date 2023-03-19T05:03:51.756Z"
      }
    }
  }
]

Authorizations

wb-key
string
header
required

Body

application/json · object[]

The body is of type object[].

Response

200

Recorded