POST
/
v1
/
commerce_user_payment_methods
Create a commerce user payment method
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_cb646004",
  "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": "a04c08cb-32ee-4d6a-a572-7e0f759303ea",
"card_brand": "mastercard",
"card_last_4": "4444",
"card_exp_month": 12,
"card_exp_year": 2034,
"cardholder_name": "John Doe",
"created_at": "2025-09-12T22:40:54Z"
}
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
cardholder_name
string
required

The name on the card.

commerce_end_user_id
string
required

The user ID of the user in your app to associate this payment method with.

payment_method_type
string
required

The type of payment method to create. Currently, only card is supported.

interim_card_key
string
required

The key for the interim card to use for the payment method.

billing_address
object
required

Response

Commerce user payment method created

id
string
required
card_brand
string | null

Brand of the card, e.g. 'Visa' or 'Mastercard'.

card_last_4
string | null

Last 4 digits of the card number.

card_exp_month
integer | null
card_exp_year
integer | null
cardholder_name
string | null
created_at
string<date-time>

Date and time the payment method was created, ISO 8601 format.