Update a Payment Method
put
/bcws/webresources/v1.0/paymentmethods/{id}
Updates an account's payment method. You can update the following:
- Contact information
- For credit cards, change the expiration date.
- For direct debit, change the bank number, account number, and account type.
- For invoices, change the invoice ID and the contact method.
- For SEPA, change the IBAN, BIC, and the Unique Mandate Reference number.
For invoice payments that use email for delivery, the email address is required.
Request
Path Parameters
-
id(required): string
The ID of the payment method.
Supported Media Types
- application/xml
- application/json
The payment method to modify for the target account. To deassign a bill unit, you must put it in the deassignedBillUnits array; you can't just delete the bill unit from the assignedBillUnits array.
Root Schema : schema
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
assignedBillUnits: array
assignedBillUnits
Bill units assigned to the payment method.
-
creditCard: object
CreditCardType
-
deassignedBillUnits: array
deassignedBillUnits
Bill units to deassign from the payment method.
-
directDebit: object
DirectDebitType
-
extension: object
extension
The extended attributes.
-
invoice: object
InvoiceType
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 0: Undefined
- 10000: Prepaid
- 10001: Invoice
- 10002: Debit card
- 10003: Credit card
- 10005: US or Canada direct debit
- 10006: Smartcard
- 10007: Subordinate
- 10011: Cash
- 10012: Check
- 10013: Wire transfer
- 10014: Inter-bank payment order
- 10015: Postal payment order
- 10016: Voucher
- 10017: Failed payment
- 10018: SEPA payment
-
sepa: object
SepaType
Nested Schema : ResourceRef
Type:
Show Source
object
-
id(required): string
The ID.
-
uri: string
The Uniform Resource Identifier (URI) associated with the resource.
Nested Schema : assignedBillUnits
Type:
array
Bill units assigned to the payment method.
Show Source
-
Array of:
string
Bill units assigned to the payment method.
Nested Schema : CreditCardType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : deassignedBillUnits
Type:
array
Bill units to deassign from the payment method.
Show Source
-
Array of:
string
Bill units to deassign from the payment method.
Nested Schema : DirectDebitType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : InvoiceType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : SepaType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : Details
Type:
object
The offer details.
Show Source
-
balanceImpactResource(required): string
The resource that represents the balance impact of the offer.
-
fixedAmount: number
(float)
The fixed amount of the offer.
-
fixedPriceTag(required): string
The fixed price tag of the offer.
-
scaledAmount: number
(float)
The scaled amount of the offer.
-
scaledPriceTag(required): string
The scaled price tag of the offer.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : extension
Type:
object
The extended attributes.
The payment method to modify for the target account. To deassign a bill unit, you must put it in the deassignedBillUnits array; you can't just delete the bill unit from the assignedBillUnits array.
Root Schema : schema
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
assignedBillUnits: array
assignedBillUnits
Bill units assigned to the payment method.
-
creditCard: object
CreditCardType
-
deassignedBillUnits: array
deassignedBillUnits
Bill units to deassign from the payment method.
-
directDebit: object
DirectDebitType
-
extension: object
extension
The extended attributes.
-
invoice: object
InvoiceType
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 0: Undefined
- 10000: Prepaid
- 10001: Invoice
- 10002: Debit card
- 10003: Credit card
- 10005: US or Canada direct debit
- 10006: Smartcard
- 10007: Subordinate
- 10011: Cash
- 10012: Check
- 10013: Wire transfer
- 10014: Inter-bank payment order
- 10015: Postal payment order
- 10016: Voucher
- 10017: Failed payment
- 10018: SEPA payment
-
sepa: object
SepaType
Nested Schema : ResourceRef
Type:
Show Source
object
-
id(required): string
The ID.
-
uri: string
The Uniform Resource Identifier (URI) associated with the resource.
Nested Schema : assignedBillUnits
Type:
array
Bill units assigned to the payment method.
Show Source
-
Array of:
string
Bill units assigned to the payment method.
Nested Schema : CreditCardType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : deassignedBillUnits
Type:
array
Bill units to deassign from the payment method.
Show Source
-
Array of:
string
Bill units to deassign from the payment method.
Nested Schema : DirectDebitType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : InvoiceType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : SepaType
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
correctiveInvoiceType: integer
(int32)
The type of invoice to create, such as an invoice correction letter or a replacement invoice.
-
details: object
Details
The offer details.
-
extension: object
extension
The extended attributes.
-
id: string
The ID.
-
name: string
The payment instrument's name.
-
paymentType: integer
(int32)
The payment type. Can be one of the following:
- 10001:Invoice
- 10003: Credit card
- 10005: Direct debit
- 10007: Subordinate
Nested Schema : Details
Type:
object
The offer details.
Show Source
-
balanceImpactResource(required): string
The resource that represents the balance impact of the offer.
-
fixedAmount: number
(float)
The fixed amount of the offer.
-
fixedPriceTag(required): string
The fixed price tag of the offer.
-
scaledAmount: number
(float)
The scaled amount of the offer.
-
scaledPriceTag(required): string
The scaled price tag of the offer.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : extension
Type:
object
The extended attributes.
Response
Supported Media Types
- application/xml
- application/json
200 Response
The payment methods were updated successfully.
Root Schema : resource
Type:
Show Source
object
-
extension: object
extension
The extended attributes.
-
reference(required): object
ResourceRef
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : ResourceRef
Type:
Show Source
object
-
id(required): string
The ID.
-
uri: string
The Uniform Resource Identifier (URI) associated with the resource.
500 Response
An internal server error occurred.
Examples
This example shows how to assign a different bill unit to a payment method by submitting a PUT request on the REST resource using cURL. For more information about cURL, see "Use cURL".
cURL Command
curl -X PUT 'http://hostname:port/bcws/webresources/v1.0/paymentmethods/0.0.0.1+-payinfo-invoice+263722' -H 'content-type: application/json' -d @updatePaymentMethod.json
where:
- hostname is the URL for the Billing Care REST server.
- port is the port for the Billing Care REST server.
- version is the version of the API you're using, such as v1.0.
- updatePaymentMethod.json is the JSON file that specifies the update details.
Example of Request Body
This example shows the contents of the updatePaymentMethod.json file sent as the request body, with the updated fields in bold. The bill unit specified in deassignedBillUnits is the bill unit to remove from the payment method, and the one specified in assignedBillUnits is the new one to add.
{
"invoice": {
"details": {
"invoiceId": "8097890",
"deliveryPrefer": "0",
"emailAddr:" "marie.fortin@example.com"
"name": "Marie Fortin",
"address": "401 Island Parkway",
"city": "Redwood Shores",
"state": "CA",
"zip": "94065",
"country": "US"
},
"accountRef": {
"id": "0.0.0.1+-account+85712"
},
"paymentType": "10001"
},
"paymentType": "10001",
"accountRef": {
"id": "0.0.0.1+-account+85712"
},
"assignedBillUnits": ["0.0.0.1+-billinfo+262442"], "deassignedBillUnits": ["0.0.0.1+-billinfo+398756"]
}
Example of Response Body
This example shows the contents of the response body in JSON format.
{
"extension": null,
"reference": {
"id": "0.0.0.1+-payinfo-invoice+263722",
"uri": "http://hostname:port/bc/webresources/v1.0/paymentmethods/0.0.0.1+-payinfo-invoice+263722"
}
}