Skip to content

Assign a saved card

POST
/account/payment-methods/assign
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

Media typeapplication/json

POST /account/payment-methods/assign request.

object
paymentMethodId
required
string
assignment
required

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.

string
Allowed values: thisAccount newAccounts allAccounts

Responses

200

Successful response

Media typeapplication/json

GET /account/payment-methods and POST /account/payment-methods/assign response.

object
paymentMethods
required
Array<object>

Saved card you can assign to this account or other accounts you own.

object
id
required
string
brand
required

Card brand, such as visa or mastercard.

string
last4
required
string
expMonth
required
number
expYear
required
number
thisAccountPaymentMethodId

Card this account is billed on, when one is set.

string
defaultForNewAccountsPaymentMethodId

Card new accounts you create will use by default.

string
sharedAccountCount
required

How many of your accounts can use these cards, including this one.

number
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

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

401

Unauthorized

402

Payment Required - usage limits exceeded

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

500

Internal Server Error

502

Bad Gateway - provider error

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}