简体   繁体   中英

Square Insufficient permissions to set app_fee_money when creating a payment

  1. I used Square Oauth to obtain merchant_access_token using the scopes
CUSTOMERS_WRITE
CUSTOMERS_READ
ITEMS_WRITE
ITEMS_READ
MERCHANT_PROFILE_WRITE
MERCHANT_PROFILE_READ
ORDERS_WRITE+ORDERS_READ
PAYMENTS_WRITE
PAYMENTS_READ
PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS

from https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees

When I run the command, I get Insufficient permissions to set app_fee_money

I tried this from both the Application as well as Postman

What am I doing wrong?

curl --location --request POST 'https://connect.squareupsandbox.com/v2/payments' \
--header 'Square-Version: 2021-01-21' \
--header 'Authorization: Bearer merchant_access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "source_id": "ccof:customer-card-id-ok",
    "idempotency_key": "6726cbd2-7893-4cc3-908e-c54731e9f1fe77979",
    "amount_money": {
        "amount": 5000,
        "currency": "USD"
    },
    "app_fee_money": {
        "amount": 1220,
        "currency": "USD"
    },
    "customer_id": "676YFJE8CCRPZ2K7F9C155JYP8",
    "location_id": "LG5CC4T0JXCX9", //Merchant location id
    "order_id": "M4C0LcxaW6DNpbyxE7sLypvbFA8zb4F",
    "reference_id": "M4C0LcxaW6DNpbyxE7sLypvbFA8zb4F",
    "statement_description_identifier": "Organization name",
    "note": "Fee note"
}'

PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS was in the code but older version of scopes without it was running, that fixed it. Thanks @sjosey

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM