{"files":{"SKILL.md":"---\nname: payments\ndescription: \"Payments API skill. Use when working with Payments for payments. Covers 8 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Payments\nAPI version: 2.12\n\n## Auth\nOAuth2\n\n## Base URL\nhttps://api-m.paypal.com\n\n## Setup\n1. Configure auth: OAuth2\n2. GET /v2/payments/authorizations/{authorization_id} -- verify access\n3. POST /v2/payments/authorizations/{authorization_id}/capture -- create first capture\n\n## Endpoints\n\n8 endpoints across 1 groups. See references/api-spec.lap for full details.\n\n### payments\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v2/payments/authorizations/{authorization_id} | Show details for authorized payment |\n| POST | /v2/payments/authorizations/{authorization_id}/capture | Capture authorized payment |\n| POST | /v2/payments/authorizations/{authorization_id}/reauthorize | Reauthorize authorized payment |\n| POST | /v2/payments/authorizations/{authorization_id}/void | Void authorized payment |\n| GET | /v2/payments/captures/{capture_id} | Show captured payment details |\n| POST | /v2/payments/captures/{capture_id}/refund | Refund captured payment |\n| POST | /v2/payments/find-eligible-methods | Find a list of eligible payment methods. |\n| GET | /v2/payments/refunds/{refund_id} | Show refund details |\n\n## Common Questions\n\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"Get authorization details?\" -> GET /v2/payments/authorizations/{authorization_id}\n- \"Create a capture?\" -> POST /v2/payments/authorizations/{authorization_id}/capture\n- \"Create a reauthorize?\" -> POST /v2/payments/authorizations/{authorization_id}/reauthorize\n- \"Create a void?\" -> POST /v2/payments/authorizations/{authorization_id}/void\n- \"Get capture details?\" -> GET /v2/payments/captures/{capture_id}\n- \"Create a refund?\" -> POST /v2/payments/captures/{capture_id}/refund\n- \"Create a find-eligible-method?\" -> POST /v2/payments/find-eligible-methods\n- \"Get refund details?\" -> GET /v2/payments/refunds/{refund_id}\n- \"How to authenticate?\" -> See Auth section\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints typically return the created/updated object\n\n## CLI\n\n```bash\n# Update this spec to the latest version\nnpx @lap-platform/lapsh get payments -o references/api-spec.lap\n\n# Search for related APIs\nnpx @lap-platform/lapsh search payments\n```\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Payments\n@base https://api-m.paypal.com\n@version 2.12\n@auth OAuth2\n@common_fields {Authorization: str # Holds authorization information for external API calls.}\n@endpoints 8\n@toc payments(8)\n\n@endpoint GET /v2/payments/authorizations/{authorization_id}\n@desc Show details for authorized payment\n@required {authorization_id: str # The ID of the authorized payment for which to show details.}\n@optional {PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header.}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows authorization details.\n@errors {401: Unauthorized., 403: Forbidden., 404: Not Found., 500: Internal Server Error.}\n\n@endpoint POST /v2/payments/authorizations/{authorization_id}/capture\n@desc Capture authorized payment\n@required {authorization_id: str # The PayPal-generated ID for the authorized payment to capture.}\n@optional {PayPal-Request-Id: str # A unique ID identifying the request header for idempotency purposes., Prefer: str=return=minimal # The 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., PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header.}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows captured payment details.\n@returns(201) A successful request returns the HTTP 201 Created status code and a JSON response body that shows captured payment details.\n@errors {400: The request failed because it is not well-formed or is syntactically incorrect or violates schema., 401: Unauthorized., 403: Forbidden., 404: Not Found., 409: The server has detected a conflict while processing this request., 422: The request failed because it is semantically incorrect or failed business validation., 500: Internal Server Error.}\n@example_request {\"amount\":{\"value\":\"10.99\",\"currency_code\":\"USD\"},\"invoice_id\":\"INVOICE-123\",\"final_capture\":true,\"note_to_payer\":\"If the ordered color is not available, we will substitute with a different color free of charge.\",\"soft_descriptor\":\"Bob's Custom Sweaters\"}\n\n@endpoint POST /v2/payments/authorizations/{authorization_id}/reauthorize\n@desc Reauthorize authorized payment\n@required {authorization_id: str # The PayPal-generated ID for the authorized payment to reauthorize.}\n@optional {PayPal-Request-Id: str # A unique ID identifying the request header for idempotency purposes., Prefer: str=return=minimal # The 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., PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header., amount: any}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows the reauthorized payment details.\n@returns(201) A successful request returns the HTTP 201 Created status code and a JSON response body that shows the reauthorized payment details.\n@errors {400: The request failed because it is not well-formed or is syntactically incorrect or violates schema., 401: Unauthorized., 403: Forbidden., 404: Not Found., 422: The request failed because it either is semantically incorrect or failed business validation., 500: Internal Server Error.}\n@example_request {\"amount\":{\"value\":\"10.99\",\"currency_code\":\"USD\"}}\n\n@endpoint POST /v2/payments/authorizations/{authorization_id}/void\n@desc Void authorized payment\n@required {authorization_id: str # The PayPal-generated ID for the authorized payment to void.}\n@optional {PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header., PayPal-Request-Id: str # A unique ID identifying the request header for idempotency purposes., Prefer: str=return=minimal # The 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.}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows authorization details. This response is returned when the Prefer header is set to return=representation.\n@returns(204) No Content.\n@errors {401: Unauthorized., 403: Forbidden., 404: Not Found., 409: The request failed because a previous call for the given resource is in progress., 422: The request failed because it either is semantically incorrect or failed business validation., 500: Internal Server Error.}\n\n@endpoint GET /v2/payments/captures/{capture_id}\n@desc Show captured payment details\n@required {capture_id: str # The PayPal-generated ID for the captured payment for which to show details.}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows captured payment details.\n@errors {401: Unauthorized., 403: Forbidden., 404: Not Found., 500: Internal Server Error.}\n\n@endpoint POST /v2/payments/captures/{capture_id}/refund\n@desc Refund captured payment\n@required {capture_id: str # The PayPal-generated ID for the captured payment to refund.}\n@optional {PayPal-Request-Id: str # A unique ID identifying the request header for idempotency purposes., Prefer: str=return=minimal # The 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., PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header., amount: any, custom_id: str # The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. The pattern is defined by an external party and supports Unicode., invoice_id: str # The API caller-provided external invoice ID for this order. The pattern is defined by an external party and supports Unicode., note_to_payer: str # The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives. The pattern is defined by an external party and supports Unicode., payment_instruction: any}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows refund details.\n@returns(201) A successful request returns the HTTP 201 Created status code and a JSON response body that shows refund details.\n@errors {400: The request failed because it is not well-formed or is syntactically incorrect or violates schema., 401: Unauthorized., 403: Forbidden., 404: Not Found., 409: The request failed because a previous call for the given resource is in progress., 422: The request failed because it either is semantically incorrect or failed business validation., 500: Internal Server Error.}\n@example_request {\"amount\":{\"value\":\"1.00\",\"currency_code\":\"USD\"},\"invoice_id\":\"RefundInvoice-123\",\"custom_id\":\"RefundCustom-123\"}\n\n@endpoint POST /v2/payments/find-eligible-methods\n@desc Find a list of eligible payment methods.\n@optional {PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header., User-Agent: str # A characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent. API calls made by PayPal SDKs SHOULD be identified using this request header., PayPal-Client-Metadata-Id: str # A GUID value originating from Fraudnet and Dyson passed from external API clients via HTTP header. The value is used by Risk decisions to correlate calls which, in turn, might result in lower decline rates.., customer: map{country_code: any, channel: any, id: str, email: str, phone: any} # Customer who is making a purchase from the merchant/partner., purchase_units: [map{amount: map, payee: map}] # Array of purchase units., preferences: map{payment_flow: str, include_account_details: bool, include_vault_tokens: bool, payment_source_constraint: map} # Preferences of merchant/partner consuming the API.}\n@returns(200) {eligible_methods: any, payment_tokens: [any]} # A successful request returns the HTTP 200 OK status code and a JSON response body that provides list of eligibile payments.\n@errors {400: The request failed because it is not well-formed or is syntactically incorrect or violates schema., 401: Unauthorized., 403: Forbidden., 422: The request failed because it either is semantically incorrect or failed business validation., 500: Internal Server Error.}\n@example_request {\"customer\":{\"country_code\":\"US\",\"channel\":{\"browser_type\":\"SAFARI\",\"device_type\":\"MOBILE\",\"client_os\":\"IOS\"}},\"purchase_units\":[{\"amount\":{\"currency_code\":\"USD\",\"value\":\"100.00\"}}],\"preferences\":{\"payment_source_constraint\":{\"constraint_type\":\"EXCLUDE\",\"payment_sources\":[\"PAYPAL\"]}}}\n\n@endpoint GET /v2/payments/refunds/{refund_id}\n@desc Show refund details\n@required {refund_id: str # The PayPal-generated ID for the refund for which to show details.}\n@optional {PayPal-Auth-Assertion: str # Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header.}\n@returns(200) A successful request returns the HTTP 200 OK status code and a JSON response body that shows refund details.\n@errors {401: Unauthorized., 403: Forbidden., 404: Not Found., 500: Internal Server Error.}\n\n@end\n"}}