Introduction
The Partner Billing Report (PBR) enables retailers to generate a billing report automatically through the API with custom date ranges and should contain data applicable for the specified retailer identified through the supply account.Endpoints
The report generation uses an asynchronous endpoint that is used to receive the report creation request (using a POST request); then, using thereportId generated, it’s possible to check the report status and download the output results using the following GET endpoint requests.
Verb | Endpoint | Description |
|---|---|---|
POST |
| Request a partner billing report creation |
GET |
| Get status of a specific report |
GET |
| Download output of a specific report |
Report Request Attributes
Attribute | Data Type | Description |
|---|---|---|
| list | Account IDs (currently supports only Supply Account IDs) Accepted values: array of strings/int64 Writeable? N / Nullable? N |
| list | RetailerIDs Accepted values: array of strings/int64 Writeable? N / Nullable? N |
| date | Start date of the report (inclusive) Accepted values: Writeable? N / Nullable? N |
| date | End date of the report (inclusive) Accepted values: Writeable? N / Nullable? N |
| enum | The format type the report should return results Accepted values: Default: Writeable? N / Nullable? N |
- Writeable (Y/N): Indicates if the field can be modified in requests.
- Nullable (Y/N): Indicates if the field can accept null/empty values.
- Primary Key: A unique, immutable identifier of the entity, generated internally by Criteo. Primary keys are typically ID fields (e.g.,
retailerId,campaignId,lineItemId) and are usually required in the URL path.
- First, create a request for Partner Billing Report with the desired attributes
- This generates a
reportIdrepresenting the report
Create a Partner Billing Report request
This endpoint receives requests to create Partner Billing Reports and returns a reportid (to be used in the next steps) in case the request was successfully created; otherwise, it will expose errors details about the request issues
Sample Request
200)
- Next, use the
reportIdto pull the report status endpoint until one is successfully computed
400)
Get status of specific report
This endpoint retrieves the status of a specific report creation. Status can bepending, success, failure, or expired
Sample Request
- Finally, download the report using the report output endpoint
- Report outputs are cached for at least 1 hour before expiration
Download output of specific report
Once the report creation is completed ("status": "success" in response above), the report output will be available to download in this endpoint.
The metrics definition of the Partner Billing Report is available in PBR Metrics
Sample Request
Responses
Response | Title | Detail | Troubleshooting |
|---|---|---|---|
🟢 | Call executed with success | ||
🟢 | Report request created with success | ||
🔴 | Validation error | Invalid date range. Maximum allowed is 31 days. | Review the |
🔴 | Model Validation error |
| Review the value of respective field provided, ensuring it was informed with a valid format |
🔴 | The scope Billing is missing | The scope Billing is required to access this endpoint and is missing from the provided token | The respective API app doesn’t have access to the domain/scope Billing. Review the Types of Permissions inAuthorization Requests |
🔴 | Authorization error | Resource access forbidden: all the accounts/retailers are not accessible. | Review the Account/Retailer ID(s) provided in the report request |