| Méthode | Chemin | Résumé |
|---|---|---|
| PATCH | /billing-accounts/{billingAccountId} | Update a billing account |
Chaque endpoint demande billing-accounts:write.
L’objet BillingAccount
firestoreIdstringobligatoireID of the billing account.
typestringobligatoireKind of holder of the billing account.
individualThe billing account belongs to a person, described in
individual.organizationThe billing account belongs to an organization, described in
organization.
ownerstringobligatoireindividualobjectAfficher les 5 champs enfants
firstNamestringobligatoirelastNamestringobligatoireemailstringemailobligatoirephonestringobligatoireaddressPostalAddressPostal address, with the parts of an ISO 20022 postal address.
Afficher les 12 champs enfants
countrystringobligatoireISO 3166-1 alpha-2 country code
postCodestringobligatoirePost code of the address.
townNamestringobligatoireName of the town or city.
streetNamestringName of the street.
buildingNumberstringNumber of the building in the street.
namestringName of the building or place.
sortingCodestringAdditional sorting code of the postal service, used in a few countries such as France.
postBoxstringPost office box.
administrativeAreastringRegion of the country, such as a canton or a state.
recipientsstring[]Names of the people the address is for.
organizationstringName of the organization at the address.
sourcestring[]Text the address was read from, one item per line.
organizationobjectAfficher les 6 champs enfants
namestringobligatoireemailstringemailobligatoirephonestringaddressPostalAddressPostal address, with the parts of an ISO 20022 postal address.
Afficher les 12 champs enfants
countrystringobligatoireISO 3166-1 alpha-2 country code
postCodestringobligatoirePost code of the address.
townNamestringobligatoireName of the town or city.
streetNamestringName of the street.
buildingNumberstringNumber of the building in the street.
namestringName of the building or place.
sortingCodestringAdditional sorting code of the postal service, used in a few countries such as France.
postBoxstringPost office box.
administrativeAreastringRegion of the country, such as a canton or a state.
recipientsstring[]Names of the people the address is for.
organizationstringName of the organization at the address.
sourcestring[]Text the address was read from, one item per line.
contactobjectobligatoireAfficher les 4 champs enfants
firstNamestringlastNamestringemailstringemailobligatoirephonestringmetadataobjectobligatoireAfficher les 3 champs enfants
foundationDatestringsizestringNumber of employees of the company.
lessFiveFewer than 5 employees.
fiveToTen5 to 10 employees.
elevenToFifty11 to 50 employees.
fiftyOneToOneHundred51 to 100 employees.
oneHundredToTwoHundredFifty100 to 250 employees.
moreThanTwoHundredFiftyMore than 250 employees.
industrystringIndustry of the company.
Afficher les 29 valeurs
agriculturePiscicultureAgriculture and fish farming.
businessServicesBusiness services.
chemicalChemical industry.
commerceCommerce.
communicationCommunication.
constructionConstruction.
cultureEntertainmentCulture and entertainment.
defenseDefense.
educationEducation.
energyEnergy.
financeFinance.
foodFood.
forestryForestry.
healthHealth.
hospitalityCateringHospitality and catering.
insuranceInsurance.
legalLegal services.
manufacturingManufacturing.
mediaInformationMedia and information.
miningOilGasMining, oil and gas.
personalServicesPersonal services.
publicServicePublic service.
realEstateReal estate.
sportFitnessSport and fitness.
technologyTechnology.
textileLifeStyleTextile and lifestyle.
tourismTourism.
transportationTransportation.
otherAnother industry.
workspaceIdsstring[]obligatoirecreationobjectobligatoireWhen and by whom the resource was created.
Afficher les 2 champs enfants
creationDateTimestringdate-timeobligatoireDate and time when the resource was created.
createdBystringID of the user who created the resource, when recorded.
Afficher les 8 champsMasquer la liste des champs
activationobjectobligatoireWhether the resource is enabled, and when and by whom it was last enabled or disabled.
Afficher les 3 champs enfants
enabledbooleanobligatoireWhether the resource is enabled.
updateDateTimestringdate-timeobligatoireDate and time when enabled was last set.
updatedBystringID of the user who last set enabled, when recorded.
{
"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"
}
}/billing-accounts/{billingAccountId}Update a billing account
Portéebilling-accounts:write
Paramètres de chemin
billingAccountIdstringobligatoireID of the billing account.
Paramètres de requête
fieldsstringComma-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
addressPostalAddressobligatoirePostal address, with the parts of an ISO 20022 postal address.
Afficher les 12 champs enfants
countrystringobligatoireISO 3166-1 alpha-2 country code
postCodestringobligatoirePost code of the address.
townNamestringobligatoireName of the town or city.
streetNamestringName of the street.
buildingNumberstringNumber of the building in the street.
namestringName of the building or place.
sortingCodestringAdditional sorting code of the postal service, used in a few countries such as France.
postBoxstringPost office box.
administrativeAreastringRegion of the country, such as a canton or a state.
recipientsstring[]Names of the people the address is for.
organizationstringName of the organization at the address.
sourcestring[]Text the address was read from, one item per line.
Renvoie
Successful response
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"
]
}
}'const response = await fetch('https://api.business.swayapp.io/v1/billing-accounts/Bl6tW3mQ8xKp2vNr7zHs', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"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"
]
}
}),
});
console.log(await response.json());import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/billing-accounts/Bl6tW3mQ8xKp2vNr7zHs",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"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",
],
},
},
)
print(response.json()){
"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"
}
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}