For developer documentation of the platform, please visit https://docs.paigo.tech.
Paigo API supports bearer token as the authentication method. Steps to set up authentication:
Sign up with Paigo platform and get client id and client secret.
Make a POST request to the auth endpoint https://auth.paigo.tech/oauth/token
with the following body:
{
audience: 'https://qnonyh1pc7.execute-api.us-east-1.amazonaws.com',
grant_type: 'client_credentials',
client_id: <your client id>,
client_secret: <your client secret>
}
Additionally verify that the following headers are set by the client you are using:
{
"Content-Type": "application/json"
}
Use the access token in the response to make requests to the Paigo API. Here is an example of the response:
{
access_token: <your access token>,
expires_in: 86400,
token_type: 'Bearer'
}
To use Paigo API, add in the header of your request:
{
Authorization: "Bearer <your access token>"
}
Paigo API has the following endpoint:
https://api.prod.paigo.tech
Collect usage data by API-based method. See Measure and Collect Usage Data At Production Scale for full documentation on Paigo Usage Measurement and Collection.
invoice | boolean Example: invoice=true The invoice query parameter is used to create an invoice for the usage data body. It can only be used with dimensions that have an |
dimensionId required | string The unique identifier of the dimension this usage record is associated with.
|
timestamp required | string The timestamp of usage record in RFC3339
format with a 4-digit year.
This is the time the usage occurred, or the end of the usage period.
|
customerId required | string The unique identifier of the customer this usage record attributes to.
|
recordValue required | string The amount of the usage on this record.
Numerical values are represented as strings to avoid precision loss.
|
metadata | object An optional key-value map of additional metadata to associate with this usage record.
Additional metadata to be stored on the usage record,
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record.
Metadata can be used for analytics purpose.
|
{- "dimensionId": "string",
- "timestamp": "string",
- "customerId": "string",
- "recordValue": "string",
- "metadata": { }
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
]
}
Create a dimension
See an example dimension for pay as you go pricing here
dimensionName required | string A friendly, human-readable name for the dimension.
|
required | CountBasedConsumptionUnit (object) or TimeBasedConsumptionUnit (object) or DatabasedConsumptionUnit (object) Consumption unit of the dimension.
Paigo supports three types of consumption units: count-based, time-based, and data-based.
Supported values for each consumption unit type are listed below.
This field accepts a JSON object with the following schema:
|
usageIncrement required | string The minimum increment for usage amount.
As an example, if usage increment is 1 Hour job execution time,
then 1 Hour and 5 Minutes execution time may be calculated as 1 Hour or 2 Hours,
depending on the rounding algorithm field of the dimension.
|
number or string Used with Subscription Tier Offering type. | |
aggregationInterval | string Default: "hour" Enum: "none" "hour" "day" "month" Time interval to aggregate dimension usage data for billing. |
aggregationMethod | string Default: "max" Enum: "sum" "max" "min" "count" "average" "last" The algorithm to aggregate raw usage data for billing.
|
measurementId | string The unique identifier of the measurement attached to the dimension. |
rounding required | string Enum: "round" "floor" "ceiling" The rounding algorithm that is used to calculate the amount of usage increment.
Ceiling algorithm rounds up, floor algorithm rounds down, the round algrogrithm rounds to the nearest whole integer rounding half away from zero.
As an example, if usage increment is 1 Hour job execution time,
then 1 Hour and 5 Minutes execution time may be calculated as 2 Hours for ceiling algorithm, 1 Hour for floor algorithm, and 1 Hour for round algorithm.
depending on the rounding algorithm field of the dimension.
|
overageAllowed | string Enum: "true" "false" Used with Subscription Tier Offering type. |
consumptionPrice | string The unit price of dimension.
Numerical values are represented as strings to avoid precision loss.
|
sampleType | string Enum: "gauge" "continious" The sample type used for the data. Gauge is a value that can go up or down. |
paymentSchedule | string Enum: "upfront" "arrear" The payment schedule for the dimension. Determines when billing should occur for a dimension. |
metadata | object An optional key-value map of additional metadata to associate with the dimensions.
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record. Additionally, if |
Array of objects (DimensionTierDto) Used to more granularly define the price of a dimension. For example if you want to charge a customer $1 for the first 1000 API calls and $0.50 for every API call after that you would define two tiers, the first tier with an | |
Array of objects (DimensionTiersGroupByMetadataDto) Used to group tiers by metadata, meaning instead of grouping by the dimensionId for usage Paigo will group requests with the metadata passed in on the usage request. Exclusive with standard |
{- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "measurementId": "5f7d1e3a-3b2d-4b0a-8b9a-5b9b5c9b5c9b",
- "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "dimensionId": "fcb1fa34-8f11-4832-80f2-464cbc7a8546"
}
Fine a dimension
dimensionId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
]
}
Update a dimension
dimensionId required | string The unique identifier assigned by Paigo. |
dimensionName | string A friendly, human-readable name for the dimension.
|
CountBasedConsumptionUnit (object) or TimeBasedConsumptionUnit (object) or DatabasedConsumptionUnit (object) Consumption unit of the dimension.
Paigo supports three types of consumption units: count-based, time-based, and data-based.
Supported values for each consumption unit type are listed below.
This field accepts a JSON object with the following schema:
| |
usageIncrement | string The minimum increment for usage amount.
As an example, if usage increment is 1 Hour job execution time,
then 1 Hour and 5 Minutes execution time may be calculated as 1 Hour or 2 Hours,
depending on the rounding algorithm field of the dimension.
|
number or string Used with Subscription Tier Offering type. | |
aggregationInterval | string Default: "hour" Enum: "none" "hour" "day" "month" Time interval to aggregate dimension usage data for billing. |
aggregationMethod | string Default: "max" Enum: "sum" "max" "min" "count" "average" "last" The algorithm to aggregate raw usage data for billing.
|
measurementId | string The unique identifier of the measurement attached to the dimension. |
Array of objects (DimensionTierDto) In order to remove tiers from a dimension, set the tiers array to | |
rounding | string Enum: "round" "floor" "ceiling" The rounding algorithm that is used to calculate the amount of usage increment.
Ceiling algorithm rounds up, floor algorithm rounds down, the round algrogrithm rounds to the nearest whole integer rounding half away from zero.
As an example, if usage increment is 1 Hour job execution time,
then 1 Hour and 5 Minutes execution time may be calculated as 2 Hours for ceiling algorithm, 1 Hour for floor algorithm, and 1 Hour for round algorithm.
depending on the rounding algorithm field of the dimension.
|
overageAllowed | string Enum: "true" "false" Used with Subscription Tier Offering type. |
consumptionPrice | string The unit price of dimension.
Numerical values are represented as strings to avoid precision loss.
|
sampleType | string Enum: "gauge" "continious" The sample type used for the data. Gauge is a value that can go up or down. |
paymentSchedule | string Enum: "upfront" "arrear" The payment schedule for the dimension. Determines when billing should occur for a dimension. |
metadata | object An optional key-value map of additional metadata to associate with the dimensions.
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record. Additionally, if |
Array of objects (DimensionTiersGroupByMetadataDto) Used to group tiers by metadata, meaning instead of grouping by the dimensionId for usage Paigo will group requests with the metadata passed in on the usage request. Exclusive with standard |
{- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "measurementId": "5f7d1e3a-3b2d-4b0a-8b9a-5b9b5c9b5c9b",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "dimensionId": "fcb1fa34-8f11-4832-80f2-464cbc7a8546"
}
Delete a dimension
dimensionId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "dimensions": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "metadata": { }
}
]
}
Create an offering
offeringVisibility | string Default: "public" Enum: "private" "public" The visibility of the offering, specifically if its private or public.
Public offerings are designed to be shared among customers.
Private offerings are typically used for enterprise deals which contain discounts or prepaid credits.
|
offeringType | string Default: "usage-based" Enum: "usage-based" "subscription" The type of offering.
Example |
billingCycle | string Default: "monthly" Enum: "monthly" "annualToDate" "topUp" The time frame when an automatic bill should be sent leave empty for no automated billing
Example |
currency | string Enum: "USD" "EUR" "CNY" The supported currency for the offering. USD is currently supported. Customers can override the currency for their account.
However all offerings are denoted in USD.
|
Array of objects (DimensionOverridesDto) Overrides for the offering. Applies specific overrides to the dimensions associated with the offering. These effect the price of each dimension on the offering. | |
prepaidCredit | string Prepaid credit amount to be deducted as part of the bill payments. Only numerical string is allowed.
|
minimumCharge | string or null A minimum charge to be billed to the customer in the event that the customer's bill is less than the minimum charge. Only on usage based offerings. Only numerical strings are allowed, must be greater than zero.
|
topUpAmount | string The amount to top up the account by. Only positive number string is allowed. Required if |
topUpThreshold | string The threshold at which the account should be topped up. Only positive number string is allowed. Between 0 and 1.
If not provided the default value will be 0.2 or 20%. Meaning that when the account balance reaches 20% of the the top up amount, the account will be
topped up, and the end customer charged.
|
subscriptionPrice | number The price of the subscription.
Only positive number string is allowed.
Only required if Example: |
freeTrialLength | string The length of time for a free trial. This is a number of days.
Only positive number string is allowed.
Example: |
offeringName required | string A friendly, human-readable name for the offering.
|
dimensionIds | Array of strings Array of the identifier of the dimensions that this offering contains. Dimensions specify the type of usage that is being billed for.
|
metadata | object An optional key-value map of additional metadata to associate with the offerings.
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record. Additionally, if |
{- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "dimensionIds": [
- "092f9444-851a-43fb-9503-2228dc01b1b",
- "4fcafdec-eeb9-4a7f-9caf-61387102b6fa"
], - "metadata": { }
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "offeringId": "fcb1fa34-8f11-4832-80f2-464cbc7a8546"
}
Find an offering
offeringId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "dimensions": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "metadata": { }
}
]
}
Update an offering
offeringId required | string The unique identifier assigned by Paigo. |
offeringVisibility | string Default: "public" Enum: "private" "public" The visibility of the offering, specifically if its private or public.
Public offerings are designed to be shared among customers.
Private offerings are typically used for enterprise deals which contain discounts or prepaid credits.
|
offeringType | string Default: "usage-based" Enum: "usage-based" "subscription" The type of offering.
Example |
billingCycle | string Default: "monthly" Enum: "monthly" "annualToDate" "topUp" The time frame when an automatic bill should be sent leave empty for no automated billing
Example |
currency | string Enum: "USD" "EUR" "CNY" The supported currency for the offering. USD is currently supported. Customers can override the currency for their account.
However all offerings are denoted in USD.
|
Array of objects (DimensionOverridesDto) Overrides for the offering. Applies specific overrides to the dimensions associated with the offering. These effect the price of each dimension on the offering. | |
prepaidCredit | string Prepaid credit amount to be deducted as part of the bill payments. Only numerical string is allowed.
|
minimumCharge | string or null A minimum charge to be billed to the customer in the event that the customer's bill is less than the minimum charge. Only on usage based offerings. Only numerical strings are allowed, must be greater than zero.
|
topUpAmount | string The amount to top up the account by. Only positive number string is allowed. Required if |
topUpThreshold | string The threshold at which the account should be topped up. Only positive number string is allowed. Between 0 and 1.
If not provided the default value will be 0.2 or 20%. Meaning that when the account balance reaches 20% of the the top up amount, the account will be
topped up, and the end customer charged.
|
subscriptionPrice | number The price of the subscription.
Only positive number string is allowed.
Only required if Example: |
freeTrialLength | string The length of time for a free trial. This is a number of days.
Only positive number string is allowed.
Example: |
offeringName | string A friendly, human-readable name for the offering.
|
dimensionIds | Array of strings Array of the identifier of the dimensions that this offering contains. Dimensions specify the type of usage that is being billed for.
|
metadata | object An optional key-value map of additional metadata to associate with the offerings.
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record. Additionally, if |
{- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "dimensionIds": [
- "092f9444-851a-43fb-9503-2228dc01b1b",
- "4fcafdec-eeb9-4a7f-9caf-61387102b6fa"
], - "metadata": { }
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "offeringId": "fcb1fa34-8f11-4832-80f2-464cbc7a8546"
}
Delete an offering
offeringId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "taxExempt": "exempt",
- "invoices": [
- {
- "invoiceStatus": "Draft",
- "invoicePaymentTerm": 30,
- "invoiceDate": "2021-01-01T00:00:00.000Z",
- "totalAmountWithoutTax": 100,
- "taxAmount": 10,
- "amountPaid": 110,
- "currency": "USD",
- "invoiceType": "TOPUP",
- "invoiceCommunicationHistory": [
- [ ]
], - "lineItems": [
- {
- "name": "Paigo Pro",
- "quantity": 1,
- "unitCost": 100,
- "description": "Paigo Pro subscription"
}
], - "refunds": [
- {
- "amountRefunded": "100.00",
- "amount": "100.00",
- "chargeId": "ch_1J5J1n2eZvKYlo2C0q2Q2Q2Q2",
- "metadata": { },
- "currency": "usd",
- "status": "succeeded",
- "created": "2021-08-02T20:00:00.000Z"
}
], - "payments": [
- {
- "type": "Credit",
- "transactionAmount": "100.00",
- "timestamp": "2021-01-01T00:00:00.000Z",
- "metadata": { }
}
]
}
], - "stripeAccountReady": true,
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "children": [
- {
- "childId": "9ffc73f3-eece-4a48-bfcd-c2c91153e97f",
- "parentId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "billParent": "aggregated"
}
], - "parent": {
- "childId": "9ffc73f3-eece-4a48-bfcd-c2c91153e97f",
- "parentId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "billParent": "aggregated"
}, - "offering": { },
- "enrollments": [
- {
- "offering": {
- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [ ]
}
]
}
], - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "dimensions": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": null,
- "externalId": null,
- "cloudPlatform": null,
- "region": null,
- "resourceType": null
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [ ]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "metadata": { }
}, - "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "overrides": {
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [ ]
}
]
}
], - "freeTrialEndDate": "2021-01-01T00:00:00Z"
}
}
], - "customerId": "string",
- "customerName": "string",
- "paymentChannel": "Stripe",
- "email": "noreply@paigo.tech",
- "paymentChannelOptions": {
- "stripeCustomerId": "string"
}, - "address": {
- "countryCode": "US",
- "postalCode": "90210",
- "city": "Beverly Hills",
- "streetLineOne": "1234 Main St",
- "streetLineTwo": "Apt 1",
- "state": "NY"
}, - "customerVatId": "GB VAT 123456789",
- "offeringId": "e345f409-daca-4144-91d2-0a0f87c96581",
- "creditBalance": "100",
- "freeTrialEndDate": "2020-12-31T23:59:59.999Z",
- "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "freeTrialStartDate": "2020-12-28T23:59:59.999Z",
- "currency": "USD",
- "metadata": { }
}
]
}
Create a customer
currency | string Enum: "USD" "EUR" "CNY" The customer's preferred currency. Only ISO 4217 currency codes are allowed. Overrides the currency on an offering. If not specified,
the currency on the offering will be used. If no currency is specified on the offering, the default currency of |
taxExempt | string Default: "none" Enum: "exempt" "none" Whether the customer is exempt from paying taxes
|
customerId | string Unique identifier for a customer. If one is not passed in Paigo will assign a unique UUID for the customer. If one is passed in and it already exists an error will be returned. Example: |
offeringId | string The unique identifier for the offering associated with a customer
|
offeringEnrollmentDate | string The date time when the user was enrolled in the offering. If not set the current date time will be used.
Must be a valid RFC3339 date time string. Must be in the past UTC time.
|
customerName required | string The friendly, human-readable name for the customer profile
|
customerVatId | string The VAT ID of the customer.
Every VAT identification number must begin with the code of the country concerned and
followed by a block of digits or characters.
|
email required | string Customer email address
|
paymentChannel required | string Enum: "Stripe" "manual" The payment channel associated with a customer
|
object Configuration options for the payment channel.
For Stripe payment, | |
object The address of the customer | |
metadata | object An optional key-value map of additional metadata to associate with the customer.
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record. Additionally, if |
Array of objects (UsageForCustomerEnrollment) Optionally, usage can be initally applied for a customer when they are enrolling in an offering.
This is used for dimensions which have a paymentSchedule of |
{- "currency": "USD",
- "taxExempt": "none",
- "customerId": "e345f409-daca-4144-91d2-0a0f87c96581",
- "offeringId": "eea7347bd-a2d8-4390-ae09-68f9b8e4ed6c",
- "offeringEnrollmentDate": "2020-01-01T00:00:00Z",
- "customerName": "John Doe",
- "customerVatId": "GB VAT 123456789",
- "email": "noreply@paigo.tech",
- "paymentChannel": "Stripe",
- "paymentChannelOptions": {
- "stripeCustomerId": "string"
}, - "address": {
- "countryCode": "US",
- "postalCode": "90210",
- "city": "Beverly Hills",
- "streetLineOne": "1234 Main St",
- "streetLineTwo": "Apt 1",
- "state": "NY"
}, - "metadata": { },
- "usage": "[{ \"dimensionId\": \"539b7f74-3832-474e-a955-6d69c5df12d0\", \"customerId\":\"f918b6f4-2ad6-48c4-8b62-ac23adada9ae\", \"recordValue\": 3, timestamp: \"2021-01-01T00:00:00Z\" }]"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "customerId": "e345f409-daca-4144-91d2-0a0f87c96581",
}
Assign a child to a customer
billParent | string Default: "separate" Enum: "aggregated" "separate" This determines if the parent should be billed for invoices of the child. Defaults to |
{- "billParent": "aggregated"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
Update child relationship
billParent | string Default: "separate" Enum: "aggregated" "separate" This determines if the parent should be billed for invoices of the child. Defaults to |
{- "billParent": "aggregated"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
Find one customer
customerId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "taxExempt": "exempt",
- "invoices": [
- {
- "invoiceStatus": "Draft",
- "invoicePaymentTerm": 30,
- "invoiceDate": "2021-01-01T00:00:00.000Z",
- "totalAmountWithoutTax": 100,
- "taxAmount": 10,
- "amountPaid": 110,
- "currency": "USD",
- "invoiceType": "TOPUP",
- "invoiceCommunicationHistory": [
- [ ]
], - "lineItems": [
- {
- "name": "Paigo Pro",
- "quantity": 1,
- "unitCost": 100,
- "description": "Paigo Pro subscription"
}
], - "refunds": [
- {
- "amountRefunded": "100.00",
- "amount": "100.00",
- "chargeId": "ch_1J5J1n2eZvKYlo2C0q2Q2Q2Q2",
- "metadata": { },
- "currency": "usd",
- "status": "succeeded",
- "created": "2021-08-02T20:00:00.000Z"
}
], - "payments": [
- {
- "type": "Credit",
- "transactionAmount": "100.00",
- "timestamp": "2021-01-01T00:00:00.000Z",
- "metadata": { }
}
]
}
], - "stripeAccountReady": true,
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "children": [
- {
- "childId": "9ffc73f3-eece-4a48-bfcd-c2c91153e97f",
- "parentId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "billParent": "aggregated"
}
], - "parent": {
- "childId": "9ffc73f3-eece-4a48-bfcd-c2c91153e97f",
- "parentId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "billParent": "aggregated"
}, - "offering": { },
- "enrollments": [
- {
- "offering": {
- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [ ]
}
]
}
], - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "dimensions": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": null,
- "externalId": null,
- "cloudPlatform": null,
- "region": null,
- "resourceType": null
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [ ]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "metadata": { }
}, - "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "overrides": {
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [ ]
}
]
}
], - "freeTrialEndDate": "2021-01-01T00:00:00Z"
}
}
], - "customerId": "string",
- "customerName": "string",
- "paymentChannel": "Stripe",
- "email": "noreply@paigo.tech",
- "paymentChannelOptions": {
- "stripeCustomerId": "string"
}, - "address": {
- "countryCode": "US",
- "postalCode": "90210",
- "city": "Beverly Hills",
- "streetLineOne": "1234 Main St",
- "streetLineTwo": "Apt 1",
- "state": "NY"
}, - "customerVatId": "GB VAT 123456789",
- "offeringId": "e345f409-daca-4144-91d2-0a0f87c96581",
- "creditBalance": "100",
- "freeTrialEndDate": "2020-12-31T23:59:59.999Z",
- "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "freeTrialStartDate": "2020-12-28T23:59:59.999Z",
- "currency": "USD",
- "metadata": { }
}
]
}
Update a customer
customerId required | string The unique identifier assigned by Paigo. |
currency | string Enum: "USD" "EUR" "CNY" The customer's preferred currency. Only ISO 4217 currency codes are allowed. Overrides the currency on an offering. If not specified,
the currency on the offering will be used. If no currency is specified on the offering, the default currency of |
taxExempt | string Default: "none" Enum: "exempt" "none" Whether the customer is exempt from paying taxes
|
freeTrialEndDate | string Free Trial End Date is the date time when a free trial is over for the customer. Must be in the future and a valid RFC 3999 date time.
|
removePriorOffering | boolean An optional flag to remove the prior offering from the customer. If set to |
unenrollOffering | string Used to specifically unenroll a customer from a singular offering. This may generate an invoice, in cases where relevant. Such as if the
|
offeringId | string The unique identifier for the offering associated with a customer
|
customerName | string The friendly, human-readable name for the customer profile
|
customerVatId | string The VAT ID of the customer.
Every VAT identification number must begin with the code of the country concerned and
followed by a block of digits or characters.
|
string Customer email address
| |
paymentChannel | string Enum: "Stripe" "manual" The payment channel associated with a customer
|
object Configuration options for the payment channel.
For Stripe payment, | |
object The address of the customer | |
metadata | object An optional key-value map of additional metadata to associate with the customer.
such as environment, purpose, owner, developer, contract number,
or any arbitrary data to be associated with this usage record. Additionally, if |
Array of objects (UsageForCustomerEnrollment) Optionally, usage can be initally applied for a customer when they are enrolling in an offering.
This is used for dimensions which have a paymentSchedule of |
{- "currency": "USD",
- "taxExempt": "none",
- "freeTrialEndDate": "2199-02-01T11:00:00Z",
- "removePriorOffering": true,
- "unenrollOffering": "177735fe-5d06-49a7-a8fb-f5da11773345",
- "offeringId": "eea7347bd-a2d8-4390-ae09-68f9b8e4ed6c",
- "customerName": "John Doe",
- "customerVatId": "GB VAT 123456789",
- "email": "noreply@paigo.tech",
- "paymentChannel": "Stripe",
- "paymentChannelOptions": {
- "stripeCustomerId": "string"
}, - "address": {
- "countryCode": "US",
- "postalCode": "90210",
- "city": "Beverly Hills",
- "streetLineOne": "1234 Main St",
- "streetLineTwo": "Apt 1",
- "state": "NY"
}, - "metadata": { },
- "usage": "[{ \"dimensionId\": \"539b7f74-3832-474e-a955-6d69c5df12d0\", \"customerId\":\"f918b6f4-2ad6-48c4-8b62-ac23adada9ae\", \"recordValue\": 3, timestamp: \"2021-01-01T00:00:00Z\" }]"
}
{- "currency": "USD",
- "taxExempt": "none",
- "customerId": "e345f409-daca-4144-91d2-0a0f87c96581",
- "offeringId": "eea7347bd-a2d8-4390-ae09-68f9b8e4ed6c",
- "offeringEnrollmentDate": "2020-01-01T00:00:00Z",
- "customerName": "John Doe",
- "customerVatId": "GB VAT 123456789",
- "email": "noreply@paigo.tech",
- "paymentChannel": "Stripe",
- "paymentChannelOptions": {
- "stripeCustomerId": "string"
}, - "address": {
- "countryCode": "US",
- "postalCode": "90210",
- "city": "Beverly Hills",
- "streetLineOne": "1234 Main St",
- "streetLineTwo": "Apt 1",
- "state": "NY"
}, - "metadata": { },
- "usage": "[{ \"dimensionId\": \"539b7f74-3832-474e-a955-6d69c5df12d0\", \"customerId\":\"f918b6f4-2ad6-48c4-8b62-ac23adada9ae\", \"recordValue\": 3, timestamp: \"2021-01-01T00:00:00Z\" }]"
}
Delete a customer
customerId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "customerId": "e345f409-daca-4144-91d2-0a0f87c96581"
}
Create Customer Refund
NOTE: This endpoint currently only supports Stripe for a refund channel. Customers with manual payments will cause an 400 error response.
reason | string Default: "requested_by_customer" Enum: "duplicate" "fraudulent" "requested_by_customer" A stripe platform specific reason enum. Not required, will be defaulted to |
amount | string The refund amount to be delivered to the customer. Currency is determined by the currency Only numerical string is allowed.
If no amount is specified the full amount of the payment will be refunded.
|
required | object Configuration options for the refund channel.
See example below.
|
metadata | object An optional key-value map of additional metadata to associate with this refund.
This metadata will be passed to the final refund channel to correlate information between invoices,
customers and other platform specific keys.
|
{- "reason": "duplicate",
- "amount": "10.00",
- "refundChannelOptions": {
- "paymentIntentId": "pi_1Gszkg2eZvKYlo2C6ZLlAL7u"
}, - "metadata": { }
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
Get customer refunds
NOTE: This endpoint currently only supports Stripe for a refund channel. Customers with manual payments will cause an 400 error response.
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "amountRefunded": "100.00",
- "amount": "100.00",
- "chargeId": "ch_1J5J1n2eZvKYlo2C0q2Q2Q2Q2",
- "metadata": { },
- "currency": "usd",
- "status": "succeeded",
- "created": "2021-08-02T20:00:00.000Z"
}
]
}
Get a Customer Enrollment
customerId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "offering": {
- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
]
}
]
}
], - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "dimensions": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "metadata": { }
}, - "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "overrides": {
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": null,
- "upperBound": null,
- "unitPrice": null,
- "tierPosition": null
}
]
}
]
}
], - "freeTrialEndDate": "2021-01-01T00:00:00Z"
}
}
]
}
Update Customer Enrollment
customerId required | string The unique identifier assigned by Paigo. |
object Overrides for the offering. Applies Customer specific overrides to the offering. Such as a discount or free trial or dimension specific overrides. | |
offeringId | string Unique identifier for an offering assigned by Paigo. Including a new |
removePriorOffering | boolean An optional flag to remove the prior offering from the customer. If set to |
unenrollOffering | string Used to specifically unenroll a customer from a singular offering. This may generate an invoice, in cases where relevant. Such as if the
|
Array of objects (UsageForCustomerEnrollment) Optionally, usage can be initally applied for a customer when they are enrolling in an offering.
This is used for dimensions which have a paymentSchedule of |
{- "overrides": {
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
]
}
]
}
], - "freeTrialEndDate": "2021-01-01T00:00:00Z"
}, - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "removePriorOffering": true,
- "unenrollOffering": "177735fe-5d06-49a7-a8fb-f5da11773345",
- "usage": "[{ \"dimensionId\": \"539b7f74-3832-474e-a955-6d69c5df12d0\", \"recordValue\": 3, timestamp: \"2021-01-01T00:00:00Z\" }]"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
Get customer payments
NOTE: This endpoint currently only supports Stripe for a payment channel. Customers with manual payments will cause an 400 error response.
invoiceId | string Example: invoiceId=476b84a0-bba7-4e05-9040-59cffdff493a The Paigo invoiceId associated with the stripe payment. Can be undefined.
This operation instructs paigo to search for payments with the given invoiceId in the metadata of the payment intent.
|
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "amountRefunded": "100.00",
- "amount": "100.00",
- "chargeId": "ch_1J5J1n2eZvKYlo2C0q2Q2Q2Q2",
- "metadata": { },
- "currency": "usd",
- "status": "succeeded",
- "created": "2021-08-02T20:00:00.000Z"
}
]
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
}
Update a free trial of a customer
customerId required | string The unique identifier assigned by Paigo. |
offeringId | string |
freeTrialEndDate required | string The end date of the free trial. Must be in the future and must be an RFC3339 date string.
|
freeTrialStartDate | string The start date of the free trial. Must be in the future and must be an RFC3339 date string. Optional to set, determines the free trial start date for a customer.
This is used during billing calculations to determine the proration amount for their free trial invoice.
|
{- "offeringId": "string",
- "freeTrialEndDate": "2021-01-01T00:00:00Z",
- "freeTrialStartDate": "2017-01-01T00:00:00Z"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "customerId": "e345f409-daca-4144-91d2-0a0f87c96581"
}
Get usage data for a customer
customerId required | string The unique identifier assigned by Paigo. |
aggregationInterval | string Enum: "none" "hour" "day" "month" The aggregation interval to use for the query.
|
ignoreEnrollmentDate | string If the current offering enrollment date should be ignored for the response data. Enables looking at usage prior to the enrollment date.
|
aggregationPurpose | string Enum: "billing" "metering" The aggregation purpose to use for the query. Enum: |
endTime | string The end time of the time range to query.
The time range is inclusive of the start time and exclusive of the end time.
The end time must be after the start time.
The end time must be before the current time.
The end time must be in RFC3339 format.
|
startTime | string The end time of the time range to query.
The time range is inclusive of the start time and exclusive of the end time.
The end time must be after the start time.
The end time must be before the current time.
The end time must be in RFC3339 format.
|
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": {
- "dimensionId": "da9611bd-e0f3-4c0d-a754-fda5be730872",
- "usage": [
- {
- "value": "0.67",
- "startTime": "2021-01-01T00:00:00.000Z",
- "endTime": "2021-01-01T01:00:00.000Z"
}
]
}
}
Get a token to allow SaaS customers to view their billing data in paigo securely
customerId required | string The unique identifier assigned by Paigo. |
{- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Commit a transaction to the ledger for a customer. This will update thier credit balances
customerId required | string |
transactionAmount required | string [ -1000000000 .. 1000000000 ] The amount to credit the customer. Can be positive or negative. Customers cannot have a negative balance set via the API.
|
timestamp | string The timestamp of the credit. Optional. Will be set to right now UTC if not provided.
|
metadata | object The metadata to attach to the credit. Optional
|
{- "transactionAmount": "100.00",
- "timestamp": "2021-01-01T00:00:00.000Z",
- "metadata": { }
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior"
}
Get the ledger of wallet transactions applied to a customer
customerId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "transactionAmount": 100,
- "timestamp": "2021-01-01T00:00:00.000Z",
- "metadata": { }
}
]
}
Find an Invoice
Download links for invoices are valid for 7 days.
invoiceId required | string Example: 7c71590b-3368-4d53-b9cb-5203605b4946 The invoice ID assigned by Paigo |
download | string Example: download=true Get a download link for the invoice in the response |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "invoiceStatus": "Draft",
- "invoicePaymentTerm": 30,
- "invoiceDate": "2021-01-01T00:00:00.000Z",
- "customerId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "totalAmountWithoutTax": 100,
- "taxAmount": 10,
- "amountPaid": 110,
- "currency": "USD",
- "invoiceType": "TOPUP",
- "invoiceCommunicationHistory": [
- [ ]
], - "lineItems": [
- {
- "name": "Paigo Pro",
- "quantity": 1,
- "unitCost": 100,
- "description": "Paigo Pro subscription"
}
], - "refunds": [
- {
- "amountRefunded": "100.00",
- "amount": "100.00",
- "chargeId": "ch_1J5J1n2eZvKYlo2C0q2Q2Q2Q2",
- "metadata": { },
- "currency": "usd",
- "status": "succeeded",
- "created": "2021-08-02T20:00:00.000Z"
}
], - "payments": [
- {
- "type": "Credit",
- "transactionAmount": "100.00",
- "timestamp": "2021-01-01T00:00:00.000Z",
- "metadata": { }
}
]
}
]
}
customerId required | string The client ID assocaited with the Business Entity, this is the name for the business which will be used in the invoce
|
items required | Array of objects The Itemized collection of elements to be billed. These could be instance compute hours, or number of users
|
invoiceDate | string The date the invoice is to be generated for
|
currency | string Enum: "USD" "EUR" "CNY" The currency the invoice is to be generated in. If no Currency is passed in the currency used by the customer will be used.
|
invoicePaymentTerm | string Enum: "30" "60" "" The Payment Term for the invoice. This is the number of days until the invoice is considered past due. Default is "none". String |
storePaymentAsCredit | boolean If storePaymentAsCredit is |
{- "customerId": "Khols",
- "items": [
- {
- "name": "Paigo Pro",
- "quantity": 1,
- "unitCost": 100.09
}
], - "invoiceDate": "2020-09-18T17:34:02.666Z",
- "currency": "EUR",
- "invoicePaymentTerm": "30",
- "storePaymentAsCredit": true
}
{ }
Manage measurements in Paigo.
See Measure and Collect Usage Data at Production Scale for more information.
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}
]
}
Create a measurement
measurementMode required | string Enum: "infrastructureBased" "agentBased" "datastoreBased" The measurement method. See Measure and Collect Usage Data at Production Scale for more information. |
required | InfrastructureAccessInformation (object) or AgentAccessInformation (object) or DatastoreAccessInformation (object) Configuration for the measurement method. |
measurementName | string The human readable name of the measurement
|
{- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "externalId": "1234567890abc",
- "measurementId": "a65ae317-e940-44cc-b570-cc74d1897c36",
- "iamRoleArn": "arn:aws:iam::123456789012:role/paigo-datastore-role",
- "ingestion": "s3://paigo-datastore-dump-bucket/",
- "dlq": "s3://paigo-datastore-dlq-bucket/"
}
Find a measurement
measurementId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}
]
}
Update a measurement
measurementId required | string The unique identifier assigned by Paigo. |
measurementMode required | string Enum: "infrastructureBased" "agentBased" "datastoreBased" |
UpdateInfrastructureAccessInformation (object) or UpdateAgentAccessInformation (object) or UpdateDatastoreAccessInformation (object) Configuration for the measurement method. | |
measurementName required | string A friendly, human-readable name of the measurement. |
{- "measurementMode": "infrastructure",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "string"
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "externalId": "1234567890abc",
- "measurementId": "a65ae317-e940-44cc-b570-cc74d1897c36",
- "iamRoleArn": "arn:aws:iam::123456789012:role/paigo-datastore-role",
- "ingestion": "s3://paigo-datastore-dump-bucket/",
- "dlq": "s3://paigo-datastore-dlq-bucket/"
}
Delete a measurement
measurementId required | string The unique identifier assigned by Paigo. |
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "measurementId": "193b6967-1783-434f-85cb-a6fc4e1e385b"
}
[- {
- "taxExempt": "exempt",
- "invoices": [
- {
- "invoiceStatus": "Draft",
- "invoicePaymentTerm": 30,
- "invoiceDate": "2021-01-01T00:00:00.000Z",
- "totalAmountWithoutTax": 100,
- "taxAmount": 10,
- "amountPaid": 110,
- "currency": "USD",
- "invoiceType": "TOPUP",
- "invoiceCommunicationHistory": [
- [ ]
], - "lineItems": [
- {
- "name": "Paigo Pro",
- "quantity": 1,
- "unitCost": 100,
- "description": "Paigo Pro subscription"
}
], - "refunds": [
- {
- "amountRefunded": "100.00",
- "amount": "100.00",
- "chargeId": "ch_1J5J1n2eZvKYlo2C0q2Q2Q2Q2",
- "metadata": { },
- "currency": "usd",
- "status": "succeeded",
- "created": "2021-08-02T20:00:00.000Z"
}
], - "payments": [
- {
- "type": "Credit",
- "transactionAmount": "100.00",
- "timestamp": "2021-01-01T00:00:00.000Z",
- "metadata": { }
}
]
}
], - "stripeAccountReady": true,
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "children": [
- {
- "childId": "9ffc73f3-eece-4a48-bfcd-c2c91153e97f",
- "parentId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "billParent": "aggregated"
}
], - "parent": {
- "childId": "9ffc73f3-eece-4a48-bfcd-c2c91153e97f",
- "parentId": "e962aefe-6134-4f28-8967-a11cfe7f0bf2",
- "billParent": "aggregated"
}, - "offering": { },
- "enrollments": [
- {
- "offering": {
- "offeringVisibility": "private",
- "offeringType": "subscription",
- "billingCycle": "monthly",
- "currency": "USD",
- "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- null
]
}
]
}
], - "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0",
- "dimensions": [
- {
- "dimensionName": "API Call",
- "consumptionUnit": {
- "unit": "count-based",
- "type": "count"
}, - "usageIncrement": "24",
- "usageEntitlement": "inf",
- "aggregationInterval": "hour",
- "aggregationMethod": "sum",
- "dimensionId": "8a7b5f91-3b85-4cf4-8585-dcdf17f49004",
- "measurement": {
- "measurementMode": "infrastructureBased",
- "measurementConfiguration": {
- "iamRoleArn": "arn:aws:iam::214826386939:role/paigo-scraper",
- "externalId": "123456789",
- "cloudPlatform": "aws",
- "region": "us-east-1",
- "resourceType": "ebs"
}, - "measurementName": "EBS Usage",
- "measurementId": "de388932-a7e1-11ed-afa1-0242ac120002"
}, - "rounding": "round",
- "overageAllowed": "true",
- "consumptionPrice": "20.00",
- "sampleType": "gauge",
- "paymentSchedule": "upfront",
- "metadata": { },
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- null
]
}
]
}
], - "prepaidCredit": "20.00",
- "minimumCharge": "32.00",
- "topUpAmount": "20.00",
- "topUpThreshold": "0.2",
- "subscriptionPrice": 20,
- "freeTrialLength": "1",
- "offeringName": "Entperise Plan",
- "metadata": { }
}, - "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "overrides": {
- "discount": {
- "name": "Super Cool Discount",
- "percentage": "10",
- "endDate": "2030-01-01T00:00:00Z"
}, - "dimensionOverrides": [
- {
- "dimensionId": "6a8fb855-206c-4226-8695-daf67352e7ee",
- "consumptionPrice": "10.00",
- "tiers": [
- {
- "tierName": "Tier 1",
- "upperBound": "100",
- "unitPrice": "10",
- "tierPosition": "1"
}
], - "tiersGroupByMetadata": [
- {
- "metadataGroups": { },
- "tiers": [
- null
]
}
]
}
], - "freeTrialEndDate": "2021-01-01T00:00:00Z"
}
}
], - "customerId": "string",
- "customerName": "string",
- "paymentChannel": "Stripe",
- "email": "noreply@paigo.tech",
- "paymentChannelOptions": {
- "stripeCustomerId": "string"
}, - "address": {
- "countryCode": "US",
- "postalCode": "90210",
- "city": "Beverly Hills",
- "streetLineOne": "1234 Main St",
- "streetLineTwo": "Apt 1",
- "state": "NY"
}, - "customerVatId": "GB VAT 123456789",
- "offeringId": "e345f409-daca-4144-91d2-0a0f87c96581",
- "creditBalance": "100",
- "freeTrialEndDate": "2020-12-31T23:59:59.999Z",
- "offeringEnrollmentDate": "2020-12-30T23:59:59.999Z",
- "freeTrialStartDate": "2020-12-28T23:59:59.999Z",
- "currency": "USD",
- "metadata": { }
}
]
[- {
- "timestamp": "string",
- "dimensionId": "string",
- "entitlementLimit": "string",
- "currentUsageTotal": "string",
- "eventType": "string",
- "customerId": "string",
- "customerName": "string",
- "email": "string",
- "webhookType": 0
}
]
[- {
- "id": "fcb1fa34-8f11-4832-80f2-464cbc7a8546",
- "webhookType": "INVOICE_CREATED",
- "securityKey": "1234567890"
}
]
{- "id": "fcb1fa34-8f11-4832-80f2-464cbc7a8546",
- "webhookType": "INVOICE_CREATED",
- "securityKey": "1234567890"
}
hookUrl required | string The URL Paigo will callback to when the webhook type event occurs.
|
securityKey | string The security key used to authenticate the webhook. This is used to ensure the webhook is coming from Paigo. The key will be sent in the |
environment | string The environment the webhook is for. This is used to differentiate between sandbox and production. Optional, will default to |
webhookType required | string Enum: "INVOICE_CREATED" "INVOICE_PAID" "STRIPE_PAYMENT_FAILED" "CUSTOMER_CREATED" "CUSTOMER_UPDATED" "ENTITLEMENT" "INVOICE_SENT" The type of webhook event to listen for. This will determine when the webhook is triggered.
|
offeringId | string The offering the webhook is for. This is used to differentiate between different offerings. Only used for |
{- "securityKey": "1234567890",
- "environment": "sandbox",
- "webhookType": "INVOICE_CREATED",
- "offeringId": "539b7f74-3832-474e-a955-6d69c5df12d0"
}
{- "message": "string",
- "id": "string",
- "webhookId": "string",
- "environment": "string"
}
Update Business Info and Logo.
sendInvoiceEmail | string Enum: "true" "false" Whether Paigo should send invoices to customers.
|
businessName | string The Name for the Business Entity using Paigo
|
addressLine1 | string Street number and name (address line 1)
|
addressLine2 | string Apartment or unit and its number (address line 2)
|
city | string City of Business Entity's Location
|
state | string State of Business Entity's Location
|
country | string Country of Business Entity's Location
|
postalCode | string Postal code of Business Entity's Location
|
supportEmail | string Email address utilized by the Business Entity for customer support
|
redirectionUrl | string The URL to redirect to after relevant requests, such as completion of a connection.
|
{- "sendInvoiceEmail": true,
- "businessName": "My Smart Business Name",
- "addressLine1": "123 Success Street",
- "addressLine2": "Suite 100",
- "city": "San Francisco",
- "state": "CA",
- "country": "USA",
- "postalCode": "94188",
- "supportEmail": "support@mybusiness.com",
}
{- "message": "This is a sample API message. The exact message may vary based on the API behavior",
- "data": [
- {
- "accountState": "sandbox",
- "invoiceApproval": "automatic",
- "invoiceGeneration": "perTransaction",
- "sendInvoiceEmail": true,
- "freeDimensionOnInvoice": "hide",
- "businessName": "string",
- "defaultCurrency": "USD",
- "taxRate": "string",
- "addressLine1": "string",
- "addressLine2": "string",
- "city": "string",
- "state": "string",
- "country": "string",
- "postalCode": "string",
- "supportEmail": "string",
- "vatId": "string",
- "redirectionUrl": "string",
- "invoiceEmailConfiguration": {
- "reminders": {
- "enabled": true,
- "beforeDueReminders": {
- "first": "string",
- "second": "string",
- "third": "string"
}, - "afterDueReminders": {
- "first": "string",
- "second": "string",
- "third": "string"
}
}
}, - "invoicePaymentTerm": "30",
- "customFields": "string",
- "taxJarApiKey": "string",
- "logoUrl": "string",
- "taxCategory": "string",
- "stripeAccountId": "string",
- "generatePDFPaymentLink": true,
- "taxCalculationType": "paigoCalculated",
- "cloudIAM": {
- "iamRoleArn": "string",
- "externalId": "string"
}, - "pages": {
- "invoice": {
- "enabled": true,
- "text": "string"
}, - "payment": {
- "enabled": true,
- "text": "string"
}, - "offering": {
- "offerings": [
- {
- "title": "string",
- "subtitle": "string",
- "price": "string",
- "featured": {
- "text": "string"
}, - "cta": {
- "text": "string",
- "offeringId": "string",
- "externalLink": "string"
}, - "description": "string",
- "features": [
- "string"
]
}
], - "appearance": {
- "border": "string",
- "background": "string",
- "accent": "string",
- "radius": "string",
- "paigoBranding": "string",
- "pricingTable": {
- "ctaBorder": "string",
- "ctaBackground": "string",
- "ctaText": "string",
- "featureListColor": "string",
- "pricePlanBackground": "string",
- "highlightedPrice": "string",
- "featureListIcon": "string",
- "showLogo": true
}
}, - "enabled": true,
- "text": "string"
}, - "extended": { }
}, - "computeCostSource": "ec2",
- "storageCostSource": "ebs",
- "archiveCostSource": "ebs"
}
]
}
{- "businessName": "My Smart Business Name",
- "addressLine1": "123 Success Street",
- "addressLine2": "Suite 100",
- "city": "San Francisco",
- "state": "CA",
- "country": "USA",
- "postalCode": "94188",
- "supportEmail": "support@mybusiness.com",
- "sendInvoiceEmail": true,
- "stripeAccountId": "acct_1J2k3l4m5n6o7p8q9r0s",
- "redirectionUrl": "string"
}