copy_acct_payment_method_m Sample Call and Response
This example shows a typical call to copy_acct_payment_method_m that copies one specific payment method, along with its associated billing contact information, from a source account to a target account, together with a representative response. The example is based on the method definition in plsql_m_r73.yml. The payment method numbers used in this example are clearly fake identifiers invented for illustration.
This example copies a single named payment method and assigns it a new client-defined identifier on the target account; it does not cover the case of omitting copy_payment_methods entirely, which copies every non-disabled payment method on the source account instead.
Sample call
{
"rest_call": "copy_acct_payment_method_m",
"output_format": "json",
"client_no": 10023,
"auth_key": "8f3e2b1a9c7d4e6f0a1b2c3d4e5f6789",
"source_acct_no": 3300457,
"target_acct_no": 3300892,
"copy_payment_methods": [
{
"payment_method_no": 445210,
"client_new_tgt_pmt_method_id": "BG-PRIMARY-COPY"
}
]
}
rest_call and output_format are added by the REST layer common to every Core API call; they do not appear among the method's own documented arguments. source_acct_no identifies the account the payment method is copied from, and target_acct_no identifies the account it is copied to. Each has a client-defined alternative, client_source_acct_id and client_target_acct_id respectively; supply only one identifier per account, not both forms. Before calling this method, you must confirm independently that the source account and target account belong to the same account owner, since Aria does not validate account ownership as part of this call.
copy_payment_methods is an array because a single call can copy more than one payment method at once; this example includes one entry. Within each entry, payment_method_no identifies the specific payment method on the source account to copy, with client_payment_method_id as its client-defined alternative (not shown here). client_new_tgt_pmt_method_id assigns a new client-defined identifier to the copy of this payment method on the target account; if omitted, the copied payment method on the target account is left without a client-defined identifier. This example omits the deprecated payment_methods field, which copy_payment_methods replaces.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"payment_method_map": [
{
"source_pmt_method_no": 445210,
"target_pmt_method_no": 558812,
"client_target_pmt_method_id": "BG-PRIMARY-COPY"
}
]
}
error_code of 0 with error_msg of "OK" indicates the payment method was copied successfully. payment_method_map is an array with one entry per payment method copied; a call copying several payment methods, or one omitting copy_payment_methods to copy every non-disabled payment method on the source account, would return one entry here for each. Each entry pairs the payment method's identifier on the source account (source_pmt_method_no) with its new, Aria-assigned identifier on the target account (target_pmt_method_no), along with the client-defined identifier now associated with the copy (client_target_pmt_method_id).
This response omits client_source_pmt_method_id, which would appear if the source payment method had a client-defined identifier of its own, and error_details, which is populated only when the request cannot be completed as submitted.