Members

Return a Member.

Parameters
  • idpath integerRequired

    Return a Member by specific id.

  • includequery string

    Include associations (delimited with comma). Available associations: business, user.

    Example: business,user.

GET/api/v1/members/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/members/${id}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Create Member

Create a member of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a member of a business.

    • typestringRequired

      Provide Member type. Current selection is only members.

    • attributesformData, objectRequired

      Attributes object with a few required fields.

      • emailstringRequired

        Email address.

      • rolestringRequired

        Role in business.

      • business_managerundefinedRequired

        Allow member to manage business.

    • relationshipsformData, objectRequired

      Relationships object with business object.

      • businessformData, objectRequired

        Add a relationships link between member and related Business.

        • idstringRequired

          Related Business id.

        • typestringRequired

          Business type; business.

POST/api/v1/members

{
  const res = await fetch(`${BASE_URL}/api/v1/members`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "16547034-d0a8-4108-9046-129a60d309e7",
    "type": "members",
    "links": {
      "self": "/members/16547034-d0a8-4108-9046-129a60d309e7"
    },
    "attributes": {
      "business-manager": true,
      "email": "member@test.com",
      "role": "manager",
      "status": "pending"
    },
    "relationships": {
      "business": {
        "links": {
          "self": "/members/16547034-d0a8-4108-9046-129a60d309e7/relationships/business",
          "related": "/members/16547034-d0a8-4108-9046-129a60d309e7/business"
        }
      },
      "user": {
        "links": {
          "self": "/members/16547034-d0a8-4108-9046-129a60d309e7/relationships/user",
          "related": "/members/16547034-d0a8-4108-9046-129a60d309e7/user"
        }
      }
    }
  }
}

Update Member

Update a member.

Parameters
  • idpath integerRequired

    Update a Member by specific id.

  • dataformData, objectRequired

    Form Data needed when updating a Member.

    • idstringRequired

      Provide Member id.

    • typestringRequired

      Provide Member type. Current selection is only members.

    • attributesformData, object

      Attributes object.

      • rolestring

        Role in business.

      • business_managerundefined

        Allow member to manage business.

PATCH/api/v1/members/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/members/${id}`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "16547034-d0a8-4108-9046-129a60d309e7",
    "type": "members",
    "links": {
      "self": "/members/16547034-d0a8-4108-9046-129a60d309e7"
    },
    "attributes": {
      "business-manager": true,
      "email": "member@test.com",
      "role": "the boss",
      "status": "pending"
    },
    "relationships": {
      "business": {
        "links": {
          "self": "/members/16547034-d0a8-4108-9046-129a60d309e7/relationships/business",
          "related": "/members/16547034-d0a8-4108-9046-129a60d309e7/business"
        }
      },
      "user": {
        "links": {
          "self": "/members/16547034-d0a8-4108-9046-129a60d309e7/relationships/user",
          "related": "/members/16547034-d0a8-4108-9046-129a60d309e7/user"
        }
      }
    }
  }
}

Delete Member

Delete a Member.

Parameters
  • idpath integerRequired

    Delete a Member by specific id.

DELETE/api/v1/Member/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/Member/${id}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    }});
  const data = await res.json();
}

Accept Member

Accept a member of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when accepting a Member.

    • typestringRequired

      Provide Member type. Current selection is only members.

    • attributesformData, objectRequired

      Attributes object.

      • auth_tokenstringRequired

      • terms_agreementundefinedRequired

PATCH/api/v1/members/accept

  {
    const res = await fetch(`${BASE_URL}/api/v1/members/accept`, {
      method: 'PATCH',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)});

    const data = await res.json();
  }

RESPONSE


Reject Member

Reject a member of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when rejecting a Member.

    • typestringRequired

      Provide Member type. Current selection is only members.

    • attributesformData, objectRequired

      Attributes object.

      • auth_tokenstringRequired

PATCH/api/v1/members/reject

  {
    const res = await fetch(`${BASE_URL}/api/v1/members/reject`, {
      method: 'PATCH',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)});

    const data = await res.json();
  }

RESPONSE