Hello, I was trying to follow the following Guide to create an order and capture payment for it from a billing agreement. So far I managed to use the Billing Agreement to create payments using the deprecated `/v1/payments/payment` API, but when creating the order I am getting a 422 response with error ` NO_PAYMENT_SOURCE_PROVIDED` (see step 4 below). Steps: 1. Create Agreement Token Request: POST https://api-m.sandbox.paypal.com/v1/billing-agreements/agreement-tokens Request Body: { "description": "Billing Agreement Description", "payer": { "payment_method": "PAYPAL" }, "plan": { "type": "MERCHANT_INITIATED_BILLING", "merchant_preferences": { "return_url": "https://example.com/return", "cancel_url": "https://example.com/cancel", "notify_url": "https://example.com/notify", "accepted_pymt_type": "INSTANT", "skip_shipping_address": true } } } Response (201): { "token_id": "BA-7AC53308L08744613", "links": [ { "href": "https://www.sandbox.paypal.com/agreements/approve?ba_token=BA-7AC53308L08744613", "rel": "approval_url", "method": "POST" }, { "href": "https://api-m.sandbox.paypal.com/v1/billing-agreements/BA-7AC53308L08744613/agreements", "rel": "self", "method": "POST" } ] } 2. Agreement approved as a buyer 3. Agreement Created from Agreement Token POST https://api-m.sandbox.paypal.com/v1/billing-agreements/agreements Request Body: { "token_id": "BA-7AC53308L08744613" } Response (201): { "id": "B-9BS46477KS1858732", "state": "ACTIVE", "description": "Billing Agreement Description", "merchant": { "payee_info": { "email": "sb-xw[Removed. Phone #s not permitted]business.example.com" } }, "payer": { "payer_info": { "email": "s[Removed. Phone #s not permitted]pan> "first_name": "John", "last_name": "Doe", "payer_id": "TNBDVWE3D5AS8", "tenant": "PAYPAL" } }, "plan": { "type": "MERCHANT_INITIATED_BILLING", "merchant_preferences": { "notify_url": "https://example.com/notify", "accepted_pymt_type": "INSTANT", "multi_factor_activation": false, "req_billing_address": false } }, "create_time": "2023-02-09T10:14:23.000Z", "update_time": "2023-02-09T10:14:23.000Z", "links": [ { "href": "https://api-m.sandbox.paypal.com/v1/billing-agreements/agreements/B-9BS46477KS1858732/cancel", "rel": "cancel", "method": "POST" }, { "href": "https://api-m.sandbox.paypal.com/v1/billing-agreements/agreements/B-9BS46477KS1858732", "rel": "self", "method": "GET" } ] } 4. Attempt to create order from Billing Agreement: POST https://api-m.sandbox.paypal.com/v2/checkout/orders Request Body: { "intent": "CAPTURE", "purchase_units": [ { "amount": { "currency_code": "USD", "value": "55.00" } } ], "payment_source": { "token:": { "type": "BILLING_AGREEMENT", "id": "B-9BS46477KS1858732" } } } Response (422): { "name": "UNPROCESSABLE_ENTITY", "details": [ { "field": "/payment_source", "issue": "NO_PAYMENT_SOURCE_PROVIDED", "description": "NO_PAYMENT_SOURCE_PROVIDED" } ], "message": "The requested action could not be performed, semantically incorrect, or failed business validation.", "debug_id": "cbed6471d8f2e", "links": [ { "href": "https://developer.paypal.com/docs/api/orders/v2/#error-NO_PAYMENT_SOURCE_PROVIDED", "rel": "information_link", "method": "GET" } ] } Your help would be greatly appreciated. Thanks. Best regards, Brian
... View more