@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Payments
@base https://api-m.paypal.com
@version 2.12
@auth OAuth2
@common_fields {Authorization: str}
@endpoints 8
@toc payments(8)

@endpoint GET /v2/payments/authorizations/{authorization_id}
@required {authorization_id: str}
@optional {PayPal-Auth-Assertion: str}
@returns(200)
@errors {401, 403, 404, 500}

@endpoint POST /v2/payments/authorizations/{authorization_id}/capture
@required {authorization_id: str}
@optional {PayPal-Request-Id: str, Prefer: str=return=minimal, PayPal-Auth-Assertion: str}
@returns(200)
@returns(201)
@errors {400, 401, 403, 404, 409, 422, 500}

@endpoint POST /v2/payments/authorizations/{authorization_id}/reauthorize
@required {authorization_id: str}
@optional {PayPal-Request-Id: str, Prefer: str=return=minimal, PayPal-Auth-Assertion: str, amount: any}
@returns(200)
@returns(201)
@errors {400, 401, 403, 404, 422, 500}

@endpoint POST /v2/payments/authorizations/{authorization_id}/void
@required {authorization_id: str}
@optional {PayPal-Auth-Assertion: str, PayPal-Request-Id: str, Prefer: str=return=minimal}
@returns(200)
@returns(204)
@errors {401, 403, 404, 409, 422, 500}

@endpoint GET /v2/payments/captures/{capture_id}
@required {capture_id: str}
@returns(200)
@errors {401, 403, 404, 500}

@endpoint POST /v2/payments/captures/{capture_id}/refund
@required {capture_id: str}
@optional {PayPal-Request-Id: str, Prefer: str=return=minimal, PayPal-Auth-Assertion: str, amount: any, custom_id: str, invoice_id: str, note_to_payer: str, payment_instruction: any}
@returns(200)
@returns(201)
@errors {400, 401, 403, 404, 409, 422, 500}

@endpoint POST /v2/payments/find-eligible-methods
@optional {PayPal-Auth-Assertion: str, User-Agent: str, PayPal-Client-Metadata-Id: str, customer: map{country_code: any, channel: any, id: str, email: str, phone: any}, purchase_units: [map{amount: map, payee: map}], preferences: map{payment_flow: str, include_account_details: bool, include_vault_tokens: bool, payment_source_constraint: map}}
@returns(200) {eligible_methods: any, payment_tokens: [any]}
@errors {400, 401, 403, 422, 500}

@endpoint GET /v2/payments/refunds/{refund_id}
@required {refund_id: str}
@optional {PayPal-Auth-Assertion: str}
@returns(200)
@errors {401, 403, 404, 500}

@end
