Source: PaypalClient
Source: Orders
authorizeOrder(request: Orders.AuthorizeOrderRequest, options?: RequestOptions): ApiPromise<OrderAuthorizeResponse, Orders.AuthorizeOrderError>
-
-
Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors.
-
try { const response = await client.orders.authorizeOrder({ id: "some example string" }); // TODO: Handle 'response' of type OrderAuthorizeResponse } catch (err) { // TODO: Handle 'err' of type Orders.AuthorizeOrderError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.authorizeOrder({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type OrderAuthorizeResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order for which to authorize. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalRequestId?stringThe server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc). prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalClientMetadataId?string- payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. body?OrderAuthorizeRequest-
-
Direct:
await client.orders.authorizeOrder(request)- OnSuccess:
OrderAuthorizeResponse - OnError: throws
Orders.AuthorizeOrderError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.authorizeOrder(request).asApiResult()- OnSuccess:
ApiResult<OrderAuthorizeResponse, Orders.AuthorizeOrderError>, withresult.valueof typeOrderAuthorizeResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
captureOrder(request: Orders.CaptureOrderRequest, options?: RequestOptions): ApiPromise<Order, Orders.CaptureOrderError>
-
-
Captures payment for an order. To successfully capture payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors.
-
try { const response = await client.orders.captureOrder({ id: "some example string" }); // TODO: Handle 'response' of type Order } catch (err) { // TODO: Handle 'err' of type Orders.CaptureOrderError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.captureOrder({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Order } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order for which to capture a payment. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalRequestId?stringThe server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc). prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalClientMetadataId?string- payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. body?OrderCaptureRequest-
-
Direct:
await client.orders.captureOrder(request)- OnSuccess:
Order - OnError: throws
Orders.CaptureOrderError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.captureOrder(request).asApiResult()- OnSuccess:
ApiResult<Order, Orders.CaptureOrderError>, withresult.valueof typeOrder - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
confirmOrder(request: Orders.ConfirmOrderRequestParams, options?: RequestOptions): ApiPromise<Order, Orders.ConfirmOrderError>
-
-
Payer confirms their intent to pay for the the Order with the given payment source.
-
try { const response = await client.orders.confirmOrder({ id: "some example string" }); // TODO: Handle 'response' of type Order } catch (err) { // TODO: Handle 'err' of type Orders.ConfirmOrderError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.confirmOrder({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Order } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order for which the payer confirms their intent to pay. payPalClientMetadataId?string- payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"body?ConfirmOrderRequest-
-
Direct:
await client.orders.confirmOrder(request)- OnSuccess:
Order - OnError: throws
Orders.ConfirmOrderError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.confirmOrder(request).asApiResult()- OnSuccess:
ApiResult<Order, Orders.ConfirmOrderError>, withresult.valueof typeOrder - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
createOrder(request: Orders.CreateOrderRequest, options?: RequestOptions): ApiPromise<Order, Orders.CreateOrderError>
-
-
Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 errors.
-
try { const response = await client.orders.createOrder({ body: { intent: CheckoutPaymentIntent.Capture, purchaseUnits: [{ amount: { currencyCode: "some example string", value: "some example string" } }], }, }); // TODO: Handle 'response' of type Order } catch (err) { // TODO: Handle 'err' of type Orders.CreateOrderError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.createOrder({ body: { intent: CheckoutPaymentIntent.Capture, purchaseUnits: [{ amount: { currencyCode: "some example string", value: "some example string" } }], }, }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Order } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalRequestId?stringThe server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc). payPalPartnerAttributionId?string- payPalClientMetadataId?string- prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. bodyOrderRequest-
-
Direct:
await client.orders.createOrder(request)- OnSuccess:
Order - OnError: throws
Orders.CreateOrderError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.createOrder(request).asApiResult()- OnSuccess:
ApiResult<Order, Orders.CreateOrderError>, withresult.valueof typeOrder - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
createOrderTracking(request: Orders.CreateOrderTrackingRequest, options?: RequestOptions): ApiPromise<Order, Orders.CreateOrderTrackingError>
-
-
Adds tracking information for an Order.
-
try { const response = await client.orders.createOrderTracking({ id: "some example string", body: { captureId: "some example string" }, }); // TODO: Handle 'response' of type Order } catch (err) { // TODO: Handle 'err' of type Orders.CreateOrderTrackingError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.createOrderTracking({ id: "some example string", body: { captureId: "some example string" }, }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Order } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order that the tracking information is associated with. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. bodyOrderTrackerRequest-
-
Direct:
await client.orders.createOrderTracking(request)- OnSuccess:
Order - OnError: throws
Orders.CreateOrderTrackingError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.createOrderTracking(request).asApiResult()- OnSuccess:
ApiResult<Order, Orders.CreateOrderTrackingError>, withresult.valueof typeOrder - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getOrder(request: Orders.GetOrderRequest, options?: RequestOptions): ApiPromise<Order, Orders.GetOrderError>
-
-
Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors.
-
try { const response = await client.orders.getOrder({ id: "some example string" }); // TODO: Handle 'response' of type Order } catch (err) { // TODO: Handle 'err' of type Orders.GetOrderError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.getOrder({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Order } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order for which to show details. fields?stringA comma-separated list of fields that should be returned for the order. Valid filter field is payment_source.payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion.
-
Direct:
await client.orders.getOrder(request)- OnSuccess:
Order - OnError: throws
Orders.GetOrderError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.getOrder(request).asApiResult()- OnSuccess:
ApiResult<Order, Orders.GetOrderError>, withresult.valueof typeOrder - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
patchOrder(request: Orders.PatchOrderRequest, options?: RequestOptions): ApiPromise<undefined, Orders.PatchOrderError>
-
-
Updates an order with a
CREATEDorAPPROVEDstatus. You cannot update an order with theCOMPLETEDstatus.
To make an update, you must provide areference_id. If you omit this value with an order that contains only one purchase unit, PayPal sets the value todefaultwhich enables you to use the path:"/purchase_units/@reference_id=='default'/{attribute-or-object}". Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.Note: For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes or objects:Attribute Op Notes intentreplace payerreplace, add Using replace op for payerwill replace the wholepayerobject with the value sent in request.purchase_unitsreplace, add purchase_units[].custom_idreplace, add, remove purchase_units[].descriptionreplace, add, remove purchase_units[].payee.emailreplace purchase_units[].shipping.namereplace, add purchase_units[].shipping.email_addressreplace, add purchase_units[].shipping.phone_numberreplace, add purchase_units[].shipping.optionsreplace, add purchase_units[].shipping.addressreplace, add purchase_units[].shipping.typereplace, add purchase_units[].soft_descriptorreplace, remove purchase_units[].amountreplace purchase_units[].itemsreplace, add, remove purchase_units[].invoice_idreplace, add, remove purchase_units[].payment_instructionreplace purchase_units[].payment_instruction.disbursement_modereplace By default, disbursement_modeisINSTANT.purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove purchase_units[].payment_instruction.platform_feesreplace, add, remove purchase_units[].supplementary_data.airlinereplace, add, remove purchase_units[].supplementary_data.cardreplace, add, remove application_context.client_configurationreplace, add
-
try { await client.orders.patchOrder({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Orders.PatchOrderError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.patchOrder({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order to update. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. body?Patch[]-
-
Direct:
await client.orders.patchOrder(request)- OnSuccess:
undefined - OnError: throws
Orders.PatchOrderError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.patchOrder(request).asApiResult()- OnSuccess:
ApiResult<undefined, Orders.PatchOrderError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
updateOrderTracking(request: Orders.UpdateOrderTrackingRequest, options?: RequestOptions): ApiPromise<undefined, Orders.UpdateOrderTrackingError>
-
-
Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported.
-
try { await client.orders.updateOrderTracking({ id: "some example string", trackerId: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Orders.UpdateOrderTrackingError, discriminated with 'err.payload.kind' }
-
const result = await client.orders.updateOrderTracking({ id: "some example string", trackerId: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the order that the tracking information is associated with. trackerIdstringThe order tracking ID. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. body?Patch[]-
-
Direct:
await client.orders.updateOrderTracking(request)- OnSuccess:
undefined - OnError: throws
Orders.UpdateOrderTrackingError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.orders.updateOrderTracking(request).asApiResult()- OnSuccess:
ApiResult<undefined, Orders.UpdateOrderTrackingError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
Source: Payments
captureAuthorizedPayment(request: Payments.CaptureAuthorizedPaymentRequest, options?: RequestOptions): ApiPromise<CapturedPayment, Payments.CaptureAuthorizedPaymentError>
-
-
Captures an authorized payment, by ID.
-
try { const response = await client.payments.captureAuthorizedPayment({ authorizationId: "some example string" }); // TODO: Handle 'response' of type CapturedPayment } catch (err) { // TODO: Handle 'err' of type Payments.CaptureAuthorizedPaymentError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.captureAuthorizedPayment({ authorizationId: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type CapturedPayment } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description authorizationIdstringThe PayPal-generated ID for the authorized payment to capture. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalRequestId?stringThe server stores keys for 45 days. prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. body?CaptureRequest-
-
Direct:
await client.payments.captureAuthorizedPayment(request)- OnSuccess:
CapturedPayment - OnError: throws
Payments.CaptureAuthorizedPaymentError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.captureAuthorizedPayment(request).asApiResult()- OnSuccess:
ApiResult<CapturedPayment, Payments.CaptureAuthorizedPaymentError>, withresult.valueof typeCapturedPayment - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getAuthorizedPayment(request: Payments.GetAuthorizedPaymentRequest, options?: RequestOptions): ApiPromise<PaymentAuthorization, Payments.GetAuthorizedPaymentError>
-
-
Shows details for an authorized payment, by ID.
-
try { const response = await client.payments.getAuthorizedPayment({ authorizationId: "some example string" }); // TODO: Handle 'response' of type PaymentAuthorization } catch (err) { // TODO: Handle 'err' of type Payments.GetAuthorizedPaymentError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.getAuthorizedPayment({ authorizationId: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type PaymentAuthorization } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description authorizationIdstringThe ID of the authorized payment for which to show details. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
-
Direct:
await client.payments.getAuthorizedPayment(request)- OnSuccess:
PaymentAuthorization - OnError: throws
Payments.GetAuthorizedPaymentError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.getAuthorizedPayment(request).asApiResult()- OnSuccess:
ApiResult<PaymentAuthorization, Payments.GetAuthorizedPaymentError>, withresult.valueof typePaymentAuthorization - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getCapturedPayment(request: Payments.GetCapturedPaymentRequest, options?: RequestOptions): ApiPromise<CapturedPayment, Payments.GetCapturedPaymentError>
-
-
Shows details for a captured payment, by ID.
-
try { const response = await client.payments.getCapturedPayment({ captureId: "some example string" }); // TODO: Handle 'response' of type CapturedPayment } catch (err) { // TODO: Handle 'err' of type Payments.GetCapturedPaymentError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.getCapturedPayment({ captureId: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type CapturedPayment } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description captureIdstringThe PayPal-generated ID for the captured payment for which to show details. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant.
-
Direct:
await client.payments.getCapturedPayment(request)- OnSuccess:
CapturedPayment - OnError: throws
Payments.GetCapturedPaymentError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.getCapturedPayment(request).asApiResult()- OnSuccess:
ApiResult<CapturedPayment, Payments.GetCapturedPaymentError>, withresult.valueof typeCapturedPayment - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getRefund(request: Payments.GetRefundRequest, options?: RequestOptions): ApiPromise<Refund, Payments.GetRefundError>
-
-
Shows details for a refund, by ID.
-
try { const response = await client.payments.getRefund({ refundId: "some example string" }); // TODO: Handle 'response' of type Refund } catch (err) { // TODO: Handle 'err' of type Payments.GetRefundError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.getRefund({ refundId: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Refund } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description refundIdstringThe PayPal-generated ID for the refund for which to show details. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
-
Direct:
await client.payments.getRefund(request)- OnSuccess:
Refund - OnError: throws
Payments.GetRefundError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.getRefund(request).asApiResult()- OnSuccess:
ApiResult<Refund, Payments.GetRefundError>, withresult.valueof typeRefund - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
reauthorizePayment(request: Payments.ReauthorizePaymentRequest, options?: RequestOptions): ApiPromise<PaymentAuthorization, Payments.ReauthorizePaymentError>
-
-
Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the
amountrequest parameter.
-
try { const response = await client.payments.reauthorizePayment({ authorizationId: "some example string" }); // TODO: Handle 'response' of type PaymentAuthorization } catch (err) { // TODO: Handle 'err' of type Payments.ReauthorizePaymentError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.reauthorizePayment({ authorizationId: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type PaymentAuthorization } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description authorizationIdstringThe PayPal-generated ID for the authorized payment to reauthorize. payPalRequestId?stringThe server stores keys for 45 days. prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. body?ReauthorizeRequest-
-
Direct:
await client.payments.reauthorizePayment(request)- OnSuccess:
PaymentAuthorization - OnError: throws
Payments.ReauthorizePaymentError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.reauthorizePayment(request).asApiResult()- OnSuccess:
ApiResult<PaymentAuthorization, Payments.ReauthorizePaymentError>, withresult.valueof typePaymentAuthorization - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
refundCapturedPayment(request: Payments.RefundCapturedPaymentRequest, options?: RequestOptions): ApiPromise<Refund, Payments.RefundCapturedPaymentError>
-
-
Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body.
-
try { const response = await client.payments.refundCapturedPayment({ captureId: "some example string" }); // TODO: Handle 'response' of type Refund } catch (err) { // TODO: Handle 'err' of type Payments.RefundCapturedPaymentError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.refundCapturedPayment({ captureId: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Refund } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description captureIdstringThe PayPal-generated ID for the captured payment to refund. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalRequestId?stringThe server stores keys for 45 days. prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. body?RefundRequest-
-
Direct:
await client.payments.refundCapturedPayment(request)- OnSuccess:
Refund - OnError: throws
Payments.RefundCapturedPaymentError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.refundCapturedPayment(request).asApiResult()- OnSuccess:
ApiResult<Refund, Payments.RefundCapturedPaymentError>, withresult.valueof typeRefund - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
voidPayment(request: Payments.VoidPaymentRequest, options?: RequestOptions): ApiPromise<PaymentAuthorization, Payments.VoidPaymentError>
-
-
Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been fully captured.
-
try { const response = await client.payments.voidPayment({ authorizationId: "some example string" }); // TODO: Handle 'response' of type PaymentAuthorization } catch (err) { // TODO: Handle 'err' of type Payments.VoidPaymentError, discriminated with 'err.payload.kind' }
-
const result = await client.payments.voidPayment({ authorizationId: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type PaymentAuthorization } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description authorizationIdstringThe PayPal-generated ID for the authorized payment to void. payPalMockResponse?stringPayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. payPalAuthAssertion?stringAn API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. payPalRequestId?stringThe server stores keys for 45 days. prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"
-
Direct:
await client.payments.voidPayment(request)- OnSuccess:
PaymentAuthorization - OnError: throws
Payments.VoidPaymentError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.payments.voidPayment(request).asApiResult()- OnSuccess:
ApiResult<PaymentAuthorization, Payments.VoidPaymentError>, withresult.valueof typePaymentAuthorization - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
Source: Vault
createPaymentToken(request: Vault.CreatePaymentTokenRequest, options?: RequestOptions): ApiPromise<PaymentTokenResponse, Vault.CreatePaymentTokenError>
-
-
Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer.
-
try { const response = await client.vault.createPaymentToken({ body: { paymentSource: {} } }); // TODO: Handle 'response' of type PaymentTokenResponse } catch (err) { // TODO: Handle 'err' of type Vault.CreatePaymentTokenError, discriminated with 'err.payload.kind' }
-
const result = await client.vault.createPaymentToken({ body: { paymentSource: {} } }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type PaymentTokenResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description payPalRequestId?stringThe server stores keys for 3 hours. bodyPaymentTokenRequestPayment Token creation with a financial instrument and an optional customer_id.
-
Direct:
await client.vault.createPaymentToken(request)- OnSuccess:
PaymentTokenResponse - OnError: throws
Vault.CreatePaymentTokenError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.vault.createPaymentToken(request).asApiResult()- OnSuccess:
ApiResult<PaymentTokenResponse, Vault.CreatePaymentTokenError>, withresult.valueof typePaymentTokenResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
createSetupToken(request: Vault.CreateSetupTokenRequest, options?: RequestOptions): ApiPromise<SetupTokenResponse, Vault.CreateSetupTokenError>
-
-
Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer.
-
try { const response = await client.vault.createSetupToken({ body: { paymentSource: {} } }); // TODO: Handle 'response' of type SetupTokenResponse } catch (err) { // TODO: Handle 'err' of type Vault.CreateSetupTokenError, discriminated with 'err.payload.kind' }
-
const result = await client.vault.createSetupToken({ body: { paymentSource: {} } }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type SetupTokenResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description payPalRequestId?stringThe server stores keys for 3 hours. bodySetupTokenRequestSetup Token creation with a instrument type optional financial instrument details and customer_id.
-
Direct:
await client.vault.createSetupToken(request)- OnSuccess:
SetupTokenResponse - OnError: throws
Vault.CreateSetupTokenError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.vault.createSetupToken(request).asApiResult()- OnSuccess:
ApiResult<SetupTokenResponse, Vault.CreateSetupTokenError>, withresult.valueof typeSetupTokenResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
deletePaymentToken(request: Vault.DeletePaymentTokenRequest, options?: RequestOptions): ApiPromise<undefined, Vault.DeletePaymentTokenError>
-
-
Delete the payment token associated with the payment token id.
-
try { await client.vault.deletePaymentToken({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Vault.DeletePaymentTokenError, discriminated with 'err.payload.kind' }
-
const result = await client.vault.deletePaymentToken({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringID of the payment token.
-
Direct:
await client.vault.deletePaymentToken(request)- OnSuccess:
undefined - OnError: throws
Vault.DeletePaymentTokenError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.vault.deletePaymentToken(request).asApiResult()- OnSuccess:
ApiResult<undefined, Vault.DeletePaymentTokenError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getPaymentToken(request: Vault.GetPaymentTokenRequest, options?: RequestOptions): ApiPromise<PaymentTokenResponse, Vault.GetPaymentTokenError>
-
-
Returns a readable representation of vaulted payment source associated with the payment token id.
-
try { const response = await client.vault.getPaymentToken({ id: "some example string" }); // TODO: Handle 'response' of type PaymentTokenResponse } catch (err) { // TODO: Handle 'err' of type Vault.GetPaymentTokenError, discriminated with 'err.payload.kind' }
-
const result = await client.vault.getPaymentToken({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type PaymentTokenResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringID of the payment token.
-
Direct:
await client.vault.getPaymentToken(request)- OnSuccess:
PaymentTokenResponse - OnError: throws
Vault.GetPaymentTokenError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.vault.getPaymentToken(request).asApiResult()- OnSuccess:
ApiResult<PaymentTokenResponse, Vault.GetPaymentTokenError>, withresult.valueof typePaymentTokenResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getSetupToken(request: Vault.GetSetupTokenRequest, options?: RequestOptions): ApiPromise<SetupTokenResponse, Vault.GetSetupTokenError>
-
-
Returns a readable representation of temporarily vaulted payment source associated with the setup token id.
-
try { const response = await client.vault.getSetupToken({ id: "some example string" }); // TODO: Handle 'response' of type SetupTokenResponse } catch (err) { // TODO: Handle 'err' of type Vault.GetSetupTokenError, discriminated with 'err.payload.kind' }
-
const result = await client.vault.getSetupToken({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type SetupTokenResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringID of the setup token.
-
Direct:
await client.vault.getSetupToken(request)- OnSuccess:
SetupTokenResponse - OnError: throws
Vault.GetSetupTokenError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.vault.getSetupToken(request).asApiResult()- OnSuccess:
ApiResult<SetupTokenResponse, Vault.GetSetupTokenError>, withresult.valueof typeSetupTokenResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
listCustomerPaymentTokens(request: Vault.ListCustomerPaymentTokensRequest, options?: RequestOptions): ApiPromise<CustomerVaultPaymentTokensResponse, Vault.ListCustomerPaymentTokensError>
-
-
Returns all payment tokens for a customer.
-
try { const response = await client.vault.listCustomerPaymentTokens({ customerId: "some example string" }); // TODO: Handle 'response' of type CustomerVaultPaymentTokensResponse } catch (err) { // TODO: Handle 'err' of type Vault.ListCustomerPaymentTokensError, discriminated with 'err.payload.kind' }
-
const result = await client.vault.listCustomerPaymentTokens({ customerId: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type CustomerVaultPaymentTokensResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description customerIdstringA unique identifier representing a specific customer in merchant's/partner's system or records. pageSize?numberA non-negative, non-zero integer indicating the maximum number of results to return at one time.
Default: 5page?numberA non-negative, non-zero integer representing the page of the results.
Default: 1totalRequired?booleanA boolean indicating total number of items (total_items) and pages (total_pages) are expected to be returned in the response.
Default: false
-
Direct:
await client.vault.listCustomerPaymentTokens(request)- OnSuccess:
CustomerVaultPaymentTokensResponse - OnError: throws
Vault.ListCustomerPaymentTokensError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.vault.listCustomerPaymentTokens(request).asApiResult()- OnSuccess:
ApiResult<CustomerVaultPaymentTokensResponse, Vault.ListCustomerPaymentTokensError>, withresult.valueof typeCustomerVaultPaymentTokensResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
Source: TransactionSearch
searchBalances(request: TransactionSearch.SearchBalancesRequest, options?: RequestOptions): ApiPromise<BalancesResponse, TransactionSearch.SearchBalancesError>
-
-
List all balances. Specify date time to list balances for that time that appear in the response. Notes: It takes a maximum of three hours for balances to appear in the list balances call. This call lists balances upto the previous three years.
-
try { const response = await client.transactionSearch.searchBalances(); // TODO: Handle 'response' of type BalancesResponse } catch (err) { // TODO: Handle 'err' of type TransactionSearch.SearchBalancesError, discriminated with 'err.payload.kind' }
-
const result = await client.transactionSearch.searchBalances().asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type BalancesResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description asOfTime?stringList balances in the response at the date time provided, will return the last refreshed balance in the system when not provided. currencyCode?stringFilters the transactions in the response by a three-character ISO-4217 currency code for the PayPal transaction currency.
-
Direct:
await client.transactionSearch.searchBalances(request)- OnSuccess:
BalancesResponse - OnError: throws
TransactionSearch.SearchBalancesError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.transactionSearch.searchBalances(request).asApiResult()- OnSuccess:
ApiResult<BalancesResponse, TransactionSearch.SearchBalancesError>, withresult.valueof typeBalancesResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
searchTransactions(request: TransactionSearch.SearchTransactionsRequest, options?: RequestOptions): ApiPromise<SearchResponse, TransactionSearch.SearchTransactionsError>
-
-
Lists transactions. Specify one or more query parameters to filter the transaction that appear in the response. Notes: If you specify one or more optional query parameters, the ending_balance response field is empty. It takes a maximum of three hours for executed transactions to appear in the list transactions call. This call lists transaction for the previous three years.
-
try { const response = await client.transactionSearch.searchTransactions({ startDate: "some example string", endDate: "some example string", }); // TODO: Handle 'response' of type SearchResponse } catch (err) { // TODO: Handle 'err' of type TransactionSearch.SearchTransactionsError, discriminated with 'err.payload.kind' }
-
const result = await client.transactionSearch.searchTransactions({ startDate: "some example string", endDate: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type SearchResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description startDatestringFilters the transactions in the response by a start date and time, in Internet date and time format. Seconds are required. Fractional seconds are optional. endDatestringFilters the transactions in the response by an end date and time, in Internet date and time format. Seconds are required. Fractional seconds are optional. The maximum supported range is 31 days. transactionId?stringFilters the transactions in the response by a PayPal transaction ID. A valid transaction ID is 17 characters long, except for an order ID, which is 19 characters long. Note: A transaction ID is not unique in the reporting system. The response can list two transactions with the same ID. One transaction can be balance affecting while the other is non-balance affecting. transactionType?stringFilters the transactions in the response by a PayPal transaction event code. See Transaction event codes. transactionStatus?stringFilters the transactions in the response by a PayPal transaction status code. Value is: Status code Description D PayPal or merchant rules denied the transaction. P The transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S. S The transaction successfully completed without a denial and after any pending statuses. V A successful transaction was reversed and funds were refunded to the original sender. transactionAmount?stringFilters the transactions in the response by a gross transaction amount range. Specify the range as TO, whereis the lower limit of the gross PayPal transaction amount andis the upper limit of the gross transaction amount. Specify the amounts in lower denominations. For example, to search for transactions from $5.00 to $10.05, specify[500 TO 1005]. Note:The values must be URL encoded.transactionCurrency?stringFilters the transactions in the response by a three-character ISO-4217 currency code for the PayPal transaction currency. paymentInstrumentType?stringFilters the transactions in the response by a payment instrument type. Value is either: CREDITCARD. Returns a direct credit card transaction with a corresponding value. DEBITCARD. Returns a debit card transaction with a corresponding value. If you omit this parameter, the API does not apply this filter. storeId?stringFilters the transactions in the response by a store ID. terminalId?stringFilters the transactions in the response by a terminal ID. fields?stringIndicates which fields appear in the response. Value is a single field or a comma-separated list of fields. The transaction_info value returns only the transaction details in the response. To include all fields in the response, specify fields=all. Valid fields are: transaction_info. The transaction information. Includes the ID of the PayPal account of the payee, the PayPal-generated transaction ID, the PayPal-generated base ID, the PayPal reference ID type, the transaction event code, the date and time when the transaction was initiated and was last updated, the transaction amounts including the PayPal fee, any discounts, insurance, the transaction status, and other information about the transaction. payer_info. The payer information. Includes the PayPal customer account ID and the payer's email address, primary phone number, name, country code, address, and whether the payer is verified or unverified. shipping_info. The shipping information. Includes the recipient's name, the shipping method for this order, the shipping address for this order, and the secondary address associated with this order. auction_info. The auction information. Includes the name of the auction site, the auction site URL, the ID of the customer who makes the purchase in the auction, and the date and time when the auction closes. cart_info. The cart information. Includes an array of item details, whether the item amount or the shipping amount already includes tax, and the ID of the invoice for PayPal-generated invoices. incentive_info. An array of incentive detail objects. Each object includes the incentive, such as a special offer or coupon, the incentive amount, and the incentive program code that identifies a merchant loyalty or incentive program. store_info. The store information. Includes the ID of the merchant store and the terminal ID for the checkout stand in the merchant store.
Default: "transaction_info"balanceAffectingRecordsOnly?stringIndicates whether the response includes only balance-impacting transactions or all transactions. Value is either: Y. The default. The response includes only balance transactions. N. The response includes all transactions.
Default: "Y"pageSize?numberThe number of items to return in the response. So, the combination of page=1andpage_size=20returns the first 20 items. The combination ofpage=2andpage_size=20returns the next 20 items.
Default: 100page?numberThe zero-relative start index of the entire list of items that are returned in the response. So, the combination of page=1andpage_size=20returns the first 20 items.
Default: 1
-
Direct:
await client.transactionSearch.searchTransactions(request)- OnSuccess:
SearchResponse - OnError: throws
TransactionSearch.SearchTransactionsError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.transactionSearch.searchTransactions(request).asApiResult()- OnSuccess:
ApiResult<SearchResponse, TransactionSearch.SearchTransactionsError>, withresult.valueof typeSearchResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
Source: Subscriptions
activateBillingPlan(request: Subscriptions.ActivateBillingPlanRequest, options?: RequestOptions): ApiPromise<undefined, Subscriptions.ActivateBillingPlanError>
-
-
Activates a plan, by ID.
-
try { await client.subscriptions.activateBillingPlan({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.ActivateBillingPlanError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.activateBillingPlan({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the plan.
-
Direct:
await client.subscriptions.activateBillingPlan(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.ActivateBillingPlanError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.activateBillingPlan(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.ActivateBillingPlanError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
activateSubscription(request: Subscriptions.ActivateSubscriptionRequestParams, options?: RequestOptions): ApiPromise<undefined, Subscriptions.ActivateSubscriptionError>
-
-
Activates the subscription.
-
try { await client.subscriptions.activateSubscription({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.ActivateSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.activateSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. body?ActivateSubscriptionRequest-
-
Direct:
await client.subscriptions.activateSubscription(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.ActivateSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.activateSubscription(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.ActivateSubscriptionError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
cancelSubscription(request: Subscriptions.CancelSubscriptionRequestParams, options?: RequestOptions): ApiPromise<undefined, Subscriptions.CancelSubscriptionError>
-
-
Cancels the subscription.
-
try { await client.subscriptions.cancelSubscription({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.CancelSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.cancelSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. body?CancelSubscriptionRequest-
-
Direct:
await client.subscriptions.cancelSubscription(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.CancelSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.cancelSubscription(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.CancelSubscriptionError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
captureSubscription(request: Subscriptions.CaptureSubscriptionRequestParams, options?: RequestOptions): ApiPromise<SubscriptionTransactionDetails, Subscriptions.CaptureSubscriptionError>
-
-
Captures an authorized payment from the subscriber on the subscription.
-
try { const response = await client.subscriptions.captureSubscription({ id: "some example string" }); // TODO: Handle 'response' of type SubscriptionTransactionDetails } catch (err) { // TODO: Handle 'err' of type Subscriptions.CaptureSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.captureSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type SubscriptionTransactionDetails } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. payPalRequestId?stringThe server stores keys for 72 hours. body?CaptureSubscriptionRequest-
-
Direct:
await client.subscriptions.captureSubscription(request)- OnSuccess:
SubscriptionTransactionDetails - OnError: throws
Subscriptions.CaptureSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.captureSubscription(request).asApiResult()- OnSuccess:
ApiResult<SubscriptionTransactionDetails, Subscriptions.CaptureSubscriptionError>, withresult.valueof typeSubscriptionTransactionDetails - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
createBillingPlan(request: Subscriptions.CreateBillingPlanRequest, options?: RequestOptions): ApiPromise<BillingPlan, Subscriptions.CreateBillingPlanError>
-
-
Creates a plan that defines pricing and billing cycle details for subscriptions.
-
try { const response = await client.subscriptions.createBillingPlan(); // TODO: Handle 'response' of type BillingPlan } catch (err) { // TODO: Handle 'err' of type Subscriptions.CreateBillingPlanError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.createBillingPlan().asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type BillingPlan } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalRequestId?stringThe server stores keys for 72 hours. body?PlanRequest-
-
Direct:
await client.subscriptions.createBillingPlan(request)- OnSuccess:
BillingPlan - OnError: throws
Subscriptions.CreateBillingPlanError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.createBillingPlan(request).asApiResult()- OnSuccess:
ApiResult<BillingPlan, Subscriptions.CreateBillingPlanError>, withresult.valueof typeBillingPlan - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
createSubscription(request: Subscriptions.CreateSubscriptionRequestParams, options?: RequestOptions): ApiPromise<Subscription, Subscriptions.CreateSubscriptionError>
-
-
Creates a subscription.
-
try { const response = await client.subscriptions.createSubscription(); // TODO: Handle 'response' of type Subscription } catch (err) { // TODO: Handle 'err' of type Subscriptions.CreateSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.createSubscription().asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Subscription } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description prefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"payPalRequestId?stringThe server stores keys for 72 hours. payPalClientMetadataId?stringThe PayPal Client Metadata Id(CMID) is used to provide device-specific information to PayPal's risk engine. This is crucial for transactions that require device-specific risk assessments. Merchants typically use the Paypal SDK that automatically submits the CMID or they use tools like Fraudnet JS for web or Magnes JS for mobile to generate the CMID on the frontend and then pass it to the API as part of the request headers. body?CreateSubscriptionRequest-
-
Direct:
await client.subscriptions.createSubscription(request)- OnSuccess:
Subscription - OnError: throws
Subscriptions.CreateSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.createSubscription(request).asApiResult()- OnSuccess:
ApiResult<Subscription, Subscriptions.CreateSubscriptionError>, withresult.valueof typeSubscription - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
deactivateBillingPlan(request: Subscriptions.DeactivateBillingPlanRequest, options?: RequestOptions): ApiPromise<undefined, Subscriptions.DeactivateBillingPlanError>
-
-
Deactivates a plan, by ID.
-
try { await client.subscriptions.deactivateBillingPlan({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.DeactivateBillingPlanError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.deactivateBillingPlan({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the plan.
-
Direct:
await client.subscriptions.deactivateBillingPlan(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.DeactivateBillingPlanError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.deactivateBillingPlan(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.DeactivateBillingPlanError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getBillingPlan(request: Subscriptions.GetBillingPlanRequest, options?: RequestOptions): ApiPromise<BillingPlan, Subscriptions.GetBillingPlanError>
-
-
Shows details for a plan, by ID.
-
try { const response = await client.subscriptions.getBillingPlan({ id: "some example string" }); // TODO: Handle 'response' of type BillingPlan } catch (err) { // TODO: Handle 'err' of type Subscriptions.GetBillingPlanError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.getBillingPlan({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type BillingPlan } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the plan.
-
Direct:
await client.subscriptions.getBillingPlan(request)- OnSuccess:
BillingPlan - OnError: throws
Subscriptions.GetBillingPlanError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.getBillingPlan(request).asApiResult()- OnSuccess:
ApiResult<BillingPlan, Subscriptions.GetBillingPlanError>, withresult.valueof typeBillingPlan - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
getSubscription(request: Subscriptions.GetSubscriptionRequest, options?: RequestOptions): ApiPromise<Subscription, Subscriptions.GetSubscriptionError>
-
-
Shows details for a subscription, by ID.
-
try { const response = await client.subscriptions.getSubscription({ id: "some example string" }); // TODO: Handle 'response' of type Subscription } catch (err) { // TODO: Handle 'err' of type Subscriptions.GetSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.getSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type Subscription } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. fields?stringList of fields that are to be returned in the response. Possible value for fields are last_failed_payment and plan.
-
Direct:
await client.subscriptions.getSubscription(request)- OnSuccess:
Subscription - OnError: throws
Subscriptions.GetSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.getSubscription(request).asApiResult()- OnSuccess:
ApiResult<Subscription, Subscriptions.GetSubscriptionError>, withresult.valueof typeSubscription - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
listBillingPlans(request: Subscriptions.ListBillingPlansRequest, options?: RequestOptions): ApiPromise<PlanCollection, Subscriptions.ListBillingPlansError>
-
-
Lists billing plans.
-
try { const response = await client.subscriptions.listBillingPlans(); // TODO: Handle 'response' of type PlanCollection } catch (err) { // TODO: Handle 'err' of type Subscriptions.ListBillingPlansError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.listBillingPlans().asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type PlanCollection } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description productId?stringFilters the response by a Product ID. pageSize?numberThe number of items to return in the response.
Default: 10page?numberA non-zero integer which is the start index of the entire list of items to return in the response. The combination of page=1andpage_size=20returns the first 20 items. The combination ofpage=2andpage_size=20returns the next 20 items.
Default: 1totalRequired?booleanIndicates whether to show the total count in the response.
Default: falseprefer?stringThe preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, name, description and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.
Default: "return=minimal"
-
Direct:
await client.subscriptions.listBillingPlans(request)- OnSuccess:
PlanCollection - OnError: throws
Subscriptions.ListBillingPlansError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.listBillingPlans(request).asApiResult()- OnSuccess:
ApiResult<PlanCollection, Subscriptions.ListBillingPlansError>, withresult.valueof typePlanCollection - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
listSubscriptionTransactions(request: Subscriptions.ListSubscriptionTransactionsRequest, options?: RequestOptions): ApiPromise<TransactionsList, Subscriptions.ListSubscriptionTransactionsError>
-
-
Lists transactions for a subscription.
-
try { const response = await client.subscriptions.listSubscriptionTransactions({ id: "some example string", startTime: "some example string", endTime: "some example string", }); // TODO: Handle 'response' of type TransactionsList } catch (err) { // TODO: Handle 'err' of type Subscriptions.ListSubscriptionTransactionsError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.listSubscriptionTransactions({ id: "some example string", startTime: "some example string", endTime: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type TransactionsList } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. startTimestringThe start time of the range of transactions to list. endTimestringThe end time of the range of transactions to list.
-
Direct:
await client.subscriptions.listSubscriptionTransactions(request)- OnSuccess:
TransactionsList - OnError: throws
Subscriptions.ListSubscriptionTransactionsError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.listSubscriptionTransactions(request).asApiResult()- OnSuccess:
ApiResult<TransactionsList, Subscriptions.ListSubscriptionTransactionsError>, withresult.valueof typeTransactionsList - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
listSubscriptions(request: Subscriptions.ListSubscriptionsRequest, options?: RequestOptions): ApiPromise<SubscriptionCollection, Subscriptions.ListSubscriptionsError>
-
-
List all subscriptions for merchant account.
-
try { const response = await client.subscriptions.listSubscriptions(); // TODO: Handle 'response' of type SubscriptionCollection } catch (err) { // TODO: Handle 'err' of type Subscriptions.ListSubscriptionsError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.listSubscriptions().asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type SubscriptionCollection } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description planIds?stringFilters the response by list of plan IDs. Filter supports upto 70 plan IDs. URLs should not exceed a length of 2000 characters. statuses?stringFilters the response by list of subscription statuses. createdAfter?stringFilters the response by subscription creation start time for a range of subscriptions. createdBefore?stringFilters the response by subscription creation end time for a range of subscriptions. statusUpdatedBefore?stringFilters the response by status update start time for a range of subscriptions. statusUpdatedAfter?stringFilters the response by status update end time for a range of subscriptions. filter?stringFilter the response using complex expressions that could use comparison operators like ge, gt, le, lt and logical operators such as 'and' and 'or'. pageSize?numberThe number of items to return in the response.
Default: 10page?numberA non-zero integer which is the start index of the entire list of items to return in the response. The combination of page=1andpage_size=20returns the first 20 items. The combination ofpage=2andpage_size=20returns the next 20 items.
Default: 1customerIds?string[]Filters the response by comma separated vault customer IDs (FSS subscriptions only).
-
Direct:
await client.subscriptions.listSubscriptions(request)- OnSuccess:
SubscriptionCollection - OnError: throws
Subscriptions.ListSubscriptionsError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.listSubscriptions(request).asApiResult()- OnSuccess:
ApiResult<SubscriptionCollection, Subscriptions.ListSubscriptionsError>, withresult.valueof typeSubscriptionCollection - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
patchBillingPlan(request: Subscriptions.PatchBillingPlanRequest, options?: RequestOptions): ApiPromise<undefined, Subscriptions.PatchBillingPlanError>
-
-
Updates a plan with the
CREATEDorACTIVEstatus. For anINACTIVEplan, you can make only status updates. You can patch these attributes and objects: Attribute or object Operations description replace payment_preferences.auto_bill_outstanding replace taxes.percentage replace payment_preferences.payment_failure_threshold replace payment_preferences.setup_fee replace payment_preferences.setup_fee_failure_action replace name replace
-
try { await client.subscriptions.patchBillingPlan({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.PatchBillingPlanError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.patchBillingPlan({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the plan. body?Patch[]-
-
Direct:
await client.subscriptions.patchBillingPlan(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.PatchBillingPlanError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.patchBillingPlan(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.PatchBillingPlanError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
patchSubscription(request: Subscriptions.PatchSubscriptionRequest, options?: RequestOptions): ApiPromise<undefined, Subscriptions.PatchSubscriptionError>
-
-
Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan level default attributes by providing customised values for plan path in the patch request. You cannot update attributes that have already completed (Example - trial cycles can’t be updated if completed). Once overridden, changes to plan resource will not impact subscription. Any price update will not impact billing cycles within next 10 days (Applicable only for subscriptions funded by PayPal account). Following are the fields eligible for patch. Attribute or object Operations billing_info.outstanding_balance replace custom_id add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.fixed_price add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace plan.billing_cycles[@sequence==n]. total_cycles replace plan.payment_preferences. auto_bill_outstanding replace plan.payment_preferences. payment_failure_threshold replace plan.taxes.inclusive add,replace plan.taxes.percentage add,replace shipping_amount add,replace start_time replace subscriber.shipping_address add,replace subscriber.payment_source (for subscriptions funded by card payments) replace
-
try { await client.subscriptions.patchSubscription({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.PatchSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.patchSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID for the subscription. body?Patch[]-
-
Direct:
await client.subscriptions.patchSubscription(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.PatchSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.patchSubscription(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.PatchSubscriptionError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
reviseSubscription(request: Subscriptions.ReviseSubscriptionRequest, options?: RequestOptions): ApiPromise<ModifySubscriptionResponse, Subscriptions.ReviseSubscriptionError>
-
-
Updates the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the
shipping_amount,shipping_addressvalues for the subscription. This type of update requires the buyer's consent.
-
try { const response = await client.subscriptions.reviseSubscription({ id: "some example string" }); // TODO: Handle 'response' of type ModifySubscriptionResponse } catch (err) { // TODO: Handle 'err' of type Subscriptions.ReviseSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.reviseSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: Use 'result.value' of type ModifySubscriptionResponse } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. body?ModifySubscriptionRequest-
-
Direct:
await client.subscriptions.reviseSubscription(request)- OnSuccess:
ModifySubscriptionResponse - OnError: throws
Subscriptions.ReviseSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.reviseSubscription(request).asApiResult()- OnSuccess:
ApiResult<ModifySubscriptionResponse, Subscriptions.ReviseSubscriptionError>, withresult.valueof typeModifySubscriptionResponse - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
suspendSubscription(request: Subscriptions.SuspendSubscriptionRequest, options?: RequestOptions): ApiPromise<undefined, Subscriptions.SuspendSubscriptionError>
-
-
Suspends the subscription.
-
try { await client.subscriptions.suspendSubscription({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.SuspendSubscriptionError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.suspendSubscription({ id: "some example string" }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID of the subscription. body?SuspendSubscription-
-
Direct:
await client.subscriptions.suspendSubscription(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.SuspendSubscriptionError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.suspendSubscription(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.SuspendSubscriptionError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-
updateBillingPlanPricingSchemes(request: Subscriptions.UpdateBillingPlanPricingSchemesRequest, options?: RequestOptions): ApiPromise<undefined, Subscriptions.UpdateBillingPlanPricingSchemesError>
-
-
Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month.
-
try { await client.subscriptions.updateBillingPlanPricingSchemes({ id: "some example string" }); } catch (err) { // TODO: Handle 'err' of type Subscriptions.UpdateBillingPlanPricingSchemesError, discriminated with 'err.payload.kind' }
-
const result = await client.subscriptions.updateBillingPlanPricingSchemes({ id: "some example string", }).asApiResult(); // TODO: Use 'result.status' and 'result.headers' to read the raw response status and headers if (result.ok) { // TODO: The call succeeded and resolves to no body } else { // TODO: Handle 'result', discriminated with 'result.payload.kind' }
-
Name Type Description idstringThe ID for the plan. body?UpdatePricingSchemesRequest-
-
Direct:
await client.subscriptions.updateBillingPlanPricingSchemes(request)- OnSuccess:
undefined - OnError: throws
Subscriptions.UpdateBillingPlanPricingSchemesError, witherr.payloaddiscriminated onkind
As ApiResult:
await client.subscriptions.updateBillingPlanPricingSchemes(request).asApiResult()- OnSuccess:
ApiResult<undefined, Subscriptions.UpdateBillingPlanPricingSchemesError>, withresult.valueof typeundefined - OnError:
result.payloaddiscriminated onkind, withresult.message
Thrown:
PaypalErroron any operational failure — a caller abort and a programmer error stay outside the family and reach you raw - OnSuccess:
-