TAG LINE
TAG LINE
SMALL TITLE

Payment Method

(API Version v7)


Defines a configured payment method for an account.


What can you do with PaymentMethod?


Properties

Property Details
identity
READ-ONLY
"identity": 5
Type: Number
This is the unique numeric identifier for the PaymentMethod
ownerId
READ-ONLY
"ownerId": 17
Type: Number
Unique identifier for the associated Owner object.
ownerName
READ-ONLY
"ownerName": "Sample Name"
Type: String
The name of the object associated with the ownerId property.
name
"name": "Corporate AMEX"
Type: String
User defined name for the Payment Method.
paymentTypeId
"paymentTypeId": 4
Type: Number
Unique identifier for the associated PaymentType object.
paymentTypeName
"paymentTypeName": "Sample Name"
Type: String
The name of the object associated with the paymentTypeId property.
accountId
"accountId": 1
Type: Number
Unique identifier for the associated Account object.
accountName
"accountName": "Sample Name"
Type: String
The name of the object associated with the accountId property.
description
"description": "This is the main corporate credit card"
Type: String
Descripton for the Payment Method.
paymentMethodIdentifier
"paymentMethodIdentifier": "Hello World"
Type: String
isActive
"isActive": true
Type: Boolean
Whether or not this payment method is available for use
autopay
"autopay": true
Type: Boolean
Whether or not this payment method should be used for automatic payments through a payment processor.
transactionToken
"transactionToken": "Hello World"
Type: String
attributes
"attributes": "Hello World"
Type: String
paymentProviderId
"paymentProviderId": 22
Type: Number
Unique identifier for the associated PaymentProvider object.
paymentProviderName
"paymentProviderName": "Sample Name"
Type: String
The name of the object associated with the paymentProviderId property.
paymentMethodToken
"paymentMethodToken": "127dfh72y3gg"
Type: String
Token for registered payment method with the payment gateway
cardExpiration
"cardExpiration": "Hello World"
Type: String


End Points

DELETEPaymentMethod/{id}
Delete an instance of the PaymentMethod object. Upon successful delete, this API will return a record of all of the related objects deleted with this operation. The specifics on which objects have been deleted will depend on which related objects have been populated in the system.
{id}Unique identifier for the PaymentMethod object.
Delete an instance of the PaymentMethod object.
DELETE PaymentMethod/{id}
View Sample Response
HTTP/1.1 200 OK
{
    "trackingId": "d2ae5304-2355-44eb-a328-272f02935f8b",
    "type": "delete",
    "results": {
        "totalCount": 4,
        "items": [
            {
                "identity": 1,
                "action": "deleted",
                "dtoTypeKey": "paymentMethod"
            },
            {
                "lhsId": 2,
                "rhsId": 2,
                "action": "detached",
                "dtoTypeKey": "sampleObjectConnector"
            },
            {
                "foreignKeyIdentity": 2,
                "action": "deleted",
                "dtoTypeKey": "sampleObject"
            }
        ]
    }
}
GETPaymentMethod/
Retrieve all of the PaymentMethod objects.
Retrieve all of the PaymentMethod objects.
GET PaymentMethod/
View Sample Response
HTTP/1.1 200 OK
{
    "trackingId": "d2ae5304-2355-44eb-a328-272f02935f8b",
    "totalCount": 1,
    "items": [
        {
            "identity": 1,
            "ownerId": 18,
            "ownerName": "Sample Text Data",
            "name": "Corporate AMEX",
            "paymentTypeId": 14,
            "paymentTypeName": "Sample Text Data",
            "accountId": 1,
            "accountName": "Sample Text Data",
            "description": "This is the main corporate credit card",
            "paymentMethodIdentifier": "Sample Text Data",
            "isActive": true,
            "autopay": true,
            "transactionToken": "Sample Text Data",
            "attributes": "Sample Text Data",
            "paymentProviderId": 11,
            "paymentProviderName": "Sample Text Data",
            "paymentMethodToken": "127dfh72y3gg",
            "cardExpiration": "Sample Text Data"
        }
    ]
}
GETPaymentMethod/Paged
Retrieve all of the PaymentMethod objects in a paged fashion. This endpoint implements pagination for its results. Individual pages can be requested to return a particular paged set in the list of results. To learn more, see details on working with paginated endpoints.
Retrieve all of the PaymentMethod objects in a paged fashion.
GET PaymentMethod/Paged
View Sample Response
HTTP/1.1 200 OK
{
    "trackingId": "d2ae5304-2355-44eb-a328-272f02935f8b",
    "pagination": {
        "pageNumber": 1,
        "pageSize": 20,
        "excludeTotalCount": false
    },
    "pagedResults": {
        "totalCount": 1,
        "items": [
            {
                "identity": 1,
                "ownerId": 21,
                "ownerName": "Sample Text Data",
                "name": "Corporate AMEX",
                "paymentTypeId": 23,
                "paymentTypeName": "Sample Text Data",
                "accountId": 18,
                "accountName": "Sample Text Data",
                "description": "This is the main corporate credit card",
                "paymentMethodIdentifier": "Sample Text Data",
                "isActive": true,
                "autopay": true,
                "transactionToken": "Sample Text Data",
                "attributes": "Sample Text Data",
                "paymentProviderId": 18,
                "paymentProviderName": "Sample Text Data",
                "paymentMethodToken": "127dfh72y3gg",
                "cardExpiration": "Sample Text Data"
            }
        ]
    }
}
GETPaymentMethod/{id}
Retrieve an instance of the PaymentMethod object by its ID.
{id}Unique identifier for the PaymentMethod object.
Retrieve an instance of the PaymentMethod object by its ID.
GET PaymentMethod/{id}
View Sample Response
HTTP/1.1 200 OK
{
    "trackingId": "d2ae5304-2355-44eb-a328-272f02935f8b",
    "instance": {
        "identity": 1,
        "ownerId": 6,
        "ownerName": "Sample Text Data",
        "name": "Corporate AMEX",
        "paymentTypeId": 26,
        "paymentTypeName": "Sample Text Data",
        "accountId": 27,
        "accountName": "Sample Text Data",
        "description": "This is the main corporate credit card",
        "paymentMethodIdentifier": "Sample Text Data",
        "isActive": true,
        "autopay": true,
        "transactionToken": "Sample Text Data",
        "attributes": "Sample Text Data",
        "paymentProviderId": 0,
        "paymentProviderName": "Sample Text Data",
        "paymentMethodToken": "127dfh72y3gg",
        "cardExpiration": "Sample Text Data"
    }
}
POSTPaymentMethod/BankAccount
Create a Debit type of PaymentMethod.
POSTPaymentMethod/CreditCard
Create a Credit Card type of Payment Method. Used in conjunction with the Spreedly Hosted Payment Page that will tokenize the card info for PCI compliance.
POSTPaymentMethod/Import
Used to Import PaymentMethod objects that have already been created and persisted in Spreedly.
POSTPaymentMethod/Import/Sync
Used to Import PaymentMethod objects that have already been created and persisted in Spreedly.
Used to Import PaymentMethod objects that have already been created and persisted in Spreedly.
POST PaymentMethod/Import/Sync

{
    "name": "Corporate AMEX",
    "paymentTypeId": 10,
    "accountId": 26,
    "description": "This is the main corporate credit card",
    "paymentMethodIdentifier": "Sample Text Data",
    "isActive": true,
    "autopay": true,
    "transactionToken": "Sample Text Data",
    "attributes": "Sample Text Data",
    "paymentProviderId": 9,
    "paymentMethodToken": "127dfh72y3gg",
    "cardExpiration": "Sample Text Data"
}
View Sample Response
HTTP/1.1 200 OK
{
    "trackingId": "d2ae5304-2355-44eb-a328-272f02935f8b",
    "type": "create",
    "results": {
        "totalCount": 1,
        "items": [
            {
                "identity": 1,
                "ownerId": 23,
                "ownerName": "Sample Text Data",
                "name": "Corporate AMEX",
                "paymentTypeId": 0,
                "paymentTypeName": "Sample Text Data",
                "accountId": 7,
                "accountName": "Sample Text Data",
                "description": "This is the main corporate credit card",
                "paymentMethodIdentifier": "Sample Text Data",
                "isActive": true,
                "autopay": true,
                "transactionToken": "Sample Text Data",
                "attributes": "Sample Text Data",
                "paymentProviderId": 20,
                "paymentProviderName": "Sample Text Data",
                "paymentMethodToken": "127dfh72y3gg",
                "cardExpiration": "Sample Text Data"
            }
        ]
    }
}
POSTPaymentMethod/{id}/SetAsDefault
Sets the 'AutoPay' to be true for the specified Payment Method. This will automatically turn off 'AutoPay' on any other PaymentMethod for the account. Setting the 'Default' enables AutoPay for the account during billing. It will also present itself as a default payment method in the dropdown list in the Customer Portal.
{id}Unique identifier for the PaymentMethod object.
PUTPaymentMethod/{id}
Update an existing instance of the PaymentMethod object.
Update an existing instance of the PaymentMethod object.
PUT PaymentMethod/{id}

{
    "identity": 1,
    "name": "Corporate AMEX",
    "paymentTypeId": 7,
    "accountId": 4,
    "description": "This is the main corporate credit card",
    "paymentMethodIdentifier": "Sample Text Data",
    "isActive": true,
    "autopay": true,
    "transactionToken": "Sample Text Data",
    "attributes": "Sample Text Data",
    "paymentProviderId": 25,
    "paymentMethodToken": "127dfh72y3gg",
    "cardExpiration": "Sample Text Data"
}
View Sample Response
HTTP/1.1 200 OK
{
    "trackingId": "d2ae5304-2355-44eb-a328-272f02935f8b",
    "type": "update",
    "results": {
        "totalCount": 1,
        "items": [
            {
                "identity": 1,
                "ownerId": 8,
                "ownerName": "Sample Text Data",
                "name": "Corporate AMEX",
                "paymentTypeId": 18,
                "paymentTypeName": "Sample Text Data",
                "accountId": 10,
                "accountName": "Sample Text Data",
                "description": "This is the main corporate credit card",
                "paymentMethodIdentifier": "Sample Text Data",
                "isActive": true,
                "autopay": true,
                "transactionToken": "Sample Text Data",
                "attributes": "Sample Text Data",
                "paymentProviderId": 9,
                "paymentProviderName": "Sample Text Data",
                "paymentMethodToken": "127dfh72y3gg",
                "cardExpiration": "Sample Text Data"
            }
        ]
    }
}