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

@endpoint POST /v2/checkout/orders
@required {intent: str(CAPTURE/AUTHORIZE), purchase_units: [any]}
@optional {PayPal-Request-Id: str, PayPal-Partner-Attribution-Id: str, PayPal-Client-Metadata-Id: str, Prefer: str=return=minimal, PayPal-Auth-Assertion: str, payer: any, payment_source: map{card: map, token: map, paypal: any, bancontact: any, blik: any, eps: any, giropay: any, ideal: any, mybank: any, p24: any, sofort: any, trustly: any, apple_pay: any, google_pay: any, venmo: any, crypto: any}, application_context: any}
@returns(200)
@returns(201)
@returns(202)
@errors {400, 401, 403, 422, 500}

@endpoint GET /v2/checkout/orders/{id}
@required {id: str}
@optional {PayPal-Auth-Assertion: str, fields: str}
@returns(200)
@errors {401, 403, 404, 500}

@endpoint PATCH /v2/checkout/orders/{id}
@required {id: str}
@optional {PayPal-Auth-Assertion: str}
@returns(204)
@errors {400, 401, 403, 404, 422, 500}

@endpoint POST /v2/checkout/orders/{id}/confirm-payment-source
@required {id: str, payment_source: map{card: map, token: map, paypal: any, bancontact: any, blik: any, eps: any, giropay: any, ideal: any, mybank: any, p24: any, sofort: any, trustly: any, apple_pay: any, google_pay: any, venmo: any, crypto: any}}
@optional {PayPal-Client-Metadata-Id: str, PayPal-Auth-Assertion: str, Prefer: str=return=minimal, application_context: map{brand_name: str, locale: any, return_url: str(uri), cancel_url: str(uri), stored_payment_source: map}}
@returns(200)
@errors {400, 401, 403, 422, 500}

@endpoint POST /v2/checkout/orders/{id}/authorize
@required {id: str}
@optional {PayPal-Request-Id: str, Prefer: str=return=minimal, PayPal-Client-Metadata-Id: str, PayPal-Auth-Assertion: str, payment_source: any}
@returns(200)
@returns(201)
@returns(202)
@returns(207)
@errors {400, 401, 403, 404, 409, 422, 500}

@endpoint POST /v2/checkout/orders/{id}/capture
@required {id: str}
@optional {PayPal-Request-Id: str, Prefer: str=return=minimal, PayPal-Client-Metadata-Id: str, PayPal-Auth-Assertion: str, payment_source: any}
@returns(200)
@returns(201)
@returns(202)
@returns(207)
@errors {400, 401, 403, 404, 409, 422, 500}

@endpoint POST /v2/checkout/orders/{id}/track
@required {id: str}
@optional {PayPal-Auth-Assertion: str}
@returns(200)
@returns(201)
@errors {400, 401, 403, 404, 422, 500}

@endpoint PATCH /v2/checkout/orders/{id}/trackers/{tracker_id}
@required {id: str, tracker_id: str}
@optional {PayPal-Auth-Assertion: str}
@returns(204)
@errors {400, 401, 403, 404, 422, 500}

@endpoint POST /v2/checkout/orders/order-update-callback
@required {purchase_units: [any]}
@optional {id: str, shipping_address: any, shipping_option: any}
@returns(200) {id: str}
@errors {400, 401, 403, 422, 500}

@end
