Skip to main content
Aria Knowledge Central

complete_paypal_token_creation_m Sample Call and Response

This example shows a call to complete_paypal_token_creation_m, based on the plsql_m_r73.yml Core API definition file for release 73. The example confirms that an account holder accepted a PayPal billing agreement, using the session token that a prior call to init_paypal_token_creation_m returned, and saves the resulting agreement for future payments.

This example includes the required request_token, the billing_group_no used consistently with the prior init_paypal_token_creation_m call, and the optional do_auth_reversal field set to explicitly not reverse the authorization. It does not cover update_avs_return_address or disable_pmt_on_auth_failure, both of which are left out and explained below.

Sample call

{
  "rest_call": "complete_paypal_token_creation_m",
  "output_format": "json",
  "client_no": 34281,
  "auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
  "acct_no": 7001452,
  "request_token": "PPTOKEN00019283XYZ1",
  "billing_group_no": 100045821,
  "do_auth_reversal": 0
}

acct_no and client_acct_id are alternatives (alt_required_field); this example uses acct_no. request_token is required and is the same clearly fake placeholder value, "PPTOKEN00019283XYZ1", that a prior init_paypal_token_creation_m call would have returned. billing_group_no is supplied here because it was also supplied on the init_paypal_token_creation_m call; the description notes that billing group inputs must be included on both calls, or skipped from both, for consistency. do_auth_reversal is an enumerated field; value 0 means the authorization will not be reversed immediately, value 1 reverses it immediately, and value negative one (shown as -1) defers to configuration settings. This example leaves out update_avs_return_address, used only to control address-verification handling, and disable_pmt_on_auth_failure, used only to control whether a failed authorization disables the payment method. The rest_call and output_format fields are added by the REST layer and are not part of the method's own argument list.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "proc_status_code": "0",
  "proc_status_text": "Approved",
  "bill_agreement_id": "B-FAKE0019283TEST",
  "paypal_email": "sample.customer@example.com",
  "paypal_payerid": "FAKEPAYERID001",
  "paypal_payerstatus": "verified",
  "paypal_countrycode": "US",
  "auth_no": 55012933,
  "proc_payment_id": "PMT-88213-02"
}

error_code of 0 combined with an error_msg of "OK" indicates that the billing agreement was confirmed and saved. bill_agreement_id, again an obviously fake placeholder value, is the identifier Aria stores for use on future PayPal transactions with this account. This example leaves out the paypal_shiptoname, paypal_shiptostreet, paypal_shipttostreet2, paypal_shiptocity, paypal_shiptostate, paypal_shiptozip, and paypal_shiptocountrycode fields, all of which are populated only when the customer's PayPal profile includes shipping address details.

TOP
  • Was this article helpful?