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

# Update Billing Details

> Change what invoices print. Send any of `name`, `email`, `address`, `tax_id` and
`language`; fields left out stay as they are. Required scope `billing:manage`.

`null` resets: `name` to the workspace name, `email` to the workspace owner's email, and
removes the address or the tax ID. A workspace keeps one tax ID; sending a new one
replaces it, and a number that is not valid for its type is refused with
`TAX_ID_INVALID` and the old one stays.

A change applies to invoices issued after it. An invoice already issued is never
changed. Invoices are issued in English; `language: he` gives English invoices with
day-first dates. The answer is the same body `GET /billing/details` returns.


Set what your invoices print: the business name, the email invoices are sent
to, the postal address, the tax ID and the language. Requires `billing:manage`.
A key without that scope is `403 INSUFFICIENT_SCOPE`.

Send only what you are changing; a field you leave out stays as it is. The
response is the whole set, as [`GET /billing/details`](https://docs.goyappr.com/api-reference/billing/details)
returns it.

```bash theme={null}
curl -X PATCH "https://api.goyappr.com/billing/details" \
  -H "Authorization: Bearer $YAPPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Ltd",
    "address": { "line1": "1 Example St", "city": "Tel Aviv", "postal_code": "6100000", "country": "IL" },
    "tax_id": { "type": "il_vat", "value": "000012345" }
  }'
```

```json theme={null}
{
  "name": "Acme Ltd",
  "email": "billing@acme.example",
  "address": { "line1": "1 Example St", "line2": null, "city": "Tel Aviv", "state": null, "postal_code": "6100000", "country": "IL" },
  "tax_id": { "type": "il_vat", "value": "000012345" },
  "language": "en"
}
```

| Field | Send | `null` means |
| - | - | - |
| `name` | 1 to 256 characters. | Use the workspace's name. |
| `email` | A full email address, up to 254 characters. | Use the workspace owner's email. |
| `address` | `line1` and `country` (two letters, such as `IL`) are required; `line2`, `city`, `state` and `postal_code` are optional, up to 200 characters each. | Remove the address. |
| `tax_id` | `type` and `value` (1 to 64 characters; spaces are removed). One tax ID per workspace: a new one replaces the old. | Remove the tax ID. |
| `language` | `en` or `he`. | Not allowed. |

## When it takes effect

The invoices issued after the change print the new details. An invoice that
was already issued is never rewritten, so a correction shows from the next
payment on. List the invoices themselves with
[`GET /billing/invoices`](https://docs.goyappr.com/api-reference/billing/invoices).

Invoices are issued in English whatever `language` says; `he` prints dates
day first.

## Tax ID types

| `type` | Country | Example |
| - | - | - |
| `il_vat` | Israel — a VAT (עוסק מורשה) or company (ח.פ.) number | `000012345` |
| `eu_vat` | European Union | `DE123456789` |
| `gb_vat` | United Kingdom | `GB123456789` |
| `us_ein` | United States | `12-3456789` |
| `ca_bn` | Canada | `123456789` |
| `au_abn` | Australia | `12345678912` |
| `ch_vat` | Switzerland | `CHE-123.456.789 MWST` |
| `no_vat` | Norway | `123456789MVA` |
| `ae_trn` | United Arab Emirates | `123456789012345` |
| `za_vat` | South Africa | `4123456789` |

A number that is not valid for its type is refused with `400 TAX_ID_INVALID`,
and the tax ID you already had stays on.

## Errors

| HTTP | `code` | When |
| - | - | - |
| `400` | `BILLING_DETAILS_EMPTY` | The body names none of `name`, `email`, `address`, `tax_id` or `language`. |
| `400` | `BILLING_DETAILS_UNKNOWN_FIELD` | The body has a field that is not a billing detail. Nothing was changed. |
| `400` | `BILLING_NAME_INVALID` | `name` is empty or longer than 256 characters. |
| `400` | `BILLING_EMAIL_INVALID` | `email` is not a full email address. |
| `400` | `BILLING_ADDRESS_INVALID` | `address` has no `line1`, or no two-letter `country`. |
| `400` | `TAX_ID_TYPE_UNSUPPORTED` | `tax_id.type` is not one of the types above. |
| `400` | `TAX_ID_INVALID` | `tax_id.value` is not a valid number of its type. |
| `400` | `BILLING_LANGUAGE_INVALID` | `language` is not `en` or `he`. |
| `403` | `INSUFFICIENT_SCOPE` | The key does not hold `billing:manage`. |
| `502` | `BILLING_UNAVAILABLE` | The details could not be saved right now. Some details may have been saved; read [`GET /billing/details`](https://docs.goyappr.com/api-reference/billing/details) and try again. |


## OpenAPI

````yaml PATCH /billing/details
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /billing/details:
    patch:
      tags:
        - Billing
      summary: Update billing details
      description: >
        Change what invoices print. Send any of `name`, `email`, `address`,
        `tax_id` and

        `language`; fields left out stay as they are. Required scope
        `billing:manage`.


        `null` resets: `name` to the workspace name, `email` to the workspace
        owner's email, and

        removes the address or the tax ID. A workspace keeps one tax ID; sending
        a new one

        replaces it, and a number that is not valid for its type is refused with

        `TAX_ID_INVALID` and the old one stays.


        A change applies to invoices issued after it. An invoice already issued
        is never

        changed. Invoices are issued in English; `language: he` gives English
        invoices with

        day-first dates. The answer is the same body `GET /billing/details`
        returns.
      operationId: updateBillingDetails
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingDetailsUpdate'
            examples:
              business:
                summary: Business name, address and Israeli VAT number
                value:
                  name: Acme Ltd
                  address:
                    line1: 1 Example St
                    city: Tel Aviv
                    postal_code: '6100000'
                    country: IL
                  tax_id:
                    type: il_vat
                    value: '000012345'
              send_elsewhere:
                summary: Send invoices to the bookkeeper
                value:
                  email: books@acme.example
              reset:
                summary: Back to the defaults
                value:
                  name: null
                  email: null
                  address: null
                  tax_id: null
      responses:
        '200':
          description: The billing details, as saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingDetails'
        '400':
          description: >
            One of:

            BILLING_DETAILS_EMPTY — no field was sent, or the body is not a JSON
            object.

            BILLING_DETAILS_UNKNOWN_FIELD — a field that is not a billing
            detail, named in the message.

            BILLING_NAME_INVALID — `name` is not 1 to 256 characters.

            BILLING_EMAIL_INVALID — `email` is not a full email address.

            BILLING_ADDRESS_INVALID — `address` lacks `line1` or a two-letter
            country code, or carries a field it does not take.

            TAX_ID_TYPE_UNSUPPORTED — `tax_id.type` is not one of the listed
            types.

            TAX_ID_INVALID — the number is not valid for its type; the old tax
            ID stays.

            BILLING_LANGUAGE_INVALID — `language` is not `en` or `he`.

            BILLING_QUERY_INVALID — a query parameter; this write reads none.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >
            INSUFFICIENT_SCOPE — the key lacks `billing:manage`.
            API_KEY_AGENT_SCOPED — the key is limited to agents, and billing
            belongs to the whole workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            BILLING_UNAVAILABLE: the details could not be saved right now. Try
            again in a minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    BillingDetailsUpdate:
      type: object
      minProperties: 1
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
          nullable: true
          description: null resets it to the workspace name.
        email:
          type: string
          format: email
          maxLength: 254
          nullable: true
          description: null resets it to the workspace owner's email.
        address:
          nullable: true
          description: null removes the address.
          allOf:
            - $ref: '#/components/schemas/BillingAddress'
        tax_id:
          nullable: true
          description: null removes the tax ID. A new one replaces the old.
          allOf:
            - $ref: '#/components/schemas/BillingTaxId'
        language:
          type: string
          enum:
            - en
            - he
    BillingDetails:
      type: object
      required:
        - name
        - email
        - address
        - tax_id
        - language
      properties:
        name:
          type: string
          description: The business or legal name printed on invoices.
          example: Acme Ltd
        email:
          type: string
          format: email
          nullable: true
          description: Where invoices are emailed. Defaults to the workspace owner's email.
          example: billing@acme.example
        address:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BillingAddress'
        tax_id:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BillingTaxId'
        language:
          type: string
          enum:
            - en
            - he
          description: >-
            The workspace language. Invoices are issued in English; he gives
            day-first dates.
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
    BillingAddress:
      type: object
      required:
        - line1
        - country
      additionalProperties: false
      properties:
        line1:
          type: string
          minLength: 1
          maxLength: 200
          example: 1 Example St
        line2:
          type: string
          maxLength: 200
          nullable: true
        city:
          type: string
          maxLength: 200
          nullable: true
          example: Tel Aviv
        state:
          type: string
          maxLength: 200
          nullable: true
        postal_code:
          type: string
          maxLength: 200
          nullable: true
          example: '6100000'
        country:
          type: string
          pattern: ^[A-Z]{2}$
          description: Two-letter country code (ISO 3166-1 alpha-2).
          example: IL
    BillingTaxId:
      type: object
      required:
        - type
        - value
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - il_vat
            - eu_vat
            - gb_vat
            - us_ein
            - ca_bn
            - au_abn
            - ch_vat
            - no_vat
            - ae_trn
            - za_vat
          description: il_vat for an Israeli VAT or company number.
        value:
          type: string
          minLength: 1
          maxLength: 64
          description: Spaces are removed.
          example: '000012345'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**. No key is `401 MISSING_KEY`; a key that
        is not one of ours, or is revoked, is `401 INVALID_KEY`; an expired one
        is `401 EXPIRED_KEY`. A valid key without the scope an operation needs
        is `403 INSUFFICIENT_SCOPE` on every operation, and the message names
        the scope. Every response, a 401 included, carries X-RateLimit-Limit,
        X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a
        minute per API key. Every 429, whatever its code, carries Retry-After
        (whole seconds, never zero): the per-key budget's `RATE_LIMIT` asks for
        what is left of the minute, a route's daily cap (`RATE_LIMITED`) for the
        time until that cap resets. All four headers are listed in
        Access-Control-Expose-Headers, so a browser can read them. A path the
        API does not serve (an unknown sub-path, an id left empty) is `404
        ROUTE_NOT_FOUND`, and a method a served path does not take is `405
        METHOD_NOT_ALLOWED` with an `Allow` header; both are answered before any
        scope check, and nothing is read or changed. A trailing slash is ignored
        where it cannot be an id left empty (`POST /calls/` is `POST /calls`)
        and refused where it can (`GET /calls/`). A doubled slash inside a path
        is merged into one before the request reaches the API (`GET //calls` is
        `GET /calls`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.