*REST API › Endpoint reference › CRM › Contacts*

# Update the commercial terms of a contact

> Sets how and when this contact pays: currency, language of its documents, billing email, payment method, payment days, due date, usual discount and the electronic invoicing codes for public administration.

The default tax configuration is NOT part of the public contract. Returns the updated contact in detail.

`PATCH /api/v1/contacts/{contactId}/preferences` — scope `contacts:write`

Scope: `contacts:write` · 120/min · Inherited tenancy · Idempotency-Key · If-Match · MCP: `filmo_contacts_preferences_update`

## Authorizations

Bearer API key with the scope below. `contacts:write`

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | No | Unique identifier of the request, chosen by the client (a UUID works). Between 1 and 255 characters: an empty header is rejected with 400 `validation_error`, because the client would believe itself protected. Repeating the same key with the SAME body within 24 h returns the stored response without executing again, with the `Idempotent-Replay: true` header. With a DIFFERENT body it returns 422. It is the safe way to retry after a network timeout. |
| `If-Match` | string | No | Optimistic locking: the `ETag` you read from the resource (or `*`). If the resource changed since, the write is rejected with `412 precondition_failed` before doing anything; read it again and retry. Without the header the write always proceeds. |

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `contactId` | string | Yes | Contact identifier. |

## Body

Body schema: `ContactPreferencesBody`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `preferredLanguage` | string | No | Language of the documents issued to the contact, e.g. "es-ES"; null clears it. `es-ES`, `en-US`, `fr-FR`, `ca-ES`, `de-DE`, `pl-PL` |
| `currency` | string | No | Default currency, as a 3-letter ISO 4217 code (e.g. "EUR"); null clears it. |
| `billingEmail` | string<email> | No | Email address the invoices are sent to; null clears it. |
| `paymentMethod` | object | No | Payment method agreed with the contact; null clears it. |
| `paymentMethod.type` | string | Yes | Agreed payment method, in the same vocabulary the contact returns: bank_transfer, card, cash or other. Direct debit is a configured method of the account: assign it through paymentMethodIds. `bank_transfer`, `card`, `cash`, `other` |
| `paymentMethod.customValue` | string | No | Free-text detail when the type is "other". |
| `paymentMethodIds` | string[] | No | Payment methods configured in the account that this contact accepts. |
| `primaryPaymentMethodId` | string | No | Which of them is the primary one; null clears it. |
| `paymentDays` | integer[] | No | Days of the month on which the contact pays. Replaces the whole list; null clears it. |
| `expirationDays` | integer | No | Due days for the invoices of the contact, as a whole number of days; null uses the account default. |
| `discountSettings` | object | No | Discount applied to the contact by default. |
| `discountSettings.percentage` | number | Yes | Usual discount, as a percentage (0-100). |
| `eInvoiceFields` | object | No | Electronic invoicing codes for public administration. |
| `eInvoiceFields.accountingOffice` | string | No | Accounting office (FACe). |
| `eInvoiceFields.managementBody` | string | No | Management body (FACe). |
| `eInvoiceFields.processingUnit` | string | No | Processing unit (FACe). |
| `eInvoiceFields.proposingBody` | string | No | Proposing body (FACe). |

## Request examples

*Update the commercial terms of a contact*

**cURL**

```bash
curl https://app.filmo.io/api/v1/contacts/cont_8f2a1c/preferences \
  --request PATCH \
  --header "Authorization: Bearer $FILMO_API_KEY" \
  --header "Idempotency-Key: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" \
  --header 'Content-Type: application/json' \
  --data '{
  "currency": "EUR",
  "preferredLanguage": "es-ES",
  "billingEmail": "facturacion@example.com",
  "paymentMethod": {
    "type": "bank_transfer"
  },
  "paymentDays": [
    5,
    20
  ],
  "expirationDays": 30,
  "discountSettings": {
    "percentage": 10
  }
}'
```

**Node.js**

```javascript
fetch('https://app.filmo.io/api/v1/contacts/cont_8f2a1c/preferences', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer YOUR_FILMO_API_KEY',
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    currency: 'EUR',
    preferredLanguage: 'es-ES',
    billingEmail: 'facturacion@example.com',
    paymentMethod: {
      type: 'bank_transfer'
    },
    paymentDays: [5, 20],
    expirationDays: 30,
    discountSettings: {
      percentage: 10
    }
  })
})
```

**Python**

```python
import uuid
import requests

requests.patch(
    "https://app.filmo.io/api/v1/contacts/cont_8f2a1c/preferences",
    headers={
      "Authorization": "Bearer YOUR_FILMO_API_KEY",
      "Idempotency-Key": str(uuid.uuid4()),
      "Content-Type": "application/json"
    },
    json={
      "currency": "EUR",
      "preferredLanguage": "es-ES",
      "billingEmail": "facturacion@example.com",
      "paymentMethod": {
        "type": "bank_transfer"
      },
      "paymentDays": [
        5,
        20
      ],
      "expirationDays": 30,
      "discountSettings": {
        "percentage": 10
      }
    }
)
```

## Response

Response schema: `ContactDetailDto`

| Status | Description |
| --- | --- |
| 200 | Successful response. |
| 400 | Invalid request (validation_error): malformed query or body. `errors[]` lists every offending field with its stable code. |
| 401 | Authentication failed (unauthorized, api_key_invalid, api_key_revoked, api_key_expired, api_key_owner_inactive, api_key_owner_not_admin). |
| 403 | Not allowed (insufficient_scope: the API key does not have the required scope, named in `requiredScope`; forbidden: the owner of the key lacks the permission the operation requires). `insufficient_scope` is answered before the request counts against the rate limit, so it carries no `RateLimit-*` headers; `forbidden` does. |
| 404 | Resource not found (not_found): it does not exist or is outside the scope of the API key. |
| 409 | Conflict (conflict): the current state of the resource prevents the operation, a request with that Idempotency-Key is already in progress, or another conditional write (`If-Match`) held the resource for more than five seconds. `errors[0].code` says which: `in_progress` and `lock_timeout` are solved by retrying; `invalid_state` is not, because the state of the resource forbids the operation. |
| 412 | Precondition failed (precondition_failed): the `If-Match` entity tag does not match the current representation. Read the resource again and retry. |
| 422 | Idempotency-Key reused (idempotency_key_reused): the same key was used before with a different body. Change the key. |
| 429 | Rate limit exceeded (rate_limited): retry after `Retry-After` seconds; `RateLimit-*` says which quota ran out. |
| 500 | Internal error (internal_error). |

**200**

| Name | Type | Description |
| --- | --- | --- |
| `data` | object | The contact in full, as returned by the API. |
| `data.id` | string | Unique identifier of the contact. |
| `data.name` | string | Contact name (person or company). |
| `data.contactType` | string | Contact type: person (individual) or company (business). `person`, `company` |
| `data.role` | string | Contact role: client, provider, lead, debtor, creditor, student, teacher or unspecified. `client`, `provider`, `lead`, `debtor`, `creditor`, `student`, `teacher`, `unspecified` |
| `data.status` | string | Contact status: active (operational), inactive (deactivated) or archived (closed, kept for historical records). `active`, `inactive`, `archived` |
| `data.nif` | string | NIF/CIF or tax identification number; null if not recorded. |
| `data.commercialName` | string | Trade name; null if it matches the name or is not recorded. |
| `data.position` | string | Job title or position of the contact person; null if not recorded. |
| `data.contactNumber` | string | Contact number assigned by the account (internal reference); null if not recorded. |
| `data.emails` | object[] | List of email addresses of the contact. |
| `data.emails.id` | string | Internal identifier of the email within the contact. |
| `data.emails.label` | string | Descriptive label of the email; null if it has none. |
| `data.emails.email` | string | Email address. |
| `data.emails.isPrimary` | boolean | Whether this is the primary email of the contact. |
| `data.billingEmail` | string | Dedicated billing email; null means the primary email is used. |
| `data.phoneNumbers` | object[] | List of phone numbers of the contact. |
| `data.phoneNumbers.id` | string | Internal identifier of the phone number within the contact. |
| `data.phoneNumbers.label` | string | Descriptive label of the phone number; null if it has none. |
| `data.phoneNumbers.number` | string | Phone number. |
| `data.phoneNumbers.countryCode` | string | International country calling code (e.g. "+34"); null if not recorded. |
| `data.phoneNumbers.isPrimary` | boolean | Whether this is the primary phone number of the contact. |
| `data.websites` | object[] | List of websites of the contact. |
| `data.websites.id` | string | Internal identifier of the website within the contact. |
| `data.websites.label` | string | Descriptive label of the website; null if it has none. |
| `data.websites.url` | string | Website URL. |
| `data.addresses` | object[] | List of addresses of the contact. |
| `data.addresses.id` | string | Internal identifier of the address within the contact. |
| `data.addresses.label` | string | Descriptive label of the address; null if it has none. |
| `data.addresses.addressLine1` | string | First line of the address; null if not recorded. |
| `data.addresses.addressLine2` | string | Second line of the address; null if not recorded. |
| `data.addresses.city` | string | City; null if not recorded. |
| `data.addresses.province` | string | Province or region; null if not recorded. |
| `data.addresses.postcode` | string | Postcode; null if not recorded. |
| `data.addresses.country` | string | Country; null if not recorded. |
| `data.addresses.isMain` | boolean | Whether this is the main address of the contact. |
| `data.folder` | string | Folder or organizational grouping; null if the contact is not classified. |
| `data.discountPercentage` | number | General discount percentage of the contact (0-100); null if no discount is configured. |
| `data.preferredLanguage` | string | Preferred language of the contact; null if not recorded. |
| `data.currency` | string | Default currency of the contact as an ISO 4217 code; null if not recorded. |
| `data.paymentMethod` | object | Preferred payment method of the contact; null if not configured. |
| `data.paymentMethod.type` | string | Payment method type: bank_transfer, card, cash, sepa_direct_debit or other. `bank_transfer`, `card`, `cash`, `other`, `sepa_direct_debit` |
| `data.paymentMethod.customValue` | string | Free-text detail when the type is "other" (for example a method recorded before it was configured); null otherwise. |
| `data.paymentDays` | integer[] | Days of the month on which the contact makes payments; null if not configured. |
| `data.expirationDays` | integer | Default due days for the invoices of the contact; null if not configured. |
| `data.subscribedToMarketing` | boolean | Whether the contact is subscribed to marketing communications. |
| `data.isAppUser` | boolean | Whether the contact has access to the app. |
| `data.customFields` | object<string, any> | Custom field values by custom field identifier; the definitions are in `/api/v1/custom-fields`. |
| `data.createdAt` | string<date-time> | Creation date in ISO 8601 with offset. |
| `data.updatedAt` | string<date-time> | Last update date in ISO 8601 with offset. |
| `data.relatedContacts` | object[] | Contacts related to this contact (e.g. people of a company). |
| `data.relatedContacts.id` | string | Unique identifier of the related contact. |
| `data.relatedContacts.name` | string | Name of the related contact. |
| `data.relatedContacts.commercialName` | string | Trade name of the related contact; null if not recorded. |
| `data.relatedContacts.contactType` | string | Type of the related contact: person or company. `person`, `company` |
| `data.relatedContacts.role` | string | Role of the related contact. `client`, `provider`, `lead`, `debtor`, `creditor`, `student`, `teacher`, `unspecified` |
| `data.relatedContacts.status` | string | Status of the related contact: active, inactive or archived. `active`, `inactive`, `archived` |
| `data.relatedContacts.relationRole` | string | Role of the relationship between the two contacts (e.g. "employee of"); null if not recorded. |
| `meta` | object | Additional information about the response. |
| `meta.warnings` | object[] | Lifecycle warnings; present only when the operation is deprecated. |
| `meta.warnings.code` | string | Stable warning code. `deprecated` |
| `meta.warnings.message` | string | For people: what is deprecated, until when, and what to use. |
| `meta.warnings.sunset` | string | Day (YYYY-MM-DD) the operation stops being served. |
| `meta.warnings.replacement` | string | `operationId` of the operation to use instead, or null if there is none. |
| `meta.warnings.link` | string | Where the deprecation is documented (the changelog). |

*Example response · 200*

```json
{
  "data": {
    "id": "contact_9f3a2b",
    "name": "Example contact",
    "contactType": "person",
    "role": "client",
    "status": "active",
    "nif": "B00000000",
    "commercialName": "Example commercial name",
    "position": "Example position",
    "contactNumber": "2026-0001",
    "emails": [
      {
        "id": "email_9f3a2b",
        "label": "Main",
        "email": "ana.garcia@example.com",
        "isPrimary": true
      }
    ],
    "billingEmail": "ana.garcia@example.com",
    "phoneNumbers": [
      {
        "id": "phone_number_9f3a2b",
        "label": "Main",
        "number": "+34 600 000 000",
        "countryCode": "+34",
        "isPrimary": true
      }
    ],
    "websites": [
      {
        "id": "website_9f3a2b",
        "label": "Main",
        "url": "https://example.com/resource"
      }
    ],
    "addresses": [
      {
        "id": "address_9f3a2b",
        "label": "Main",
        "addressLine1": "Calle de Ejemplo 12",
        "addressLine2": "Calle de Ejemplo 12",
        "city": "Madrid",
        "province": "Madrid",
        "postcode": "28001",
        "country": "ES",
        "isMain": true
      }
    ],
    "folder": "Example folder",
    "discountPercentage": 1,
    "preferredLanguage": "es-ES",
    "currency": "EUR",
    "paymentMethod": {
      "type": "bank_transfer",
      "customValue": "Example custom value"
    },
    "paymentDays": [
      1
    ],
    "expirationDays": 1,
    "subscribedToMarketing": true,
    "isAppUser": true,
    "customFields": {
      "example": "example"
    },
    "createdAt": "2026-09-01T08:00:00.000Z",
    "updatedAt": "2026-09-01T08:00:00.000Z",
    "relatedContacts": [
      {
        "id": "related_contact_9f3a2b",
        "name": "Example related contact",
        "commercialName": "Example commercial name",
        "contactType": "person",
        "role": "client",
        "status": "active",
        "relationRole": "Example relation role"
      }
    ]
  }
}
```

## Errors

| Status | Codes | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | Malformed query or body. `errors[]` lists every offending field with its stable code. |
| 404 | `not_found` | It does not exist or is outside the scope of the API key. |
| 409 | `conflict` | The current state of the resource prevents the operation, a request with that Idempotency-Key is already in progress, or another conditional write (`If-Match`) held the resource for more than five seconds. `errors[0].code` says which: `in_progress` and `lock_timeout` are solved by retrying; `invalid_state` is not, because the state of the resource forbids the operation. |
| 412 | `precondition_failed` | The `If-Match` entity tag does not match the current representation. Read the resource again and retry. |
| 422 | `idempotency_key_reused` | The same key was used before with a different body. Change the key. |

## Deprecation

This operation is not deprecated. Deprecations are announced with a Deprecation header and a sunset date.

---

Canonical URL: https://docs.filmo.io/rest-api/endpoint-reference/contacts/update-the-commercial-terms-of-a-contact  
Last updated: 2026-10-25