Tham Chiếu Permissions

Stripe Apps sử dụng hệ thống quyền để kiểm soát quyền truy cập vào các tài nguyên Stripe API. Mỗi quyền phải được khai báo rõ ràng trong app manifest với mục đích rõ ràng. Người dùng phê duyệt các quyền này khi cài đặt app.

Quản Lý Permissions

Khai Báo Permissions

Thêm permissions vào manifest stripe-app.json:

{
"permissions": [
{
"permission": "customer_read",
"purpose": "Read customer profiles to sync with Brevo contacts"
},
{
"permission": "customer_write",
"purpose": "Update customer metadata with Brevo sync status"
}
]
}

Cấp Permissions Qua CLI

Trong quá trình phát triển, bạn có thể cấp permissions bằng Stripe CLI:

Terminal window
# Cấp một quyền cụ thể
stripe apps grant permission "customer_read" \
--purpose "Read customer profiles to sync with Brevo contacts"
# Cấp nhiều quyền
stripe apps grant permission "charge_read" \
--purpose "Access payment data for event tracking"
stripe apps grant permission "event_read" \
--purpose "Subscribe to real-time Stripe events"

Thực Hành Tốt Về Permissions

  • Tối thiểu cần thiết: Chỉ yêu cầu quyền mà app thực sự sử dụng
  • Mục đích rõ ràng: Viết mục đích mà người dùng không chuyên kỹ thuật có thể hiểu
  • Biện minh cho read+write: Nếu cần cả đọc và ghi, hãy giải thích lý do trong mỗi mục đích
  • Xem xét thường xuyên: Xóa các quyền không còn cần thiết khi cập nhật app

Tip

Yêu cầu quá nhiều quyền là một trong những lý do phổ biến nhất khiến app bị từ chối. Chỉ yêu cầu những gì bạn cần.

Permissions Theo Sản Phẩm

Core

Tài NguyênPermissionMô Tả
Accountaccount_readĐọc chi tiết và cài đặt tài khoản
Accountaccount_writeCập nhật cài đặt tài khoản
Balancebalance_readXem số dư và giao dịch tài khoản
Customercustomer_readĐọc hồ sơ khách hàng, metadata và phương thức thanh toán
Customercustomer_writeTạo, cập nhật hoặc xóa hồ sơ khách hàng
Eventevent_readĐọc và đăng ký sự kiện tài khoản
Filefile_readĐọc các file đã tải lên và liên kết file
Filefile_writeTải file lên và tạo liên kết file
Mandatemandate_readĐọc ủy quyền thanh toán
Productproduct_readĐọc danh mục sản phẩm và giá
Productproduct_writeTạo, cập nhật hoặc xóa sản phẩm và giá
Tokentoken_readĐọc dữ liệu thanh toán đã tokenize
Webhook Endpointwebhook_endpoint_readĐọc cấu hình webhook endpoint
Webhook Endpointwebhook_endpoint_writeTạo, cập nhật hoặc xóa webhook endpoints

Thanh Toán

Tài NguyênPermissionMô Tả
Chargecharge_readĐọc charges và refunds
Chargecharge_writeTạo charges, capture payments, phát hành refunds
Disputedispute_readĐọc tranh chấp và bằng chứng
Disputedispute_writeGửi bằng chứng tranh chấp và phản hồi
Payment Intentpayment_intent_readĐọc chi tiết và trạng thái payment intent
Payment Intentpayment_intent_writeTạo, xác nhận hoặc hủy payment intents
Payment Methodpayment_method_readĐọc các phương thức thanh toán đã lưu
Payment Methodpayment_method_writeĐính kèm hoặc tách phương thức thanh toán khỏi khách hàng
Payoutpayout_readĐọc chi tiết và lịch payout
Payoutpayout_writeTạo hoặc hủy payouts
Refundrefund_readĐọc chi tiết refund
Refundrefund_writeTạo hoặc cập nhật refunds
Setup Intentsetup_intent_readĐọc chi tiết setup intent
Setup Intentsetup_intent_writeTạo hoặc xác nhận setup intents

Thanh Toán Định Kỳ

Tài NguyênPermissionMô Tả
Couponcoupon_readĐọc coupon giảm giá và mã khuyến mãi
Couponcoupon_writeTạo, cập nhật hoặc xóa coupons
Credit Notecredit_note_readĐọc credit notes
Credit Notecredit_note_writeTạo hoặc vô hiệu hóa credit notes
Invoiceinvoice_readĐọc chi tiết hóa đơn, mục hàng và trạng thái
Invoiceinvoice_writeTạo, cập nhật, hoàn thiện hoặc hủy hóa đơn
Invoice Iteminvoice_item_readĐọc các mục hóa đơn đang chờ
Invoice Iteminvoice_item_writeTạo hoặc xóa mục hóa đơn
Planplan_readĐọc subscription plans và giá
Planplan_writeTạo, cập nhật hoặc xóa plans
Priceprice_readĐọc cấu hình giá
Priceprice_writeTạo hoặc cập nhật giá
Quotequote_readĐọc báo giá
Quotequote_writeTạo, hoàn thiện hoặc chấp nhận báo giá
Subscriptionsubscription_readĐọc chi tiết, lịch và trạng thái đăng ký
Subscriptionsubscription_writeTạo, cập nhật hoặc hủy đăng ký
Subscription Schedulesubscription_schedule_readĐọc lịch đăng ký
Subscription Schedulesubscription_schedule_writeTạo, cập nhật hoặc giải phóng lịch đăng ký
Usage Recordusage_record_readĐọc bản ghi sử dụng billing theo đồng hồ
Usage Recordusage_record_writeTạo bản ghi sử dụng cho billing theo đồng hồ

Checkout

Tài NguyênPermissionMô Tả
Checkout Sessioncheckout_session_readĐọc chi tiết Checkout Session và mục hàng
Checkout Sessioncheckout_session_writeTạo hoặc hết hạn Checkout Sessions
Payment Linkpayment_link_readĐọc cấu hình Payment Link
Payment Linkpayment_link_writeTạo hoặc cập nhật Payment Links

Connect

Tài NguyênPermissionMô Tả
Application Feeapplication_fee_readĐọc chi tiết application fee
Connected Accountconnected_account_readĐọc chi tiết tài khoản connected
Connected Accountconnected_account_writeTạo hoặc cập nhật tài khoản connected
Transfertransfer_readĐọc chi tiết transfer giữa các tài khoản
Transfertransfer_writeTạo transfers đến tài khoản connected
Top-uptopup_readĐọc chi tiết top-up
Top-uptopup_writeTạo top-ups cho Stripe balance

Issuing

Tài NguyênPermissionMô Tả
Issuing Cardissuing_card_readĐọc chi tiết thẻ đã phát hành
Issuing Cardissuing_card_writeTạo, cập nhật hoặc vô hiệu hóa thẻ đã phát hành
Issuing Cardholderissuing_cardholder_readĐọc thông tin chủ thẻ
Issuing Cardholderissuing_cardholder_writeTạo hoặc cập nhật chủ thẻ
Issuing Transactionissuing_transaction_readĐọc chi tiết giao dịch thẻ
Issuing Authorizationissuing_authorization_readĐọc yêu cầu ủy quyền
Issuing Authorizationissuing_authorization_writePhê duyệt hoặc từ chối yêu cầu ủy quyền
Issuing Disputeissuing_dispute_readĐọc tranh chấp issuing
Issuing Disputeissuing_dispute_writeTạo hoặc gửi tranh chấp issuing

Báo Cáo

Tài NguyênPermissionMô Tả
Report Runreport_run_readĐọc kết quả report run
Report Runreport_run_writeTạo report runs mới
Report Typereport_type_readĐọc các loại báo cáo có sẵn

Thuế

Tài NguyênPermissionMô Tả
Tax Calculationtax_calculation_readĐọc kết quả tính thuế
Tax Calculationtax_calculation_writeTạo tính thuế
Tax Ratetax_rate_readĐọc cấu hình thuế suất
Tax Ratetax_rate_writeTạo hoặc cập nhật thuế suất
Tax Registrationtax_registration_readĐọc chi tiết đăng ký thuế

Terminal

Tài NguyênPermissionMô Tả
Terminal Readerterminal_reader_readĐọc chi tiết terminal reader
Terminal Readerterminal_reader_writeĐăng ký hoặc cập nhật terminal readers
Terminal Locationterminal_location_readĐọc chi tiết vị trí terminal
Terminal Locationterminal_location_writeTạo hoặc cập nhật vị trí terminal

Secret Store

Tài NguyênPermissionMô Tả
Secretsecret_readĐọc secrets từ Secret Store
Secretsecret_writeTạo, cập nhật hoặc xóa secrets

Permissions Được Khuyến Nghị Cho Tích Hợp Tajo Brevo

Đối với app tích hợp Tajo Brevo, đây là các permissions được khuyến nghị:

{
"permissions": [
{
"permission": "customer_read",
"purpose": "Sync customer profiles and contact information to Brevo"
},
{
"permission": "customer_write",
"purpose": "Store Brevo contact ID and sync status on customer metadata"
},
{
"permission": "charge_read",
"purpose": "Track purchase events and revenue data for Brevo analytics"
},
{
"permission": "product_read",
"purpose": "Sync product catalog to Brevo for personalized email campaigns"
},
{
"permission": "event_read",
"purpose": "Listen to real-time events to trigger Brevo automation workflows"
},
{
"permission": "invoice_read",
"purpose": "Track invoice events for transactional emails via Brevo"
},
{
"permission": "subscription_read",
"purpose": "Monitor subscription lifecycle for Brevo retention campaigns"
},
{
"permission": "secret_write",
"purpose": "Securely store Brevo API credentials in Stripe Secret Store"
},
{
"permission": "secret_read",
"purpose": "Retrieve stored Brevo API credentials for data sync operations"
},
{
"permission": "webhook_endpoint_write",
"purpose": "Register webhook endpoints for real-time event delivery to Tajo"
}
]
}

Phạm Vi Permissions

Permissions có thể hoạt động ở các phạm vi khác nhau tùy thuộc vào việc app của bạn được cài đặt trên tài khoản nền tảng hay tài khoản connected:

Phạm ViMô Tả
AccountPermissions áp dụng cho dữ liệu riêng của tài khoản cài đặt
Connected AccountĐối với Connect platforms, permissions có thể mở rộng đến tài khoản connected

Caution

Khi yêu cầu write permissions, hãy chuẩn bị giải thích trong quá trình xem xét app chính xác cách và khi nào app của bạn sửa đổi dữ liệu. Các write permissions không cần thiết là lý do phổ biến để bị từ chối.

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

Trợ lý AI

Xin chào! Hãy hỏi tôi về tài liệu.

Bắt đầu miễn phí với Brevo