init_paypal_token_creation_m Sample Call and Response
This example shows a call to init_paypal_token_creation_m, based on the plsql_m_r73.yml Core API definition file for release 73. The example creates a PayPal session so that an account holder can begin setting up a PayPal billing agreement, scoping the request to a specific billing group.
This example includes the optional amount and billing_group_no fields, scoping token creation to a particular billing group's collection group rather than the account's default collection group. It does not cover scoping by master_plan_instance_no or the client-defined identifier alternatives, all of which are alternatives to billing_group_no and are explained below.
Sample call
{
"rest_call": "init_paypal_token_creation_m",
"output_format": "json",
"client_no": 34281,
"auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"acct_no": 7001452,
"amount": 49.99,
"billing_group_no": 100045821
}
acct_no and client_acct_id are alternatives (alt_required_field); this example uses acct_no, the Aria-assigned numeric identifier. billing_group_no, client_billing_group_id, master_plan_instance_no, and client_master_plan_instance_id are all alternatives to one another and are all optional; this example supplies only billing_group_no to scope the token creation to that billing group's collection group. If none of the four are supplied, Aria uses the account's collection group instead. The token values in this example, including request_token in the response below, are clearly fake placeholders and do not resemble real PayPal credentials. 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",
"agreement_confirmation_url": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=PPTOKEN00019283XYZ1",
"request_token": "PPTOKEN00019283XYZ1",
"billing_group_no": 100045821
}
error_code of 0 combined with an error_msg of "OK" indicates that the session was created successfully. agreement_confirmation_url is the redirect URL to which the end user is sent to authenticate with PayPal and approve wallet access; request_token is the temporary PayPal session token valid for fifteen minutes, and it must be passed back on the subsequent call to complete_paypal_token_creation_m once the customer confirms the agreement on PayPal's side. This example's request_token, "PPTOKEN00019283XYZ1", is an obviously fake placeholder used consistently with the companion complete_paypal_token_creation_m example.