Create an entitlement
curl --request POST \
--url https://api-m.sandbox.paypal.com/v1/commerce/billing/plans/{plan_code}/entitlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entitlements": [
{
"feature_code": "seats",
"feature_privilege_values": {
"max": 100,
"max_admins": 10,
"root": true,
"guest_access": false
}
},
{
"feature_code": "api_access",
"feature_privilege_values": {
"rate_limit": 10000,
"endpoints": "all"
}
}
]
}
'{
"entitlements": [
{
"feature_code": "seats",
"name": "Number of seats",
"description": "Number of users of the account",
"feature_privileges": [
{
"code": "max",
"name": "Maximum",
"value_type": "INTEGER",
"value": 100
},
{
"code": "max_admins",
"name": "Max Admins",
"value_type": "INTEGER",
"value": 10
},
{
"code": "root",
"name": "Allow root user",
"value_type": "BOOLEAN",
"value": true
},
{
"code": "guest_access",
"name": "Allow guest access",
"value_type": "BOOLEAN",
"value": false
}
]
},
{
"feature_code": "api_access",
"name": "API Access",
"description": "Access to REST API endpoints",
"feature_privileges": [
{
"code": "rate_limit",
"name": "API Rate Limit",
"value_type": "INTEGER",
"value": 10000
},
{
"code": "endpoints",
"name": "Available Endpoints",
"value_type": "SELECT",
"value": "all",
"config": {
"select_options": [
"basic",
"standard",
"premium",
"all"
]
}
}
]
}
]
}{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "dc99e3955cdd8",
"details": [
{
"field": "/email",
"value": "abc",
"location": "body",
"issue": "INVALID_PARAMETER_VALUE",
"description": "The value of a field does not conform to the expected format."
}
]
}{
"name": "<string>",
"debug_id": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"value": "<string>",
"location": "<string>",
"issue": "<string>",
"description": "<string>"
}
]
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "90957fca61718",
"details": [
{
"field": "transaction_id",
"issue": "RESOURCE_ALREADY_EXISTS",
"description": "The resource identified by `field` already exists."
}
]
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "90957fca61718",
"details": [
{
"field": "/email",
"value": "sdfwdj@sdfs.com",
"location": "body",
"issue": "UNSUPPORTED_EMAIL",
"description": "The email provided is not supported."
}
]
}{
"name": "INTERNAL_SERVER_ERROR",
"message": "An internal server error has occurred.",
"debug_id": "90957fca61718"
}Create an entitlement
Assign a feature to a plan with specific privilege values. This action removes all current entitlements and replaces with the new ones provided. To retain existing entitlements while adding new ones, apply a PATCH request.
POST
/
plans
/
{plan_code}
/
entitlements
Create an entitlement
curl --request POST \
--url https://api-m.sandbox.paypal.com/v1/commerce/billing/plans/{plan_code}/entitlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entitlements": [
{
"feature_code": "seats",
"feature_privilege_values": {
"max": 100,
"max_admins": 10,
"root": true,
"guest_access": false
}
},
{
"feature_code": "api_access",
"feature_privilege_values": {
"rate_limit": 10000,
"endpoints": "all"
}
}
]
}
'{
"entitlements": [
{
"feature_code": "seats",
"name": "Number of seats",
"description": "Number of users of the account",
"feature_privileges": [
{
"code": "max",
"name": "Maximum",
"value_type": "INTEGER",
"value": 100
},
{
"code": "max_admins",
"name": "Max Admins",
"value_type": "INTEGER",
"value": 10
},
{
"code": "root",
"name": "Allow root user",
"value_type": "BOOLEAN",
"value": true
},
{
"code": "guest_access",
"name": "Allow guest access",
"value_type": "BOOLEAN",
"value": false
}
]
},
{
"feature_code": "api_access",
"name": "API Access",
"description": "Access to REST API endpoints",
"feature_privileges": [
{
"code": "rate_limit",
"name": "API Rate Limit",
"value_type": "INTEGER",
"value": 10000
},
{
"code": "endpoints",
"name": "Available Endpoints",
"value_type": "SELECT",
"value": "all",
"config": {
"select_options": [
"basic",
"standard",
"premium",
"all"
]
}
}
]
}
]
}{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "dc99e3955cdd8",
"details": [
{
"field": "/email",
"value": "abc",
"location": "body",
"issue": "INVALID_PARAMETER_VALUE",
"description": "The value of a field does not conform to the expected format."
}
]
}{
"name": "<string>",
"debug_id": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"value": "<string>",
"location": "<string>",
"issue": "<string>",
"description": "<string>"
}
]
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "90957fca61718",
"details": [
{
"field": "transaction_id",
"issue": "RESOURCE_ALREADY_EXISTS",
"description": "The resource identified by `field` already exists."
}
]
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "90957fca61718",
"details": [
{
"field": "/email",
"value": "sdfwdj@sdfs.com",
"location": "body",
"issue": "UNSUPPORTED_EMAIL",
"description": "The email provided is not supported."
}
]
}{
"name": "INTERNAL_SERVER_ERROR",
"message": "An internal server error has occurred.",
"debug_id": "90957fca61718"
}Authorizations
Use the /v1/oauth2/token endpoint to obtain an access token and pass it as a Bearer token in the Authorization header.
Path Parameters
The unique code of the plan
Body
application/json
Show child attributes
Show child attributes
Response
Entitlements created successfully
List of entitlements associated with the plan
Show child attributes
Show child attributes
Was this page helpful?
⌘I