App fee error on Terminal Checkout API

We received this error when we try to set app_fee_money on create terminal checkout API:

{
  "errors": [
    {
      "code": "BAD_REQUEST",
      "detail": "cannot specify for this account: target and source accounts are the same",
      "field": "checkout.app_fee_money",
      "category": "INVALID_REQUEST_ERROR"
    }
  ]
}

:wave: With app_fee_money and Terminal API you can’t collect a fee from yourself. You’ll need to OAuth to another Square account to collect a fee from payments with Terminal API on that account. :slightly_smiling_face:

Is it the Terminal API’s specific restriction? We collected the app fee on Reader SDK.

You collect a fee from your own account payments?

Yeah, it works well on our Reader SDK integration.

Okay, let me reach out to the team about this. :slightly_smiling_face:

1 Like

Also, I’ve tried collect app fee in your suggest case, it didn’t throw the previous error, but it failed after the tip page, shows

And when I remove the app fee from the API, the payment succeed.

Solution.

If you are collecting appFee for yourself, set appFee as 0 amount as 0L (0 as long amount, ex: c#). There will be no error. You can check merchantId to adjust this. If you are doing self-appFee, set appFee to 0, otherwise set appFee for other merchants using your ‘set’ appFee method (set by you). This works fine.

However, in case you need refund on terminalCheckout EVEN with appFee of 0L (for self-appFee), you will get error again. → When you need to refund on terminalChecout for yourself, do not pass appFee. This will guarantee to avoid any error message.

Any update from the tech team?

Still working with the team on this. :slightly_smiling_face:

Not sure, why the Square Team need to see this. I already provided solution.

Here is the solution again.

If you are collecting appFee for yourself, set appFee as 0 amount as 0L (0 as long amount, ex: c#), and pass appFee (0 as you see) to Square. There will be no error at all.

There is no need to collect appFee for yourself, so the appFee is 0 for self-appFee.
There will be no error at all for TerminalCheckOut by passing 0 appFee for self-appFee on terminalCheckout API.

You can check merchant ID to verify this is ‘self-appFee.’ Check merchant ID, if merchant ID is your account or not. If is your account, it IS ‘self-appFee’ action, if NOT, it will be processed with ‘appFee.’

If you are doing self-appFee, SET appFee AS 0, otherwise set appFee for other merchants, using your ‘set’ appFee (set by you) for ‘APPLICATION FEE.’ This works fine.

However, in case you need refund on terminalCheckOut, EVEN with appFee of 0L (for self-appFee), you will get error again. → When you need to refund on terminalCheckOut on follow up on any reason, do NOT pass appFee for self-appFee.

Read carefully, you can refund card transaction, using PAYMENT API, NOT by terminalCheckOut API. This is out of topic here. I am just providing for reference.

You have NEVER ‘COLLECTED’ appFee for ‘self-appFee’ on terminalCheckOut as you see above. There is no need to pass ‘appFee’ on refund using Payment API when the initial transaction is ‘self’ transaction without appFee. Just do not pass appFee on refund if transaction was created by ‘self.’

This will guarantee 0 error message.

I am done, I don’t know what else I can help on this case.

Hi,
when we are passing app_fee_money from terminal API getting below errors …

{
“code”: “INVALID_LOCATION”,
“detail”: “app_fee_money is not supported in the merchant’s location (AU)”,
“field”: “checkout.app_fee_money”,
“category”: “PAYMENT_METHOD_ERROR”
}

request

{
“checkout”: {
“device_options”: {
“device_id”: “118CS145A5000862”
},
“amount_money”: {
“amount”: 2000,
“currency”: “USD”
},
“app_fee_money”: {
“currency”: “USD”,
“amount”: 200
},
“payment_type”: “CARD_PRESENT”,
“note”: “cygen”,
“customer_id”: “”
},
“idempotency_key”: “856c6bf2-fec4-45f3-8a2f-fa8ab13ee332”
}

response

{
“errors”: [
{
“code”: “BAD_REQUEST”,
“detail”: “invalid currency for merchant”,
“field”: “amount_money.currency”,
“category”: “INVALID_REQUEST_ERROR”
},
{
“code”: “INVALID_LOCATION”,
“detail”: “app_fee_money is not supported in the merchant’s location (AU)”,
“field”: “checkout.app_fee_money”,
“category”: “PAYMENT_METHOD_ERROR”
}
]
}

At this time app_fee_money isn’t currently supported in AU for the Terminal API. We’re constantly working to improve our features based on feedback like this and hope to have more soon. :slightly_smiling_face: