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

# Get Billing Entitlements

> Retrieve current plan, payment cycle, payment status and account status for a customer

export const IntRedir = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    setTimeout(() => {
      const currentUrl = new URL(window.location.href);
      if (currentUrl.hostname === 'docs-int.wingback.com') {
        currentUrl.hostname = 'docs.wingback.com';
        window.location.replace(currentUrl.toString());
      }
    }, 1);
    return <></>;
  }
};

<IntRedir />


## OpenAPI

````yaml GET /v1/c/entitlement/{customer_id}/billing
openapi: 3.0.3
info:
  title: wingback-api
  description: ''
  contact:
    name: ''
  license:
    name: commercial
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8080
    description: Local server
  - url: https://api.app.test.wingback.com
    description: Testing server
security: []
paths:
  /v1/c/entitlement/{customer_id}/billing:
    get:
      tags:
        - entitlement
      operationId: get_billing
      parameters:
        - name: customer_id
          in: path
          description: Id of the customer
          required: true
          schema:
            type: string
        - name: due_date_before
          in: query
          required: false
          schema:
            type: string
            format: date
            nullable: true
      responses:
        '200':
          description: Billing information for current cycle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitlementBilling'
      security:
        - api-key: []
        - wb_user_cookie: []
components:
  schemas:
    EntitlementBilling:
      type: object
      description: >-
        Data to show the billing status of the customer (last payment date,
        wallet balance, etc)
      required:
        - customer
        - contract
        - payment
      properties:
        contract:
          $ref: '#/components/schemas/ContractEntitlement'
        customer:
          $ref: '#/components/schemas/Customer'
        payment:
          $ref: '#/components/schemas/Payment'
    ContractEntitlement:
      type: object
      description: Describes Contract object for Entitlement endpoint
      required:
        - contract_id
        - status
      properties:
        contract_id:
          $ref: '#/components/schemas/Id'
        status:
          $ref: '#/components/schemas/ContractStatus'
    Customer:
      type: object
      description: Describes the status of the customer for Entitlement response
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/CustomerStatus'
    Payment:
      type: object
      description: Information about payment status displayed in the Entitlement API
      required:
        - payment_provider
        - unpaid_invoices_info
        - wallet_balance
        - wallet_balances
      properties:
        next_payment_due:
          type: string
          format: date-time
          description: Date when the nearest invoice will be due
          nullable: true
        payment_provider:
          $ref: '#/components/schemas/core.payment.Provider'
        unpaid_invoices_info:
          type: array
          items:
            $ref: '#/components/schemas/EntitlementUnpaidInvoiceInfo'
          description: List of unpaid invoices
        wallet_balance:
          type: string
          description: >-
            Status of the customer's wallet with the same currency as the
            current contract
        wallet_balances:
          type: array
          items:
            $ref: '#/components/schemas/VirtualWalletWithBalance'
          description: List of all customer wallets and their balances
    Id:
      type: string
      description: >-
        Unique identifier of an object. Consists of object class prefix and a
        UUID
      example: Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670
    ContractStatus:
      type: string
      description: >-
        Status of the contract:

        * Active - Contract is active

        * Pending - Contract is not active

        * Scheduled - Contract is scheduled to activate in the future

        * Canceled - Contract has been canceled

        * Moved - User upgraded from this contract to a different one

        * NotReady - Contract was created, but billing engine has not completed
        contract setup
      enum:
        - active
        - pending
        - scheduled
        - canceled
        - moved
        - not_ready
    CustomerStatus:
      type: string
      description: >-
        Status of the Customer

        * Active - customer is active

        * Inactive - Customer account was deactivated

        * Temporary - Customer was created, but registration process was not
        completed
      enum:
        - active
        - inactive
        - temporary
    core.payment.Provider:
      type: string
      description: |-
        The payment providers known by the backend.

        Those variants MUST be kept identical to the variants of
        the payment_provider enum of the postgres database
      enum:
        - authorize
        - self_handled
        - stripe
      example: stripe
    EntitlementUnpaidInvoiceInfo:
      type: object
      description: Information about the charges that have not been paid yet
      required:
        - currency
        - total_unpaid
        - payment_threshold
        - unpaid_invoices
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        payment_threshold:
          type: string
          description: >-
            The configured stored maximum allowed unpaid amount. This limit is
            not enforced on Wingback

            side, but may be used as indicator by the user of the Entitlement
            API
        total_unpaid:
          type: string
          description: Total sum of unpaid charges
        unpaid_invoices:
          type: array
          items:
            $ref: '#/components/schemas/EntitlementInvoice'
          description: List of unpaid invoices
    VirtualWalletWithBalance:
      type: object
      description: Customer's virtual wallet and its balance
      required:
        - id
        - wb_customer_id
        - customer_id
        - currency
        - balance
      properties:
        balance:
          type: string
          description: Wallet balance
        currency:
          $ref: '#/components/schemas/Currency'
        customer_id:
          $ref: '#/components/schemas/Id'
        id:
          $ref: '#/components/schemas/Id'
        wb_customer_id:
          $ref: '#/components/schemas/Id'
    Currency:
      type: string
      description: |-
        A supported currency

        The format for parsing and reading is the lowercased
        ISO 4217 currency code (e.g. "usd")
      enum:
        - usd
        - eur
        - gbp
        - brl
        - ars
    EntitlementInvoice:
      type: object
      description: Reduced information about the invoice specific for Entitlement endpoint
      required:
        - id
        - status
        - amount
        - due_date
      properties:
        amount:
          type: string
          description: Total amount of the invoice
        due_date:
          type: string
          format: date-time
          description: Due date of the invoice
        id:
          $ref: '#/components/schemas/Id'
        status:
          $ref: '#/components/schemas/InvoiceStatus'
    InvoiceStatus:
      type: string
      description: |-
        Status of the invoice:
        * PendingValidation - Invoice awaits manual review
        * ReadyForPayment - invoice can be paid
        * Paid - invoice was paid
      enum:
        - pending_validation
        - ready_for_payment
        - paid
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: wb-key
    wb_user_cookie:
      type: apiKey
      in: cookie
      name: app-session

````