On this page
No Headings
Oauth 2.0 authentication
Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/invoicing/invoices/readwritehttps://uri.paypal.com/services/invoicing/internalThe ID of the invoice for which the conditional rules are to be created for.
^INV2-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$24 <= length <= 24Holds authorization information for external API calls.
^.*$1 <= length <= 16000A unique ID identifying the request header for idempotency purposes.
^.*$1 <= length <= 10000application/json
TypeScript Definitions
Use the request body type in TypeScript.
The conditional rules associated with an invoice. Conditional rules define automated actions or adjustments that apply to an invoice based on specific conditions, such as early payment discounts, or auto cancellation.
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-m.sandbox.paypal.com/v2/invoicing/invoices/stringstringstringstring/conditional-rules" \ -H "Authorization: Bearer A21AAGHr9qtiRRXH4oYcQokQgV99rGqEIfgrr8xHCclP0OzmD9KVgg5ppIIg1jzJgQkV4wd02svIvBJyg6cLFJjFow_SjBhxQ" \ -H "PayPal-Request-Id: 17e81d06-77ab-11e8-adc0-fa71639ebebc" \ -H "Content-Type: application/json" \ -d '{}'{
"rules": [
{
"conditional_rule_id": "CR-11FF-A725-27C6999C-A699-33CD614E75EC",
"conditional_rule_type": "EARLY_PAYMENT_DISCOUNT",
"conditional_rule_value_type": "PERCENT",
"conditional_rule_value": "5",
"rule_expiry_terms": {
"rule_expiry_condition": "SEVEN_DAYS_AFTER_ISSUE_DATE",
"condition_rule_end_date": "2025-03-12"
},
"created_time": "2025-01-29T10:15:30Z",
"updated_time": "2025-01-29T10:15:30Z",
"links": [
{
"href": "/v2/invoicing/invoices/INV2-S884-EJT6-73AU-QF4C/conditional-rules/CR-11FF-A725-27C6999C-A699-33CD614E75E",
"rel": "self",
"method": "GET"
},
{
"href": "/v2/invoicing/invoices/INV2-S884-EJT6-73AU-QF4C/conditional-rules/CR-11FF-A725-27C6999C-A699-33CD614E75E",
"rel": "update",
"method": "PUT"
},
{
"href": "v2/invoicing/invoices/INV2-S884-EJT6-73AU-QF4C/conditional-rules/CR-11FF-A725-27C6999C-A699-33CD614E75E",
"rel": "delete",
"method": "DELETE"
}
]
}
]
}{
"rules": [
{
"conditional_rule_id": "string",
"conditional_rule_type": "EARLY_PAYMENT_DISCOUNT",
"conditional_rule_value": "string",
"conditional_rule_value_type": "PERCENT",
"discount_id": "string",
"discount_name": "string",
"rule_expiry_terms": {
"rule_expiry_condition": "THREE_DAYS_AFTER_ISSUE_DATE",
"condition_rule_end_date": "string"
},
"create_time": "string",
"update_time": "string",
"links": [
{
"href": "string",
"rel": "string",
"method": "CONNECT"
}
]
}
],
"links": [
{
"href": "string",
"rel": "string",
"method": "CONNECT"
}
]
}{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "80931aae87961",
"details": [
{
"issue": "INVALID_PARAMETER_VALUE",
"description": "The value of a field is invalid.",
"field": "/rules/0/rule_expiry_terms/rule_expiry_condition",
"value": "SEVENTY_DAYS_AFTER_ISSUE_DATE",
"location": "body"
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/invoicing/#errors",
"rel": "information_link",
"method": "GET"
}
]
}{
"name": "AUTHENTICATION_FAILURE",
"debug_id": "b1d1f06c7246c",
"message": "Authentication failed due to missing Authorization header, or invalid authentication credentials."
}{
"name": "NOT_AUTHORIZED",
"debug_id": "b1d1f06c7246c",
"message": "Authorization failed due to insufficient permissions."
}{
"name": "INTERNAL_SERVER_ERROR",
"debug_id": "b1d1f06c7246c",
"message": "An internal server error has occurred."
}{
"name": "INTERNAL_SERVER_ERROR",
"debug_id": "b1d1f06c7246c",
"message": "An internal server error has occurred."
}