# Show billing breakdown

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/billing/breakdown:
    get:
      summary: Show billing breakdown
      deprecated: false
      description: >+
        ### Groups per grouping type


        | Grouping        |
        Group                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
        |

        |-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

        | purpose         | campaigns,
        other                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
        |

        | campaign        | id of the
        campaign                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
        |

        | channel         | sms, email, push,
        number_lookup                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        |

        | country_code    | 2 letter code of the country (ex. NO,
        PL)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
        |

        | service_message | "generic", "tbp_direct_member_messages",
        "campaigns", "triggers", "tenants", "now_trending", "campaigns_testing",
        "tenants_testing", "rewards_notifications", "keywords_service_messages",
        "ekorts", "marketplace_notifications", "program_registration_messages",
        "login_passwords", "registration_passwords", "welcome_messages",
        "optins", "optouts", "email_verification_messages",
        "reset_password_messages", "already_member_messages", "help_messages",
        "unsub_messages", "msisdn_verification_messages",
        "verification_success_messages", "app_admin_notifications",
        "sending_reminder_notifications", "sending_sent_notifications",
        "sending_error_notifications", "sending_delivery_lagging_notifications",
        "sending_delivery_failing_notifications",
        "members_import_finished_notifications",
        "members_export_finished_notifications",
        "member_export_finished_notifications", "games_support_messages",
        "games_internal_messages",
        "conversation_message_received_notifications",
        "accounting_threshold_exceeded_notifications",
        "customer_domain_became_verified_notifications",
        "customer_domain_became_unverified_notifications",
        "email_domain_became_valid_notifications",
        "email_domain_became_invalid_notifications",
        "web_domain_setup_became_valid_notifications",
        "web_domain_setup_became_invalid_notifications",
        "user_auth_invite_messages", "user_auth_reset_password_messages",
        "user_auth_login_error_notifications",
        "user_auth_otp_added_notifications",
        "user_auth_otp_removed_notifications",
        "user_auth_password_updated_notifications",
        "user_auth_email_updated_notifications",
        "user_auth_otp_code_email_mfa_messages",
        "user_auth_otp_code_sms_mfa_messages",
        "user_auth_otp_code_email_verification_messages",
        "user_auth_otp_code_msisdn_verification_messages",
        "user_auth_unfinished_registration_messages",
        "legacy_site_notifications", "tem_documents_without_confirmation",
        "tem_documents_with_confirmation", "tem_documents",
        "tem_documents_reminders", "tem_resources_reminders",
        "tem_resources_accepted_notifications",
        "tem_resources_rejected_notifications",
        "tem_resources_destroyed_notifications", "tem_alerts",
        "tem_alerts_requests_notifications", "tem_alerts_recalls",
        "tem_abm_links_notifications", "tem_issues_created_notifications",
        "tem_issues_updated_notifications", "tem_issues_accepted_notifications",
        "tem_issues_resolved_notifications",
        "rewards_points_expirations_notifications" |


        ### Possible groupings for type



        | type | possible grouping  |

        | --- | --- |

        | sms | purpose, campaign, service_message, country_code |

        | email | purpose, campaign, service_message |

        | push | purpose, campaign, service_message |

        | null | purpose, channel |

      tags:
        - API Reference/Management API/Core/Billing/Cost and usage
      parameters:
        - name: period
          in: query
          description: >+
            Length of period for breakdown. If provided requires offset param.
            If not provided will return all time yearly breakdown.

          required: false
          example: month
          schema:
            type: string
            enum:
              - month
              - year
            x-apidog:
              enumDescriptions:
                month: ''
                year: ''
        - name: offset
          in: query
          description: >-
            Offset from the current date in period unit. If provided requires
            period param.
          required: false
          example: 0
          schema:
            type: integer
            minimum: 0
        - name: type
          in: query
          description: Type of messages
          required: false
          example: sms
          schema:
            type: string
            enum:
              - sms
              - email
              - push
            x-apidog:
              enumDescriptions:
                sms: ''
                email: ''
                push: ''
        - name: grouping
          in: query
          description: Group types that the period will be divided into
          required: false
          example: purpose
          schema:
            type: string
            enum:
              - purpose
              - campaign
              - channel
              - service_message
              - country_code
            x-apidog:
              enumDescriptions:
                purpose: campaigns, other
                campaign: id of the campaign
                channel: only when param type is not present
                service_message: key of service messages types, only when param type is present
                country_code: only when param type is sms
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: array
                    items:
                      type: object
                      properties:
                        group:
                          type: string
                        count:
                          type: integer
                        cost:
                          type: string
                      required:
                        - group
                        - count
                        - cost
                      x-apidog-orders:
                        - group
                        - count
                        - cost
                  breakdown:
                    type: array
                    items:
                      type: object
                      properties:
                        period:
                          type: string
                        data:
                          type: array
                          items:
                            type: object
                            properties:
                              group:
                                type: string
                              count:
                                type: integer
                              cost:
                                type: string
                            required:
                              - group
                              - count
                              - cost
                            x-apidog-orders:
                              - group
                              - count
                              - cost
                      x-apidog-orders:
                        - period
                        - data
                required:
                  - total
                  - breakdown
                x-apidog-orders:
                  - total
                  - breakdown
              examples:
                '1':
                  summary: Success - grouping by purpose
                  value:
                    total:
                      - group: total
                        count: 2
                        cost: '10.0'
                      - group: campaigns
                        count: 1
                        cost: '5.0'
                      - group: other
                        count: 1
                        cost: '5.0'
                    breakdown:
                      - period: 01.05.2024
                        data:
                          - group: total
                            count: 2
                            cost: '10.0'
                          - group: camapigns
                            count: 1
                            cost: '5.0'
                          - group: other
                            count: 1
                            cost: '5.0'
                '3':
                  summary: Success - grouping by channel
                  value:
                    total:
                      - group: total
                        count: 3
                        cost: '15.0'
                      - group: sms
                        count: 1
                        cost: '5.0'
                        parts: 5
                      - group: email
                        count: 1
                        cost: '5.0'
                      - group: push
                        count: 1
                        cost: '5.0'
                    breakdown:
                      - period: 01.05.2024
                        data:
                          - group: total
                            count: 3
                            cost: '15.0'
                          - group: sms
                            count: 1
                            cost: '5.0'
                            parts: 5
                          - group: email
                            count: 1
                            cost: '5.0'
                          - group: push
                            count: 1
                            cost: '5.0'
          headers: {}
          x-apidog-name: Success
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: object
                    properties:
                      period:
                        type: array
                        items:
                          type: object
                          properties:
                            error:
                              type: string
                            message:
                              type: string
                            options:
                              type: object
                              properties: {}
                              x-apidog-orders: []
                          x-apidog-orders:
                            - error
                            - message
                            - options
                      offset:
                        type: array
                        items:
                          type: object
                          properties:
                            error:
                              type: string
                            message:
                              type: string
                            options:
                              type: object
                              properties: {}
                              x-apidog-orders: []
                          x-apidog-orders:
                            - error
                            - message
                            - options
                      type:
                        type: array
                        items:
                          type: object
                          properties:
                            error:
                              type: string
                            message:
                              type: string
                            options:
                              type: object
                              properties: {}
                              x-apidog-orders: []
                          x-apidog-orders:
                            - error
                            - message
                            - options
                      grouping:
                        type: array
                        items:
                          type: object
                          properties:
                            error:
                              type: string
                            message:
                              type: string
                            options:
                              type: object
                              properties: {}
                              x-apidog-orders: []
                          x-apidog-orders:
                            - error
                            - message
                            - options
                    x-apidog-orders:
                      - period
                      - offset
                      - type
                      - grouping
                required:
                  - error
                  - details
                x-apidog-orders:
                  - error
                  - details
              example:
                error: Invalid parameters
                details:
                  period:
                    - error: inclusion
                      message: is not included in the list
                      options:
                        in:
                          - month
                          - year
          headers: {}
          x-apidog-name: Parameter Error
      security: []
      x-apidog-folder: API Reference/Management API/Core/Billing/Cost and usage
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3515350-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```