POST
/
v1
/
commerce_user_payment_methods
curl --request POST \
  --url https://api.ongoody.com/v1/commerce_user_payment_methods \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "cardholder_name": "John Doe",
  "commerce_end_user_id": "test_user_pm_b69ad146",
  "payment_method_type": "card",
  "interim_card_key": "X9edbacqt1CBCRRKRLkuiINj",
  "billing_address": {
    "address_1": "123 Main St",
    "address_2": "Apt 4B",
    "city": "New York",
    "state": "NY",
    "postal_code": "10001",
    "country": "US"
  }
}'
{
"id": "18505d94-1fa2-4b87-955a-9e4253773fd3",
"card_brand": "mastercard",
"card_last_4": "4444",
"card_exp_month": 12,
"card_exp_year": 2034,
"cardholder_name": "John Doe",
"created_at": "2025-05-18T05:07:20Z"
}

Only for the Commerce API.

Apps using the Commerce API can embed Goody’s credit card form into their application to allow the app’s end users to enter their credit card to save a payment method. Users can then use that payment method to pay for orders.

Call this endpoint to create a payment method associated with a commerce user; provide the user ID as commerce_end_user_id. Then, use the returned payment method id as the payment_method_id in the Create an Order Batch endpoint along with the commerce_end_user_id.

For more information, refer to Embedded Payment Form.

Authorizations

Authorization
string
header
required

Your Goody API key.

Body

application/json

Response

201
application/json

Commerce user payment method created

The response is of type object.