@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Payments
@base https://api-m.sandbox.paypal.com
@version 2.8
@auth OAuth2
@endpoints 7
@toc payments(7)

@endpoint GET /v2/payments/authorizations/{authorization_id}
@required {authorization_id: str}
@optional {PayPal-Auth-Assertion: str}
@returns(200)
@errors {401, 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: map{currency_code!: str, value!: str}}
@returns(200)
@returns(201)
@errors {400, 401, 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: map{currency_code!: str, value!: str}, custom_id: str, invoice_id: str, note_to_payer: str, payment_instruction: map{platform_fees: [map]}}
@returns(200)
@returns(201)
@errors {400, 401, 403, 404, 409, 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
