Instant Payouts

DOCS

Last updated: Dec 20th, 6:14pm


You can use the Orders API to instantly pay out orders to your sellers.

Integration steps

  1. Before you can integrate a PayPal product or solution, you must set up your development environment to get OAuth 2.0 client ID and secret credentials for the sandbox and live environments. You exchange these credentials for an access token that authorizes your REST API calls. To test your web and mobile apps, you create sandbox accounts. See Get Started.
  2. Complete an order.
  3. Get order details.

Complete an order

To execute a payment for an order, pass the order ID as a path parameter to POST v2/checkout/orders/{order_id}/capture.

In addition to the standard Accept, Content-Type, PayPal-Request-Id, and Authorization headers, include the PayPal-Partner-Attribution-Id header.

Request

    1curl -v -k -X POST 'https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T/capture' \
    2 -H 'PayPal-Request-Id: 7b92603e-77ed-4896-8e78-5dea2050476a' \
    3 -H 'PayPal-Partner-Attribution-Id: Example_Marketplace' \
    4 -H 'Authorization: Bearer <Access-Token>' \
    5 -H 'Content-Type: application/json' \
    6 -d '{}'

    Response

    A successful request returns the HTTP 201 Created status code and a JSON response body that shows order details, including the id field, which is the seller's transaction ID. Use this ID to complete other operations on the captured payment, such as refund or chargeback a captured payment.

      1{
      2"id": "5O190127TN364715T",
      3"status": "COMPLETED",
      4"payer": {
      5 "name": {
      6 "given_name": "John",
      7 "surname": "Doe"
      8 },
      9 "email_address": "customer@example.com",
      10 "payer_id": "QYR5Z8XDVJNXQ",
      11 "phone": {
      12 "phone_number": {
      13 "national_number": "8882211161"
      14 }
      15 },
      16 "address": {
      17 "address_line_1": "2211 N First Street",
      18 "address_line_2": "Building 17",
      19 "admin_area_2": "San Jose",
      20 "admin_area_1": "CA",
      21 "postal_code": "95131",
      22 "country_code": "US"
      23 }
      24},
      25"purchase_units": [{
      26 "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
      27 "shipping": {
      28 "method": "United States Postal Service",
      29 "name": {
      30 "full_name": "John Williams"
      31 },
      32 "address": {
      33 "address_line_1": "2211 N First Street",
      34 "address_line_2": "Building 17",
      35 "admin_area_2": "San Jose",
      36 "admin_area_1": "CA",
      37 "postal_code": "95131",
      38 "country_code": "US"
      39 }
      40 },
      41 "payments": {
      42 "captures": [{
      43 "id": "3C679366HH908993F",
      44 "status": "COMPLETED",
      45 "amount": {
      46 "currency_code": "USD",
      47 "value": "100.00"
      48 },
      49 "seller_protection": {
      50 "status": "ELIGIBLE",
      51 "dispute_categories": [
      52 "ITEM_NOT_RECEIVED",
      53 "UNAUTHORIZED_TRANSACTION"
      54 ]
      55 },
      56 "final_capture": true,
      57 "seller_receivable_breakdown": {
      58 "gross_amount": {
      59 "currency_code": "USD",
      60 "value": "100.00"
      61 },
      62 "paypal_fee": {
      63 "currency_code": "USD",
      64 "value": "3.00"
      65 },
      66 "payment_instruction": {
      67 "platform_fees": [{
      68 "amount": {
      69 "currency_code": "USD",
      70 "value": "25.00"
      71 },
      72 "payee": {
      73 "email_address": "fee@example.com"
      74 }
      75 }]
      76 },
      77 "net_amount": {
      78 "currency_code": "USD",
      79 "value": "72.00"
      80 }
      81 },
      82 "disbursement_mode": "INSTANT",
      83 "create_time": "2018-04-01T21:20:49Z",
      84 "update_time": "2018-04-01T21:20:49Z",
      85 "links": [{
      86 "href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F",
      87 "rel": "self",
      88 "method": "GET"
      89 },
      90 {
      91 "href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F/refund",
      92 "rel": "refund",
      93 "method": "POST"
      94 }
      95 ]
      96 }]
      97 }
      98}],
      99"links": [{
      100 "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
      101 "rel": "self",
      102 "method": "GET"
      103}]
      104}

      Get order details

      To get order details, pass the order ID as a path parameter in a GET /v2/checkout/orders/{order_id} call.

      Sample request

        1curl -v -k -X GET 'https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T' \
        2 -H 'Content-Type: application/json' \
        3 -H 'Authorization: Bearer <Access-Token>' \

        Sample response

        A successful request returns the HTTP 200 OK status code and a JSON response body that shows order details:

          1{
          2 "id": "5O190127TN364715T",
          3 "status": "COMPLETED",
          4 "intent": "CAPTURE",
          5 "gross_amount": {
          6 "currency_code": "USD",
          7 "value": "100.00"
          8 },
          9 "payer": {
          10 "name": {
          11 "given_name": "John",
          12 "surname": "Doe"
          13 },
          14 "email_address": "customer@example.com",
          15 "payer_id": "QYR5Z8XDVJNXQ",
          16 "phone": {
          17 "phone_number": {
          18 "national_number": "8882211161"
          19 }
          20 },
          21 "address": {
          22 "address_line_1": "2211 N First Street",
          23 "address_line_2": "Building 17",
          24 "admin_area_2": "San Jose",
          25 "admin_area_1": "CA",
          26 "postal_code": "95131",
          27 "country_code": "US"
          28 }
          29 },
          30 "purchase_units": [
          31 {
          32 "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
          33 "amount": {
          34 "currency_code": "USD",
          35 "value": "100.00"
          36 },
          37 "payee": {
          38 "email_address": "merchant@example.com"
          39 },
          40 "payment_instruction": {
          41 "disbursement_mode": "DELAYED",
          42 "platform_fees": [
          43 {
          44 "amount": {
          45 "currency_code": "USD",
          46 "value": "25.00"
          47 },
          48 "payee": {
          49 "email_address": "fee@example.com"
          50 }
          51 }
          52 ]
          53 },
          54 "shipping": {
          55 "method": "United States Postal Service",
          56 "name": {
          57 "full_name": "John Williams"
          58 },
          59 "address": {
          60 "address_line_1": "2211 N First Street",
          61 "address_line_2": "Building 17",
          62 "admin_area_2": "San Jose",
          63 "admin_area_1": "CA",
          64 "postal_code": "95131",
          65 "country_code": "US"
          66 }
          67 },
          68 "payments": {
          69 "captures": [
          70 {
          71 "id": "3C679366HH908993F",
          72 "status": "COMPLETED",
          73 "amount": {
          74 "currency_code": "USD",
          75 "value": "100.00"
          76 },
          77 "seller_protection": {
          78 "status": "ELIGIBLE",
          79 "dispute_categories": [
          80 "ITEM_NOT_RECEIVED",
          81 "UNAUTHORIZED_TRANSACTION"
          82 ]
          83 },
          84 "final_capture": true,
          85 "seller_receivable_breakdown": {
          86 "gross_amount": {
          87 "currency_code": "USD",
          88 "value": "100.00"
          89 },
          90 "paypal_fee": {
          91 "currency_code": "USD",
          92 "value": "3.00"
          93 },
          94 "platform_fees": [
          95 {
          96 "amount": {
          97 "currency_code": "USD",
          98 "value": "25.00"
          99 },
          100 "payee": {
          101 "email_address": "fee@example.com"
          102 }
          103 }
          104 ],
          105 "net_amount": {
          106 "currency_code": "USD",
          107 "value": "72.00"
          108 }
          109 },
          110 "create_time": "2018-04-01T21:20:49Z",
          111 "update_time": "2018-04-01T21:20:49Z",
          112 "links": [
          113 {
          114 "href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F",
          115 "rel": "self",
          116 "method": "GET"
          117 },
          118 {
          119 "href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F/refund",
          120 "rel": "refund",
          121 "method": "POST"
          122 }
          123 ]
          124 }
          125 ]
          126 }
          127 }
          128 ],
          129 "create_time": "2018-04-01T21:18:49Z",
          130 "update_time": "2018-04-01T21:20:49Z",
          131 "links": [
          132 {
          133 "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
          134 "rel": "self",
          135 "method": "GET"
          136 }
          137 ]
          138}