import requests
url = "https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
curl --request PATCH \
--url https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"created_at": "2023-11-07T05:31:56Z",
"email": "[email protected]",
"first_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invite_expires_at": "2023-11-07T05:31:56Z",
"last_name": "<string>",
"revocation_reason": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "admin",
"sandbox_origin": "production_mirror",
"status": "pending_setup",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "validation_error",
"detail": "The request contains invalid data.",
"errors": [
{
"code": "invalid",
"field": "users[0].email",
"message": "Enter a valid email address."
}
]
}{
"code": "not_authenticated",
"detail": "Authentication credentials were not provided."
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "not_found",
"detail": "The requested resource was not found."
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Change a pending membership role
The memberships of one managed company: list, add, and revoke users.
import requests
url = "https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
curl --request PATCH \
--url https://api.paywise.de/partner/v2/companies/{company_id}/users/{membership_id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"created_at": "2023-11-07T05:31:56Z",
"email": "[email protected]",
"first_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invite_expires_at": "2023-11-07T05:31:56Z",
"last_name": "<string>",
"revocation_reason": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "admin",
"sandbox_origin": "production_mirror",
"status": "pending_setup",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "validation_error",
"detail": "The request contains invalid data.",
"errors": [
{
"code": "invalid",
"field": "users[0].email",
"message": "Enter a valid email address."
}
]
}{
"code": "not_authenticated",
"detail": "Authentication credentials were not provided."
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "not_found",
"detail": "The requested resource was not found."
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Partner API Bearer key: Authorization: Bearer <key>. Keys are created only through authorized portal or staff flows.
Headers
Apply the change only while the current ETag matches one of the supplied validators (or *); otherwise the request fails with 412 precondition_failed and nothing is written.
Path Parameters
UUID of the managed company in this request.
UUID of the company membership in this request.
Body
Update the role of a pending membership.
New permissions for the pending membership.
admin- admintax_consultant- tax_consultantmember- memberreadonly- readonlydeveloper- developer
admin, tax_consultant, member, readonly, developer Response
A user's membership in a managed company.
Time at which the membership was created.
Email address submitted with the invitation while it is unaccepted; after acceptance, reflects the user's current profile.
128Given name submitted with the invitation while it is unaccepted; after acceptance, reflects the user's current profile.
128Stable identifier of this user's membership in the managed company. Use it as membership_id in the company users endpoints.
Expiry time of the setup invitation while the membership is pending_setup; null when no pending setup invitation is attached.
Family name submitted with the invitation while it is unaccepted; after acceptance, reflects the user's current profile.
128Reason recorded when the membership was revoked.
Time at which the membership was revoked.
Partner credential that revoked the membership, when applicable.
Permissions the user receives within the managed company.
admin- admintax_consultant- tax_consultantmember- memberreadonly- readonlydeveloper- developer
admin, tax_consultant, member, readonly, developer Provenance of the user behind this membership — sandbox_native for a subject created inside the sandbox (a test resource), production_mirror for a read-only copy of a production user, unclassified otherwise (always so in production).
production_mirror- Production mirrorsandbox_native- Sandbox nativeunclassified- Unclassified
production_mirror, sandbox_native, unclassified Membership lifecycle state: pending_setup awaits invitation acceptance; active grants access; cancelled ends a pending invitation; revoked removes an active membership's access.
pending_setup, active, cancelled, revoked Time at which the membership was last updated.
