billing
POST /v1/payment-methods/paypal/confirm
Finish saving a PayPal account after the buyer approved it.
احراز هویت
یک کلید API را به عنوان یک توکن برbearer ارسال کنید. این نقطه پایانی مجوز خاصی را در مشخصات خود ذکر نمیکند، بنابراین به جای فرض کردن، حداقل نیازهای کلید خود را بدهید و پاسخ را بررسی کنید.
جایی که شناسه سازمان شما قرار میگیرد
این نقطه پایانی org_id را به عنوان یک فیلد در بدنه JSON دریافت میکند.
شناسه سازمان شما در صفحه کلیدهای API در داشبوردتان، در کنار خود کلید قرار دارد. این شناسه در تمام درخواستهایی که ارسال میکنید یکسان است.
امتحان کنید
هر چیزی را که داخل براکتهای زاویهدار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.
curl -X POST https://api.zinndigital.com/v1/payment-methods/paypal/confirm \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "setup_token_id": <string> }'وارد شدهاید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی API زنده اجرا میکند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید
جزئیات
Exchanges an approved setup token for the permanent vault token and stores the mandate. The organization is read from PayPal's answer and must match the caller's, so a setup token belonging to another account cannot be attached here. Idempotent, and it deliberately races PayPal's VAULT.PAYMENT-TOKEN.CREATED webhook: whichever arrives first writes the mandate and the other converges on it, so a buyer whose browser never returns still ends up with a saved method.
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
setup_token_id | string | بله | The setup_token_id returned by POST /v1/payment-methods/paypal. |
org_id | string | خیر | Organization to attach the mandate to. The caller must hold billing.payment.manage in that organization, and PayPal's own answer must name the same organization. |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
id | string | بله | — |
gateway | string<stripe, paypal> | بله | The rail holding the mandate. Crypto (NOWPayments) is absent by design — it has no mandate primitive, so those customers are invoiced ahead rather than rebilled (ADR 0011 §6). |
status | string<pending, active, expired, revoked> | بله | Only active is chargeable; pending means the gateway has not confirmed it yet. |
role | string<, primary, backup> | بله | Which job this mandate does for the organisation. primary is charged first; backup is charged immediately if the primary declines; "" is simply stored. ⛔ Replaced… |
removal_blocked_by | string<, subscription, adhoc_charge, reseller_programme> | بله | Empty when this method may be removed. Otherwise the obligation that keeps the floor binding: this is the account's last operational way to pay and the named thing is still… |
method_type | string | بله | The gateway's own name for what kind of mandate this is — Stripe's PaymentMethod.type (card, sepa_debit, klarna, kakao_pay, …). Empty on a rail that does not type its… |
can_auto_renew | boolean | بله | Whether this mandate can be charged off-session, i.e. whether a renewal can be taken without the customer present. false means the subscription renews manually: the… |
brand | string | بله | — |
last4 | string | بله | — |
exp_month | integer | خیر | — |
exp_year | integer | خیر | — |
holder_name | string | خیر | — |
confirmed_at | string | خیر | When the gateway confirmed the mandate. Null while pending. |
created_at | string | بله | — |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 409 · 422 · 429 · 503