import requests
url = "https://api.paywise.de/partner/v2/companies/{company_id}/users/"
payload = {
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({email: '[email protected]', first_name: '<string>', last_name: '<string>'})
};
fetch('https://api.paywise.de/partner/v2/companies/{company_id}/users/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.paywise.de/partner/v2/companies/{company_id}/users/")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.paywise.de/partner/v2/companies/{company_id}/users/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Idempotency-Key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
curl --request POST \
--url https://api.paywise.de/partner/v2/companies/{company_id}/users/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
}
'{
"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",
"setup_url": "<string>"
}{
"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>"
}
]
}Add a company membership
The memberships of one managed company: list, add, and revoke users.
import requests
url = "https://api.paywise.de/partner/v2/companies/{company_id}/users/"
payload = {
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({email: '[email protected]', first_name: '<string>', last_name: '<string>'})
};
fetch('https://api.paywise.de/partner/v2/companies/{company_id}/users/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.paywise.de/partner/v2/companies/{company_id}/users/")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.paywise.de/partner/v2/companies/{company_id}/users/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Idempotency-Key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
curl --request POST \
--url https://api.paywise.de/partner/v2/companies/{company_id}/users/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
}
'{
"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",
"setup_url": "<string>"
}{
"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>"
}
]
}Authorizations
Partner API Bearer key: Authorization: Bearer <key>. Keys are created only through authorized portal or staff flows.
Headers
Required client-supplied key scoped to the Partner owner, method, operation and path. An exact retry replays the original response while it is retained, including after credential rotation or replacement. Current permissions are required.
Path Parameters
UUID of the managed company in this request.
Body
A user's membership in a managed company.
Email address used to identify and invite the user.
1 - 128Given name of the user.
1 - 128Family name of the user.
1 - 128Permissions the user receives within the managed company. The first nonterminal company membership must have role admin; cancelled and revoked memberships do not count as existing memberships for this rule.
admin, tax_consultant, member, readonly, developer Assert that a newly created global user's email ownership was verified out of band. Defaults to false and requires a staff-controlled Partner entitlement. The membership still remains pending_setup until the invitation is accepted.
Response
Create/resend response: the membership plus its one-time setup_url.
Same rule as the webhook signing secret: the link is the invite token,
shown exactly once on the response of the command that issued it. Reads
use MembershipSerializer (no such field) and the view redacts the
field from the idempotency snapshot, so replays omit it as well.
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.
One-time setup invitation link. Returned on a fresh membership invitation or resend; omitted from idempotent replays. Treat the link as a secret.
