Aller au contenu
Ressource · Files and account

Billing accounts

A billing account holds the subscription and billing details of one or more workspaces.

billing-accounts:write
MéthodeCheminRésumé
PATCH/billing-accounts/{billingAccountId}Update a billing account

Chaque endpoint demande billing-accounts:write.

L’objet BillingAccount

firestoreIdstringobligatoire

ID of the billing account.

typestringobligatoire

Kind of holder of the billing account.

  • individual

    The billing account belongs to a person, described in individual.

  • organization

    The billing account belongs to an organization, described in organization.

ownerstringobligatoire
individualobject
Afficher les 5 champs enfants
firstNamestringobligatoire
lastNamestringobligatoire
emailstringemailobligatoire
phonestringobligatoire
addressPostalAddress

Postal address, with the parts of an ISO 20022 postal address.

Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestringobligatoire

Post code of the address.

townNamestringobligatoire

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring

Post office box.

administrativeAreastring

Region of the country, such as a canton or a state.

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

Text the address was read from, one item per line.

organizationobject
Afficher les 6 champs enfants
namestringobligatoire
emailstringemailobligatoire
phonestring
addressPostalAddress

Postal address, with the parts of an ISO 20022 postal address.

Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestringobligatoire

Post code of the address.

townNamestringobligatoire

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring

Post office box.

administrativeAreastring

Region of the country, such as a canton or a state.

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

Text the address was read from, one item per line.

contactobjectobligatoire
Afficher les 4 champs enfants
firstNamestring
lastNamestring
emailstringemailobligatoire
phonestring
metadataobjectobligatoire
Afficher les 3 champs enfants
foundationDatestring
sizestring

Number of employees of the company.

  • lessFive

    Fewer than 5 employees.

  • fiveToTen

    5 to 10 employees.

  • elevenToFifty

    11 to 50 employees.

  • fiftyOneToOneHundred

    51 to 100 employees.

  • oneHundredToTwoHundredFifty

    100 to 250 employees.

  • moreThanTwoHundredFifty

    More than 250 employees.

industrystring

Industry of the company.

Afficher les 29 valeurs
  • agriculturePisciculture

    Agriculture and fish farming.

  • businessServices

    Business services.

  • chemical

    Chemical industry.

  • commerce

    Commerce.

  • communication

    Communication.

  • construction

    Construction.

  • cultureEntertainment

    Culture and entertainment.

  • defense

    Defense.

  • education

    Education.

  • energy

    Energy.

  • finance

    Finance.

  • food

    Food.

  • forestry

    Forestry.

  • health

    Health.

  • hospitalityCatering

    Hospitality and catering.

  • insurance

    Insurance.

  • legal

    Legal services.

  • manufacturing

    Manufacturing.

  • mediaInformation

    Media and information.

  • miningOilGas

    Mining, oil and gas.

  • personalServices

    Personal services.

  • publicService

    Public service.

  • realEstate

    Real estate.

  • sportFitness

    Sport and fitness.

  • technology

    Technology.

  • textileLifeStyle

    Textile and lifestyle.

  • tourism

    Tourism.

  • transportation

    Transportation.

  • other

    Another industry.

workspaceIdsstring[]obligatoire
creationobjectobligatoire

When and by whom the resource was created.

Afficher les 2 champs enfants
creationDateTimestringdate-timeobligatoire

Date and time when the resource was created.

createdBystring

ID of the user who created the resource, when recorded.

Afficher les 8 champs
activationobjectobligatoire

Whether the resource is enabled, and when and by whom it was last enabled or disabled.

Afficher les 3 champs enfants
enabledbooleanobligatoire

Whether the resource is enabled.

updateDateTimestringdate-timeobligatoire

Date and time when enabled was last set.

updatedBystring

ID of the user who last set enabled, when recorded.

L’objet BillingAccount
{
  "firestoreId": "Bl6tW3mQ8xKp2vNr7zHs",
  "type": "individual",
  "owner": "string",
  "individual": {
    "firstName": "string",
    "lastName": "string",
    "email": "anna.meier@example.com",
    "phone": "+41791234567",
    "address": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "sortingCode": "string",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    }
  },
  "organization": {
    "name": "string",
    "email": "anna.meier@example.com",
    "phone": "+41791234567",
    "address": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "sortingCode": "string",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    },
    "contact": {
      "firstName": "string",
      "lastName": "string",
      "email": "anna.meier@example.com",
      "phone": "+41791234567"
    },
    "metadata": {
      "foundationDate": "1990-05-14",
      "size": "lessFive",
      "industry": "agriculturePisciculture"
    }
  },
  "workspaceIds": [
    "string"
  ],
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "activation": {
    "enabled": true,
    "updateDateTime": "2026-03-02T09:15:00.000Z",
    "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  }
}
PATCH/billing-accounts/{billingAccountId}

Update a billing account

Portéebilling-accounts:write

Paramètres de chemin

billingAccountIdstringobligatoire

ID of the billing account.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

addressPostalAddressobligatoire

Postal address, with the parts of an ISO 20022 postal address.

Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestringobligatoire

Post code of the address.

townNamestringobligatoire

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring

Post office box.

administrativeAreastring

Region of the country, such as a canton or a state.

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

Text the address was read from, one item per line.

Renvoie

200

Successful response

dataBillingAccountobligatoire
curl -X PATCH 'https://api.business.swayapp.io/v1/billing-accounts/Bl6tW3mQ8xKp2vNr7zHs' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "address": {
    "country": "CH",
    "postCode": "8001",
    "townName": "Zürich",
    "streetName": "Bahnhofstrasse",
    "buildingNumber": "10",
    "name": "Haus zur Linde",
    "postBox": "Postfach 1234",
    "administrativeArea": "Zürich",
    "recipients": [
      "Anna Meier"
    ],
    "organization": "Muster AG",
    "source": [
      "Muster AG",
      "Bahnhofstrasse 10",
      "8001 Zürich"
    ]
  }
}'
{
  "data": {
    "firestoreId": "Bl6tW3mQ8xKp2vNr7zHs",
    "type": "individual",
    "owner": "string",
    "individual": {…},
    "organization": {…},
    "workspaceIds": [
      "string"
    ],
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "activation": {
      "enabled": true,
      "updateDateTime": "2026-03-02T09:15:00.000Z",
      "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    }
  }
}

Construisez sur vos propres données.

Créez un compte, ouvrez Profil › Développeur et créez une clé limitée aux ressources dont vous avez besoin. Une question sur une intégration ? L’équipe y répond lors d’un appel.