Create a payment using 'shared cards' gets 'Payment on file not found' error

I’m using Shared Card on File to make a payment in different merchant accounts,
I search for a customer or create one and I use search-customers and if the user already exist in the seller account I got this response

{"billingAddress":{"postalCode":"33000"},"cardBrand":"MASTERCARD","expMonth":"1","expYear":"2028","id":"ccof:CA1SEJ_j7rlPQSmcJP9k6AN_5LYoPR","last4":"4065"}],"createdAt":"2023-10-26T05:16:49.41Z","creationSource":"THIRD_PARTY","emailAddress":"[email protected]","givenName":"Test","id":"QQ8AT623CRDW1J64KM86WH941W","note":"ccof:CA1SEERe4cfvZDKAA1XGwPo1JkUoPR","preferences":{"emailUnsubscribed":false},"segmentIds":["MLTH1N02JW1SG.CARDS_ON_FILE","MLTHN02JW1SG.CHURN_RISK","MLTCHN02JW1SG.REACHABLE","gv2:864Z0ERRS93KF5N0R2NX0A3910"],"updatedAt":"2023-10-26T09:10:56Z","version":"2"}

then I call create a payment

const response = await client.paymentsApi.createPayment({
    sourceId: 'ccof:uIbfJXhXETSP197M3GB', //--?
    idempotencyKey: '{UNIQUE_KEY}',
    amountMoney: {
      amount: 200,
      currency: 'USD'
    autocomplete: true,
    customerId: '{CUSTOMER_ID_FROM_SELLER}',
    locationId: 'XK3DBG77NJBFX',
    referenceId: '123456'

what source ID should I use? because I got back 3 different source IDs ‘ccof’ if I use the original one from the main account I got ‘Payment on file not found’
How shared cards works? and how can I match the correct payment source ID from when the user select a card on file in the app to the res api client swap to specific location ID and merchant ID seller access token to share the card on file and then create a payment with the correct source ID?

The source_id you’ll use when charging a shared card on file is going to be the one you saved on the main account. Any of the other cards on file won’t work when charging the card on file. If your getting that error whats the main account merchant_id, location_id of the account you want to charge and the customer_id on the main account that has the card saved to it. :slightly_smiling_face:

1 Like