Assign a saved card
const url = 'https://api.pingram.io/account/payment-methods/assign';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"paymentMethodId":"example","assignment":"thisAccount"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pingram.io/account/payment-methods/assign \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "paymentMethodId": "example", "assignment": "thisAccount" }'Use a saved card for this account, as the default for new accounts, or for every account that shares these cards. Only the account owner can call this.
Authorizations
Request Bodyrequired
POST /account/payment-methods/assign request.
object
Where to use a saved card. thisAccount bills this account only. newAccounts is used when you create another account. allAccounts bills every account that shares these cards and becomes the default for new accounts.
Responses
200
Successful response
GET /account/payment-methods and POST /account/payment-methods/assign response.
object
Saved card you can assign to this account or other accounts you own.
object
Card brand, such as visa or mastercard.
Card this account is billed on, when one is set.
Card new accounts you create will use by default.
How many of your accounts can use these cards, including this one.
Examplegenerated
{ "paymentMethods": [ { "id": "example", "brand": "example", "last4": "example", "expMonth": 1, "expYear": 1 } ], "thisAccountPaymentMethodId": "example", "defaultForNewAccountsPaymentMethodId": "example", "sharedAccountCount": 1}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}