PayPal · Schema

Purchase Unit Request

The purchase unit request. Includes required information for the payment contract.

BillingCommerceDisputesInvoicesOrdersPaymentsPayoutsSubscriptionsTokensWebhooks

Properties

Name Type Description
reference_id string The API caller-provided external ID for the purchase unit. Required for multiple purchase units when you must update the order through `PATCH`. If you omit this value and the order contains only one p
amount object The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any.
If you specify `amou
payee object The merchant who receives payment for this transaction.
payment_instruction object
description string The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of charact
custom_id string The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer.
invoice_id string The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.
soft_descriptor string The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement.

If an Order is paid using the "PayPal Wallet", the statement descrip
items array An array of items that the customer purchases from the merchant.
shipping object The name and address of the person to whom to ship the items.
supplementary_data object Contains Supplementary Data.
View JSON Schema on GitHub

JSON Schema

paypal-purchase-unit-request-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/purchase_unit_request",
  "title": "Purchase Unit Request",
  "type": "object",
  "description": "The purchase unit request. Includes required information for the payment contract.",
  "properties": {
    "reference_id": {
      "type": "string",
      "description": "The API caller-provided external ID for the purchase unit. Required for multiple purchase units when you must update the order through `PATCH`. If you omit this value and the order contains only one purchase unit, PayPal sets this value to `default`.",
      "minLength": 1,
      "maxLength": 256
    },
    "amount": {
      "description": "The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any.<br/>If you specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` plus `handling` plus `insurance` minus `shipping_discount` minus discount.<br/>The amount must be a positive number. The `amount.value` field supports up to 15 digits preceding the decimal. For a list of supported currencies, decimal precision, and maximum charge amount, see the PayPal REST APIs <a href=\"https://developer.paypal.com/api/rest/reference/currency-codes/\">Currency Codes</a>.",
      "$ref": "#/components/schemas/amount_with_breakdown"
    },
    "payee": {
      "description": "The merchant who receives payment for this transaction.",
      "$ref": "#/components/schemas/payee"
    },
    "payment_instruction": {
      "$ref": "#/components/schemas/payment_instruction"
    },
    "description": {
      "type": "string",
      "description": "The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of character; (e.g. accented character, Japanese characters) the number of characters that that can be specified as input might not equal the permissible max length.",
      "minLength": 1,
      "maxLength": 127
    },
    "custom_id": {
      "type": "string",
      "description": "The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer.",
      "minLength": 1,
      "maxLength": 127
    },
    "invoice_id": {
      "type": "string",
      "description": "The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.",
      "minLength": 1,
      "maxLength": 127
    },
    "soft_descriptor": {
      "type": "string",
      "description": "The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement.<br><br>If an Order is paid using the \"PayPal Wallet\", the statement descriptor will appear in following format on the payer's card statement: <code><var>PAYPAL_prefix</var>+(space)+<var>merchant_descriptor</var>+(space)+ <var>soft_descriptor</var></code><blockquote><strong>Note:</strong> The merchant descriptor is the descriptor of the merchant\u2019s payment receiving preferences which can be seen by logging into the merchant account https://www.sandbox.paypal.com/businessprofile/settings/info/edit</blockquote>The <code>PAYPAL</code> prefix uses 8 characters. Only the first 22 characters will be displayed in the statement. <br>For example, if:<ul><li>The PayPal prefix toggle is <code>PAYPAL *</code>.</li><li>The merchant descriptor in the profile is <code>Janes Gift</code>.</li><li>The soft descriptor is <code>800-123-1234</code>.</li></ul>Then, the statement descriptor on the card is <code>PAYPAL * Janes Gift 80</code>.",
      "minLength": 1,
      "maxLength": 22
    },
    "items": {
      "type": "array",
      "description": "An array of items that the customer purchases from the merchant.",
      "items": {
        "description": "The item.",
        "$ref": "#/components/schemas/item"
      }
    },
    "shipping": {
      "description": "The name and address of the person to whom to ship the items.",
      "$ref": "#/components/schemas/shipping_detail"
    },
    "supplementary_data": {
      "description": "Contains Supplementary Data.",
      "$ref": "#/components/schemas/supplementary_data"
    }
  },
  "required": [
    "amount"
  ]
}