# Is there a log of all the API calls triggered?

**URL:** <https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665>\
**Category:** Questions\
**Tags:** sandbox, sdk\
**Created:** [September 23, 2021, 9:40pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665 "2021-09-23T21:40:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![user2928398](https://avatars.discourse-cdn.com/v4/letter/u/4bbf92/32.png) [@user2928398](https://developer.squareup.com/forums/u/user2928398)\
**Post date:** [September 23, 2021, 9:40pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/1 "2021-09-23T21:40:14Z")

</div>

Hello,  
I’m going through the quick start program here:

> **[Take a Card Payment with Web Payments SDK](https://developer.squareup.com/docs/web-payments/take-card-payment)**
>
> Learn how to take card payments in a web client with the Web Payments SDK.

Is there anywhere in the developer dashboard where I can check a log of which API calls were triggered with my program?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [September 23, 2021, 11:06pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/2 "2021-09-23T23:06:45Z")

</div>

Yes, you can view [API Logs](https://developer.squareup.com/docs/get-started/view-log) of all API calls your application makes. 🙂

---

<div class="post-metadata">

**Author:** ![JD.net](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@JD.net](https://developer.squareup.com/forums/u/JD.net)\
**Post date:** [March 16, 2023, 10:08am UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/3 "2023-03-16T10:08:15Z")

</div>

Hi I’m getting this response: {  
“errors”: [  
{  
“category”: “INVALID\_REQUEST\_ERROR”,  
“code”: “INVALID\_VALUE”,  
“detail”: “This merchant can only process payments in GBP, but amount was provided in USD.”,  
“field”: “amount\_money.currency”  
}  
]  
}

using:  
async function createPayment(token) {  
const body = JSON.stringify({  
locationId,  
sourceId: token,  
amount: 200,  
currencyCode: ‘GBP’,  
});

```
        const paymentResponse = await fetch('/payment', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body,
        });

        if (paymentResponse.ok) {
            return paymentResponse.json();
        }

        const errorBody = await paymentResponse.text();
        throw new Error(errorBody);
    }

```

Could you guide me in the right direction. Many thanks.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [March 16, 2023, 4:23pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/4 "2023-03-16T16:23:48Z")

</div>

@JD.net, The function `/payment` is in the server.js file of our Quickstart. In that file you’ll need to change the currency from `USD` to `GBP`. 🙂

---

<div class="post-metadata">

**Author:** ![JD.net](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@JD.net](https://developer.squareup.com/forums/u/JD.net)\
**Post date:** [March 16, 2023, 8:35pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/5 "2023-03-16T20:35:37Z")

</div>

Thanks, this works great. by the way how can I add cents as is only accepting integer value.

```auto
  "errors": [
    {
      "code": "EXPECTED_INTEGER",
      "detail": "Expected an integer value (line 1, character 117)",
      "field": "amount_money.amount",
      "category": "INVALID_REQUEST_ERROR"
    }

```

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [March 16, 2023, 9:02pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/6 "2023-03-16T21:02:06Z")

</div>

When working with the [Money](https://developer.squareup.com/reference/square/objects/Money) object, applications might get an `EXPECTED_INTEGER` error code because the specified `amount` value is invalid. It indicates that Square was expecting information as an integer but was sent something else (for example, a string or a float). To resolve this error:

- Make sure the `amount` value is specified in the smallest denomination of the currency used. For example, the smallest currency denomination for USD is cents.
- Make sure the `amount` value is specified as a positive integer.
- Make sure the `amount` value is greater than, or equal to, the valid minimum amount. Valid minimums are determined by the `Location.country` associated with the account:
  - **The United States and Canada.** `amount` values must be integers greater than or equal to 1.
  - **Australia, Japan, and the United Kingdom.** `amount` values must be integers greater than or equal to 100.  
🙂

---

<div class="post-metadata">

**Author:** ![JD.net](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@JD.net](https://developer.squareup.com/forums/u/JD.net)\
**Post date:** [March 17, 2023, 10:37am UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/7 "2023-03-17T10:37:26Z")

</div>

Thank you for this information, so if someone adds to my shopping car 2 products one costing: 7,20 GBP and the other one costing 8 GBP, the total for the client to pay would be: 15,20 so to charge 15,20 GBP its not possible, therefore I have to charge only 15 GBP?. Thanks.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [March 17, 2023, 3:57pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/8 "2023-03-17T15:57:43Z")

</div>

You can charge £15.20. You’ll just pass the amount 152000 when you call `CreatePayment`. 🙂

---

<div class="post-metadata">

**Author:** ![JD.net](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@JD.net](https://developer.squareup.com/forums/u/JD.net)\
**Post date:** [March 17, 2023, 4:39pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/9 "2023-03-17T16:39:51Z")

</div>

Thanks for your support, could you guide me further as this is not giving me the correct response.  
server.js:  
amountMoney: {  
// the expected amount is in cents, meaning this is $1.00.  
amount: ‘152000’,  
// If you are a non-US account, you must change the currency to match the country in which  
// you are accepting the payment.  
currency: ‘GBP’,  
},  
};

card.html:  
async function createPayment(token) {  
const body = JSON.stringify({  
locationId,  
sourceId: token,  
amount: ‘152000’,  
});  
my response:

```auto
  "payment": {
    "id": "TP15ECTb4aXEvmtvz26K5iS0X1XZY",
    "created_at": "2023-03-17T16:34:07.624Z",
    "updated_at": "2023-03-17T16:34:07.855Z",
    "amount_money": {
      "amount": 152000,
      "currency": "GBP"
    },
    "total_money": {
      "amount": 152000,
      "currency": "GBP"
    },
    "approved_money": {
      "amount": 152000,
      "currency": "GBP"
    },

```

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [March 17, 2023, 5:37pm UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/10 "2023-03-17T17:37:07Z")

</div>

With Square the amount will always be shown in cents with the responses from our APIs. So `152000` is £15.20. 🙂

---

<div class="post-metadata">

**Author:** ![JD.net](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@JD.net](https://developer.squareup.com/forums/u/JD.net)\
**Post date:** [March 18, 2023, 12:58am UTC](https://developer.squareup.com/forums/t/is-there-a-log-of-all-the-api-calls-triggered/3665/11 "2023-03-18T00:58:52Z")

</div>

Hi,  
Thanks for letting me know! It’s good to be aware that with Square’s APIs, the amounts are always shown in cents. I appreciate you clarifying that 152000 would represent £15.20.  
Thank you once again for all your support. 🙂
