customer_portal
Update Benefit Grant
Update a benefit grant for the authenticated customer.
Scopes: customer_portal:write
PATCH
/
v1
/
customer-portal
/
benefit-grants
/
{id}
Python
from ourpay.v2026_10 import OurPay
ourpay = OurPay("ourpay_oat_xxx")
response = ourpay.customer_portal.benefit_grants.update(
'00000000-0000-4000-8000-000000000000',
benefit_type='discord',
properties={'account_id': 'string'},
)
print(response)import { createOurPay } from "@ourpay-dev/sdk/2026-10";
const ourpay = createOurPay({
accessToken: "ourpay_oat_xxx",
});
const response = await ourpay.customerPortal.benefitGrants.update(
"00000000-0000-4000-8000-000000000000",
{
"benefit_type": "discord",
"properties": {
"account_id": "string"
}
},
);
console.log(response);
curl --request PATCH \
--url https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"benefit_type": "discord",
"properties": {
"account_id": "<string>"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({benefit_type: 'discord', properties: {account_id: '<string>'}})
};
fetch('https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'benefit_type' => 'discord',
'properties' => [
'account_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}"
payload := strings.NewReader("{\n \"benefit_type\": \"discord\",\n \"properties\": {\n \"account_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"benefit_type\": \"discord\",\n \"properties\": {\n \"account_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"benefit_type\": \"discord\",\n \"properties\": {\n \"account_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"benefit_id": "<string>",
"subscription_id": "<string>",
"order_id": "<string>",
"is_granted": true,
"is_revoked": true,
"customer": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"email": "<string>",
"email_verified": true,
"name": "<string>",
"billing_name": "<string>",
"billing_address": {
"country": "US",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"oauth_accounts": {},
"default_payment_method_id": "<string>",
"type": "individual",
"locale": "<string>"
},
"benefit": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"type": "discord",
"description": "<string>",
"selectable": true,
"deletable": true,
"is_deleted": true,
"organization_id": "<string>",
"organization": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"avatar_url": "<string>",
"proration_behavior": "invoice",
"allow_customer_updates": true
},
"properties": {
"guild_id": "<string>"
}
},
"properties": {
"account_id": "<string>",
"guild_id": "<string>",
"role_id": "<string>",
"granted_account_id": "<string>"
},
"member_id": "<string>",
"error": {
"message": "<string>",
"type": "<string>",
"timestamp": "<string>"
}
}{
"error": "NotPermitted",
"detail": "<string>"
}{
"error": "ResourceNotFound",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
customer_sessionmember_session
Customer session tokens are specific tokens that are used to authenticate customers on your organization. You can create those sessions programmatically using the Create Customer Session endpoint.
Path Parameters
The benefit grant ID.
Body
application/json
- CustomerBenefitGrantDiscordUpdate
- CustomerBenefitGrantGitHubRepositoryUpdate
- CustomerBenefitGrantDownloadablesUpdate
- CustomerBenefitGrantLicenseKeysUpdate
- CustomerBenefitGrantCustomUpdate
- CustomerBenefitGrantMeterCreditUpdate
- CustomerBenefitGrantFeatureFlagUpdate
- CustomerBenefitGrantSlackSharedChannelUpdate
Response
Benefit grant updated.
- CustomerBenefitGrantDiscord
- CustomerBenefitGrantGitHubRepository
- CustomerBenefitGrantDownloadables
- CustomerBenefitGrantLicenseKeys
- CustomerBenefitGrantCustom
- CustomerBenefitGrantMeterCredit
- CustomerBenefitGrantFeatureFlag
- CustomerBenefitGrantSlackSharedChannel
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Python
from ourpay.v2026_10 import OurPay
ourpay = OurPay("ourpay_oat_xxx")
response = ourpay.customer_portal.benefit_grants.update(
'00000000-0000-4000-8000-000000000000',
benefit_type='discord',
properties={'account_id': 'string'},
)
print(response)import { createOurPay } from "@ourpay-dev/sdk/2026-10";
const ourpay = createOurPay({
accessToken: "ourpay_oat_xxx",
});
const response = await ourpay.customerPortal.benefitGrants.update(
"00000000-0000-4000-8000-000000000000",
{
"benefit_type": "discord",
"properties": {
"account_id": "string"
}
},
);
console.log(response);
curl --request PATCH \
--url https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"benefit_type": "discord",
"properties": {
"account_id": "<string>"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({benefit_type: 'discord', properties: {account_id: '<string>'}})
};
fetch('https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'benefit_type' => 'discord',
'properties' => [
'account_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}"
payload := strings.NewReader("{\n \"benefit_type\": \"discord\",\n \"properties\": {\n \"account_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"benefit_type\": \"discord\",\n \"properties\": {\n \"account_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ourpay.dev/v1/customer-portal/benefit-grants/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"benefit_type\": \"discord\",\n \"properties\": {\n \"account_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"benefit_id": "<string>",
"subscription_id": "<string>",
"order_id": "<string>",
"is_granted": true,
"is_revoked": true,
"customer": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"email": "<string>",
"email_verified": true,
"name": "<string>",
"billing_name": "<string>",
"billing_address": {
"country": "US",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"oauth_accounts": {},
"default_payment_method_id": "<string>",
"type": "individual",
"locale": "<string>"
},
"benefit": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"type": "discord",
"description": "<string>",
"selectable": true,
"deletable": true,
"is_deleted": true,
"organization_id": "<string>",
"organization": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"avatar_url": "<string>",
"proration_behavior": "invoice",
"allow_customer_updates": true
},
"properties": {
"guild_id": "<string>"
}
},
"properties": {
"account_id": "<string>",
"guild_id": "<string>",
"role_id": "<string>",
"granted_account_id": "<string>"
},
"member_id": "<string>",
"error": {
"message": "<string>",
"type": "<string>",
"timestamp": "<string>"
}
}{
"error": "NotPermitted",
"detail": "<string>"
}{
"error": "ResourceNotFound",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}