PayPal Payment Resource

The following is a detailed overview of the API specification.

RequestAnchorIcon

Main FieldsAnchorIcon

FieldTypeDescription
amountdecimalUse this field to update the amount of the PayPal payment resource.
amount_breakdownobjectThe breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any.
custom_fieldstringVariable passed directly to PayPal via the API for your own tracking purposes. Customers do not see this value, but you can see it in reports from your PayPal console. Maximum 255 characters.
currency_iso_codestringThe currency for the PayPal payment resource. The three-letter alphabetic codes for the PayPal payment resource’s currency (e.g. USD for US dollars). Required if amount is provided.
descriptionstringDescription of the PayPal order. Maximum 127 characters.
order_idstringUse this field to include an order ID on the PayPal order. This field maps to the PayPal invoice number. PayPal invoice numbers must be unique in your PayPal business account. Maximum 127 characters.
payee_emailstringThe PayPal account email for the business account into which funds will be deposited (if different from the PayPal account linked in your Braintree Control Panel).
payment_method_noncestringOne-time-use reference to payment information provided by your customer, such as a PayPal account. Required.
line_itemsarrayThe line items for this payment resource. It can include up to 249 line items.
shippingobjectShipping address information associated with this PayPal payment method for this customer.
shipping_optionsarrayAn array of shipping options that the merchant offers to the customer to ship or pick up their items.

Breakdown Amount SubfieldsAnchorIcon

FieldTypeDescription
discountstringTotal discount, cannot be negative.
handlingstringHandling fee, non-negative.
insurancestringInsurance fee, non-negative.
item_totalstringSubtotal of items. Required if unit_amount is set.
shippingstringShipping fee, non-negative.
shipping_discountstringShipping discount, non-negative.
tax_totalstringTax total. Required if unit_tax_amount is set.

Line Item FieldsAnchorIcon

FieldTypeDescription
quantitydecimalItem quantity. Only integer is allowed and it must be > 0. Required.
unit_amountdecimalPrice per unit. Max 2 decimals, ≥ 0. Required.
unit_tax_amountdecimalPer-unit tax. Max 2 decimals.
namestringItem name. Max 127 characters. Required.
descriptionstringItem description. Max 127 characters.
kindstringdebitRequired.
product_codestringMax 127 characters.
total_amountdecimalQuantity × unit amount. Required.
urlstringProduct information URL.
item_typestringOptional: physical, digital, etc.
upc_codestringUPC code, max 17 characters.
upc_typestringUPC type, e.g., UPC-A, UPC-E, etc.

Shipping FieldsAnchorIcon

FieldTypeDescription
first_namestringThe first name. The combined full name value must be less than or equal to 300 characters.
last_namestringThe last name. The combined full name value must be less than or equal to 300 characters.
street_addressstringRequired. The street address. The street address value must be less than or equal to 300 characters.
extended_addressstringThe extended address information—such as apartment or suite number. The extended address value must be less than or equal to 300 characters.
localitystringRequired. The locality/city. The locality value must be less than or equal to 120 characters.
postal_codestringThe postal code. Postal code must be less than 60 characters.
regionstringThe state or province. The region value must be less than or equal to 300 characters.
country_code_alpha2stringOne of country_code_alpha2, country_code_alpha3, country_code_numeric, or country_name is required.
country_code_alpha3stringOne of country_code_alpha2, country_code_alpha3, country_code_numeric, or country_name is required.
country_code_numericstringOne of country_code_alpha2, country_code_alpha3, country_code_numeric, or country_name is required.
country_namestringOne of country_code_alpha2, country_code_alpha3, country_code_numeric, or country_name is required.
international_phonemapThe phone number that belongs to the address that is structured with country code and national number.

Shipping Options FieldsAnchorIcon

FieldTypeDescription
amountstringCost of the shipping option. Required.
idstringUnique ID (≤ 127 chars). Required.
selectedbooleanSet to true for selected shipping option. Only one allowed. Required.
labelstringDescription visible to customer. ≤ 127 chars. Required.
typestringSHIPPING, PICKUP_IN_STORE, or PICKUP_FROM_PERSON

ResponseAnchorIcon

FieldTypeDescription
noncestringOne-time-use token that references a payment method.
typestringPayPalAccount is always returned for this response.
consumedstringfalse is always returned, indicating that the nonce has been newly created.
descriptionstringPayPal is always returned for this response.

Validation ErrorsAnchorIcon

The following is a list of validation errors that can be returned when attempting to update a PayPal payment resource. Each error includes an error code, error text, and description.

CodeError TextDescription
97301The provided payment method nonce is expired or consumed.The payment method nonce has either expired or consumed. Nonces are deleted upon expiration (3 hours after generation).
97302PayPal payment resource id is not supported.The PayPal payment resource id stored in payment method nonce is not supported for the patch operations.
97303Payment method nonce is required.The payment method nonce is required for patch operations.
97304Payee email is an invalid format.Email must be a well-formed email address.
97305Payee email is too long.Maximum 254 characters.
97306Expected a collection of line items but different format provided.Expected a collection of line items but unrecognized data provided.
97307Expected a hash object of line item but different format provided.Expected a hash object of line item but unrecognized data provided.
97308Expected a debit type for each line item.Line item type must be 'debit'.
97309Unit amount is an invalid format.Unit amount must be formatted like '10', '10.00', or '10.0000'.
97310Unit tax Amount is an invalid format.Unit tax amount must be formatted like '10' or '10.00'. If the currency does not use decimal places, the unit tax amount can’t include decimal places.
97311currency_iso_code is required with amount provided.currency_iso_code is required when amount provided.
97312currency_iso_code is not supported.currency_iso_code is not supported by PayPal.
97313Some of required fields are missing from shipping address.Some of required fields are missing from shipping address.
97314Amount breakdown is an invalid format.Some of the fields in amount breakdown object are provided with invalid format.
97315Expected a collection of shipping options but a different format was provided.Expected a collection of shipping options but unrecognized data provided.
97316Expected a collection of shipping options but none provided.Expected a collection of shipping options but none provided.
97317Expected id, label, and selected shipping option fields to be provided.Expected a list of required fields to be provided including id, label, and selected.
97318Shipping option type can only be SHIPPING, PICKUP_IN_STORE, or PICKUP_FROM_PERSON.Shipping option type can only be SHIPPING, PICKUP_IN_STORE, or PICKUP_FROM_PERSON.
97319Expected a unique id for each shipping option.A unique id is required for each shipping option.
97320Shipping option should have only one been selected.The shipping options should have only been selected.
97321Selected Shipping option amount should match shipping in amount breakdown object.Selected Shipping option amount should match shipping in amount breakdown object.
97322The accumulated item amount from line_items should match item_total in amount breakdown object.The accumulated item amount from line_items should match item_total in amount breakdown object.
97323The accumulated tax amount from line_items should match tax_total in amount breakdown object.The accumulated tax amount from line_items should match tax_total in amount breakdown object.
97324The PayPal patch payment resource call failed.The PayPal patch payment resource call failed.
97325The specified amount has an invalid format.The specified amount has an invalid format.
97326The shipping option id is too long.The shipping option id is too long.
97327The shipping option label is too long.The shipping option label is too long.
97328The combined shipping full name from first name and last name is too long.The combined shipping full name from first name and last name is too long.
97329The shipping street address is too long.The shipping street address is too long.
97330The shipping extended address is too long.The shipping extended address is too long.
97331The shipping locality is too long.The shipping locality is too long.
97332The shipping region is too long.The Shipping region is too long.
97333The country code value in shipping international phone object is too long.The country code value in shipping international phone object is too long.
97334The national number value in shipping international phone object is too long.The national number value in shipping international phone object is too long.
97335The shipping postal code is too long.The shipping postal code is too long.
97336The description is too long.The description is too long.
97337The custom field is too long.The custom field is too long.
97338The order id is too long.The order id is too long.
97339Contact preference value is invalid.Valid values are "NO_CONTACT_INFO", "RETAIN_CONTACT_INFO" and "UPDATE_CONTACT_INFO".