Create an application membership

How to create an application membership via API

To create a new application membership, send a POST request to the /api/application_memberships endpoint, passing the resource arguments in the request body.

Request

POST https://provisioning.commercelayer.io/api/application_memberships

Arguments

Body ParameterTypeRequired

type

string

Required

attributes.filters

object

Optional

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.api_credential

object

Required

relationships.membership

object

Required

relationships.organization

object

Required

relationships.role

object

Required

Example

The following request creates a new application membership:

curl -g -X POST \
  'https://provisioning.commercelayer.io/api/application_memberships' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer {{your_access_token}}' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "application_memberships",
    "relationships": {
      "api_credential": {
        "data": {
          "type": "api_credentials",
          "id": "ABCRtyUpBa"
        }
      },
      "membership": {
        "data": {
          "type": "memberships",
          "id": "BCDRtyUpBa"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": "CDERtyUpBa"
        }
      },
      "role": {
        "data": {
          "type": "roles",
          "id": "DEFRtyUpBa"
        }
      }
    }
  }
}'

Last updated