> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cadanapay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate Gross or Net Salary

> Estimate gross or net salary for a given country and type



## OpenAPI

````yaml /openapi/global-tax.yaml post /v1/tax/estimate
openapi: 3.0.0
info:
  title: Global Tax Engine
  version: 1.0.0
  description: API module for calculating taxes globally
  termsOfService: https://cadanapay.com/terms-and-conditions
  contact:
    email: api@cadanapay.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.cadanapay.com
    description: Prod Server
  - url: https://dev-api.cadanapay.com
    description: Dev Server
security:
  - Authorization: []
tags:
  - name: Tax Calculator
    description: APIs for tax calculations
paths:
  /v1/tax/estimate:
    post:
      tags:
        - Tax Calculator
      summary: Estimate Gross or Net Salary
      description: Estimate gross or net salary for a given country and type
      operationId: estimateTaxes
      parameters:
        - $ref: '#/components/parameters/XMultiTenantKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateTaxesRequest'
            examples:
              grossToNet:
                summary: Gross to Net estimation
                value:
                  countryCode: PH
                  type: gross-to-net
                  salary:
                    amount: 5000000
                    currency: PHP
              netToGross:
                summary: Net to Gross estimation
                value:
                  countryCode: MX
                  type: net-to-gross
                  net:
                    amount: 2000000
                    currency: MXN
      responses:
        '200':
          $ref: '#/components/responses/EstimateTaxesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
      security:
        - Authorization: []
components:
  parameters:
    XMultiTenantKey:
      name: X-MultiTenantKey
      in: header
      required: false
      schema:
        type: string
      description: >-
        Required when using a Platform API token. The tenant key identifying
        which business to operate on.
  schemas:
    EstimateTaxesRequest:
      oneOf:
        - required:
            - countryCode
            - type
            - salary
          type: object
          properties:
            countryCode:
              type: string
              description: Country code for tax estimation
            regionCode:
              type: string
              description: Optional region/state code
            type:
              type: string
              enum:
                - gross-to-net
                - net-to-gross
              description: Type of estimation
            salary:
              $ref: '#/components/schemas/Amount'
            outputCurrency:
              type: string
              description: >-
                ISO 4217 currency to convert response amounts into. When
                different from the salary currency, all amounts are converted at
                the prevailing FX rate and `fxRate` is populated on the
                response.
              example: USD
        - required:
            - countryCode
            - type
            - net
          type: object
          properties:
            countryCode:
              type: string
              description: Country code for tax estimation
            regionCode:
              type: string
              description: Optional region/state code
            type:
              type: string
              enum:
                - gross-to-net
                - net-to-gross
              description: Type of estimation
            net:
              $ref: '#/components/schemas/Amount'
            outputCurrency:
              type: string
              description: >-
                ISO 4217 currency to convert response amounts into. When
                different from the net currency, all amounts are converted at
                the prevailing FX rate and `fxRate` is populated on the
                response.
              example: USD
    Amount:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          description: value in lowest denomination
          example: 10000
        currency:
          type: string
          description: currency
          example: BRL
    EstimateTaxesResponse:
      type: object
      required:
        - grossAmount
        - netAmount
        - deductions
        - employerContributions
      properties:
        grossAmount:
          $ref: '#/components/schemas/Amount'
        netAmount:
          $ref: '#/components/schemas/Amount'
        allowances:
          type: array
          description: >-
            Imputed-income line items (e.g. benefits-in-kind) surfaced by the
            country engine. Omitted when none apply.
          items:
            $ref: '#/components/schemas/Allowance'
        deductions:
          type: array
          items:
            $ref: '#/components/schemas/Deduction'
        employerContributions:
          type: array
          items:
            $ref: '#/components/schemas/Deduction'
        outputCurrency:
          type: string
          description: >-
            Echo of the requested `outputCurrency`. Present only when the
            request specified a conversion.
          example: USD
        fxRate:
          type: string
          description: >-
            FX rate applied to convert from the input currency to
            `outputCurrency`. Present only when a conversion was performed.
          example: '0.058'
    BadRequestError:
      description: Bad input provided by client
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            params:
              description: A map for meta data around the error that occurred
              type: object
      example:
        code: invalid_request_body
        message: The request body provided is not valid
        params:
          field: Value is invalid.
    Allowance:
      type: object
      required:
        - name
        - isTaxable
        - amount
      properties:
        name:
          type: string
        isTaxable:
          type: boolean
          description: Whether the allowance is part of taxable income.
        amount:
          $ref: '#/components/schemas/Amount'
    Deduction:
      type: object
      required:
        - name
        - isStatutory
        - amount
      properties:
        name:
          type: string
        isStatutory:
          type: boolean
          description: >-
            Whether the deduction is mandated by law (statutory) versus an
            optional voluntary deduction.
        amount:
          $ref: '#/components/schemas/Amount'
    Error:
      type: object
      properties:
        code:
          description: A machine parsable error code
          type: string
          enum:
            - invalid_request_body
            - resource_not_found
            - forbidden
            - internal_error
        message:
          description: A human readable message describing the error
          type: string
  responses:
    EstimateTaxesResponse:
      description: Estimate taxes response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EstimateTaxesResponse'
          examples:
            grossToNet:
              summary: Gross to Net estimation response (Philippines)
              value:
                grossAmount:
                  amount: 5000000
                  currency: PHP
                netAmount:
                  amount: 4223167
                  currency: PHP
                deductions:
                  - name: Social Security
                    isStatutory: true
                    amount:
                      amount: 175000
                      currency: PHP
                  - name: National Health Insurance (PhilHealth)
                    isStatutory: true
                    amount:
                      amount: 125000
                      currency: PHP
                  - name: Home Development Mutual Fund (PAG-IBIG)
                    isStatutory: true
                    amount:
                      amount: 20000
                      currency: PHP
                  - name: PAYE (Income Tax)
                    isStatutory: true
                    amount:
                      amount: 456833
                      currency: PHP
                employerContributions:
                  - name: Social Security
                    isStatutory: true
                    amount:
                      amount: 350000
                      currency: PHP
                  - name: National Health Insurance (PhilHealth)
                    isStatutory: true
                    amount:
                      amount: 125000
                      currency: PHP
                  - name: Home Development Mutual Fund (PAG-IBIG)
                    isStatutory: true
                    amount:
                      amount: 20000
                      currency: PHP
                  - name: Employees' Compensation (EC)
                    isStatutory: true
                    amount:
                      amount: 3000
                      currency: PHP
            netToGross:
              summary: Net to Gross estimation response (Mexico)
              value:
                grossAmount:
                  amount: 2386014
                  currency: MXN
                netAmount:
                  amount: 2000000
                  currency: MXN
                deductions:
                  - name: Sickness and Maternity Insurance
                    isStatutory: true
                    amount:
                      amount: 21383
                      currency: MXN
                  - name: Disability and Life Insurance
                    isStatutory: true
                    amount:
                      amount: 15647
                      currency: MXN
                  - name: Severance at Advanced Age and Old Age
                    isStatutory: true
                    amount:
                      amount: 28166
                      currency: MXN
                  - name: Income Tax (ISR)
                    isStatutory: true
                    amount:
                      amount: 320818
                      currency: MXN
                employerContributions:
                  - name: Work Risk Insurance
                    isStatutory: true
                    amount:
                      amount: 13609
                      currency: MXN
    BadRequestError:
      description: Bad input provided by client
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequestError'
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      bearerFormat: API_SECRET_KEY

````