TAG LINE
TAG LINE
SMALL TITLE

Payment Method

(API Version v10)


Defines a configured payment method for an account.


What can you do with PaymentMethod?


Properties

Property Details
identity
READ-ONLY
"identity": 27
Type: Number
This is the unique numeric identifier for the PaymentMethod
ownerId
READ-ONLY
"ownerId": 19
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": 10
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": 26
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": "XXXX-XXXX-XXXX-1111"
Type: String
The identifying number of the payment method e.g. credit card number.
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": "WuJNFtr3HYNWHAVKvflOhOT2JCF"
Type: String
Token for that transaction.
attributes
"attributes": "Hello World"
Type: String
TBC
paymentProviderId
"paymentProviderId": 17
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
TBC.


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": 19,
            "ownerName": "Sample Text Data",
            "name": "Corporate AMEX",
            "paymentTypeId": 2,
            "paymentTypeName": "Sample Text Data",
            "accountId": 1,
            "accountName": "Sample Text Data",
            "description": "This is the main corporate credit card",
            "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
            "isActive": true,
            "autopay": true,
            "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
            "attributes": "Sample Text Data",
            "paymentProviderId": 3,
            "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": 1,
                "ownerName": "Sample Text Data",
                "name": "Corporate AMEX",
                "paymentTypeId": 9,
                "paymentTypeName": "Sample Text Data",
                "accountId": 6,
                "accountName": "Sample Text Data",
                "description": "This is the main corporate credit card",
                "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
                "isActive": true,
                "autopay": true,
                "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
                "attributes": "Sample Text Data",
                "paymentProviderId": 27,
                "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": 18,
        "ownerName": "Sample Text Data",
        "name": "Corporate AMEX",
        "paymentTypeId": 27,
        "paymentTypeName": "Sample Text Data",
        "accountId": 26,
        "accountName": "Sample Text Data",
        "description": "This is the main corporate credit card",
        "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
        "isActive": true,
        "autopay": true,
        "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
        "attributes": "Sample Text Data",
        "paymentProviderId": 20,
        "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": 25,
    "accountId": 0,
    "description": "This is the main corporate credit card",
    "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
    "isActive": true,
    "autopay": true,
    "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
    "attributes": "Sample Text Data",
    "paymentProviderId": 1,
    "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": 10,
                "ownerName": "Sample Text Data",
                "name": "Corporate AMEX",
                "paymentTypeId": 4,
                "paymentTypeName": "Sample Text Data",
                "accountId": 25,
                "accountName": "Sample Text Data",
                "description": "This is the main corporate credit card",
                "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
                "isActive": true,
                "autopay": true,
                "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
                "attributes": "Sample Text Data",
                "paymentProviderId": 27,
                "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": 26,
    "accountId": 6,
    "description": "This is the main corporate credit card",
    "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
    "isActive": true,
    "autopay": true,
    "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
    "attributes": "Sample Text Data",
    "paymentProviderId": 5,
    "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": 13,
                "ownerName": "Sample Text Data",
                "name": "Corporate AMEX",
                "paymentTypeId": 27,
                "paymentTypeName": "Sample Text Data",
                "accountId": 8,
                "accountName": "Sample Text Data",
                "description": "This is the main corporate credit card",
                "paymentMethodIdentifier": "XXXX-XXXX-XXXX-1111",
                "isActive": true,
                "autopay": true,
                "transactionToken": "WuJNFtr3HYNWHAVKvflOhOT2JCF",
                "attributes": "Sample Text Data",
                "paymentProviderId": 2,
                "paymentProviderName": "Sample Text Data",
                "paymentMethodToken": "127dfh72y3gg",
                "cardExpiration": "Sample Text Data"
            }
        ]
    }
}