Get the payment method for a subscription
GET
/api/subscriptions/{id}/payment-method
const url = 'https://api.usegro.co/api/subscriptions/example/payment-method';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.usegro.co/api/subscriptions/example/payment-methodReturns the payment method currently attached to the subscription, plus any other payment methods on file for the customer that could be switched to.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Responses
Section titled “Responses”Current payment method and available alternatives
Media typeapplication/json
object
current
required
Current payment method on the subscription, or null if none is attached
object
id
required
string
brand
required
string
last_digits
required
string
expiry_month
required
number
expiry_year
required
number
available
required
Other payment methods on file for the customer
Array<object>
object
id
required
string
brand
required
string
last_digits
required
string
expiry_month
required
number
expiry_year
required
number
Example generated
{ "current": { "id": "example", "brand": "example", "last_digits": "example", "expiry_month": 1, "expiry_year": 1 }, "available": [ { "id": "example", "brand": "example", "last_digits": "example", "expiry_month": 1, "expiry_year": 1 } ]}