Create Shopify Customer Object with Stripe Customer Token

Highlighted
New Member
1 0 0

We are looking to create a Shopify Customer using the the following API and would like to include the Stripe Customer Token that we have already generated so that the customer would be able to use the card they have already entered on subsequent transactions.  We are looking for something like this.  Does anyone know if this is possible, and if so what the correct syntax would be?

 

https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2020-01

POST /admin/api/2020-01/customers.json
{
      "customer": {
      "first_name": "Steve",
      "last_name": "Lastnameson",
      "email": "steve.lastnameson@example.com",
      "phone": "+15142546011",
      "token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "gateway": "stripe",
      "verified_email": true,
      "addresses": [
      {
          "address1": "123 Oak St",
          "city": "Ottawa",
          "province": "ON",
          "phone": "555-1212",
          "zip": "123 ABC",
          "last_name": "Lastnameson",
          "first_name": "Mother",
          "country": "CA"
     }]
}
}

0 Likes
Highlighted
Shopify Partner
52 5 21

This is an incredibly specific feature you're asking for. Unless you have written the logic of displaying known cards for this customer, it will not be possible. So you will need a custom checkout/paymentmethod for this.

 

If you do have a custom checkout. You can store the stripe token in a metafield, and recover the known cards in your own checkout app.

0 Likes