# Square Online Checkout -\> APIs with Card on File

**URL:** <https://developer.squareup.com/forums/t/square-online-checkout-apis-with-card-on-file/10904>\
**Category:** Questions\
**Created:** [October 4, 2023, 3:06am UTC](https://developer.squareup.com/forums/t/square-online-checkout-apis-with-card-on-file/10904 "2023-10-04T03:06:17Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![johnblythe](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/johnblythe/32/2339_2.png) [@johnblythe](https://developer.squareup.com/forums/u/johnblythe)\
**Post date:** [October 6, 2023, 8:14pm UTC](https://developer.squareup.com/forums/t/square-online-checkout-apis-with-card-on-file/10904/15 "2023-10-06T20:14:42Z")

</div>

😕

i was using the payment id from the creation event: `jffuztfumrVLqnZCdltvEdA4njSZY`

i used that to retrieve the payment via api explorer bc the `customer_id` was not in the original payload. i got: `8ZE7FH29YD1GZDPK0WMAJ3XB04`

code would be:

```auto
const response = await client.cardsApi.createCard({
    idempotencyKey: '5303bfbf-c0e2-4423-9f74-9d239473592c',
    sourceId: 'jffuztfumrVLqnZCdltvEdA4njSZY',
    card: {
      customerId: '8ZE7FH29YD1GZDPK0WMAJ3XB04'
    }
  });

```

same error:

```auto
{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "INVALID_CARD_DATA",
      "detail": "Invalid card data.",
      "field": "source_id"
    }
  ]
}

```

---

_[View the full topic](https://developer.squareup.com/forums/t/square-online-checkout-apis-with-card-on-file/10904)._
