{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/328","labels_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/328/comments","events_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/328/events","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/328","id":87209249,"number":328,"title":"Not Able To Change Status Of Invoice","user":{"login":"amitpanwar86","id":4171262,"avatar_url":"https://avatars.githubusercontent.com/u/4171262?v=3","gravatar_id":"","url":"https://api.github.com/users/amitpanwar86","html_url":"https://github.com/amitpanwar86","followers_url":"https://api.github.com/users/amitpanwar86/followers","following_url":"https://api.github.com/users/amitpanwar86/following{/other_user}","gists_url":"https://api.github.com/users/amitpanwar86/gists{/gist_id}","starred_url":"https://api.github.com/users/amitpanwar86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitpanwar86/subscriptions","organizations_url":"https://api.github.com/users/amitpanwar86/orgs","repos_url":"https://api.github.com/users/amitpanwar86/repos","events_url":"https://api.github.com/users/amitpanwar86/events{/privacy}","received_events_url":"https://api.github.com/users/amitpanwar86/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/labels/api-bug","name":"api-bug","color":"e11d21"},{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/labels/api-invoicing","name":"api-invoicing","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-11T04:42:04Z","updated_at":"2015-06-23T04:48:14Z","closed_at":null,"body":"HI,\r\n\r\nI am facing a problem in marking invoice as `MARKED_AS_PAID`.\r\nHere is my code :\r\n\r\n````php\r\n$invoice=new Invoice();\r\n$invoice->setId($invoiceId);\r\n$invoice->setStatus(\"MARKED_AS_PAID\");\r\n$updateStatus=$invoice->update($apiContext);\r\nreturn true;\r\n````\r\n\r\nBut i am getting an error Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/invoicing/invoices/*************. I am stuck in this issue.\r\nCan anyone please tell whats wrong with this???\r\n\r\nMany Thanks in Advance,"},"comment":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/comments/114355216","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/328#issuecomment-114355216","issue_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/328","id":114355216,"user":{"login":"amitpanwar86","id":4171262,"avatar_url":"https://avatars.githubusercontent.com/u/4171262?v=3","gravatar_id":"","url":"https://api.github.com/users/amitpanwar86","html_url":"https://github.com/amitpanwar86","followers_url":"https://api.github.com/users/amitpanwar86/followers","following_url":"https://api.github.com/users/amitpanwar86/following{/other_user}","gists_url":"https://api.github.com/users/amitpanwar86/gists{/gist_id}","starred_url":"https://api.github.com/users/amitpanwar86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitpanwar86/subscriptions","organizations_url":"https://api.github.com/users/amitpanwar86/orgs","repos_url":"https://api.github.com/users/amitpanwar86/repos","events_url":"https://api.github.com/users/amitpanwar86/events{/privacy}","received_events_url":"https://api.github.com/users/amitpanwar86/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T04:48:14Z","updated_at":"2015-06-23T04:48:14Z","body":"Hey @jaypatel512. Below is more debugging info : \r\n\r\nThis is how my invoice looks like when I get it from the REST API : \r\n{\r\n  \"id\": \"INV2-8Z2J-BNN3-9ERS-XVJF\",\r\n  \"number\": \"0037\",\r\n  \"status\": \"PAID\",\r\n  \"merchant_info\": {\r\n    \"email\": \"aboutmyspeech-facilitator@gmail.com\",\r\n    \"first_name\": \"Developer\",\r\n    \"last_name\": \"Test\",\r\n    \"business_name\": \"A-1 Technology\",\r\n    \"phone\": {\r\n      \"country_code\": \"001\",\r\n      \"national_number\": \"8288877119\"\r\n    },\r\n    \"address\": {\r\n      \"line1\": \"Line 1\",\r\n      \"city\": \"Portland\",\r\n      \"state\": \"OR\",\r\n      \"postal_code\": \"97217\",\r\n      \"country_code\": \"US\",\r\n      \"phone\": {\r\n        \"country_code\": \"001\",\r\n        \"national_number\": \"8288877119\"\r\n      }\r\n    }\r\n  },\r\n  \"billing_info\": [\r\n    {\r\n      \"email\": \"bst_28@yahoo.co.in\",\r\n      \"business_name\": \"Aone\",\r\n      \"address\": {\r\n        \"line1\": \"H.no.616, IInd Floor\",\r\n        \"line2\": \"H.no.616, IInd Floor\",\r\n        \"city\": \"Mohali\",\r\n        \"state\": \"PB\",\r\n        \"postal_code\": \"160062\",\r\n        \"country_code\": \"US\"\r\n      },\r\n      \"additional_info\": \"Pay Per Use Invoicessss\"\r\n    }\r\n  ],\r\n  \"items\": [\r\n    {\r\n      \"name\": \"Home\",\r\n      \"quantity\": 10,\r\n      \"unit_price\": {\r\n        \"currency\": \"USD\",\r\n        \"value\": \"0.17\"\r\n      }\r\n    },\r\n    {\r\n      \"name\": \"Brain Games\",\r\n      \"quantity\": 10,\r\n      \"unit_price\": {\r\n        \"currency\": \"USD\",\r\n        \"value\": \"0.20\"\r\n      }\r\n    }\r\n  ],\r\n  \"invoice_date\": \"2015-06-22 PDT\",\r\n  \"note\": \"Pay Per Use Invoice\",\r\n  \"logo_url\": \"https:\\/\\/www.google.co.in\\/images\\/srpr\\/logo11w.png\",\r\n  \"total_amount\": {\r\n    \"currency\": \"USD\",\r\n    \"value\": \"3.70\"\r\n  },\r\n  \"metadata\": {\r\n    \"created_date\": \"2015-06-22 21:36:08 PDT\",\r\n    \"first_sent_date\": \"2015-06-22 21:36:10 PDT\",\r\n    \"last_sent_date\": \"2015-06-22 21:36:10 PDT\",\r\n    \"payer_view_url\": \"https:\\/\\/www.sandbox.paypal.com\\/cgi_bin\\/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-8Z2J-BNN3-9ERS-XVJF\"\r\n  }\r\n}\r\n\r\nBelow is the response I get from Paypal when running update : \r\n\r\n{\r\n  \"name\": \"VALIDATION_ERROR\",\r\n  \"message\": \"Invalid request - see details.\",\r\n  \"debug_id\": \"aa96c811161e2\",\r\n  \"details\": [\r\n    {\r\n      \"field\": \"metadata.created_date\",\r\n      \"issue\": \"Can not construct instance of java.util.Calendar from String value '2015-06-22 21:36:08 PDT': not a valid representation (error: Can not parse date \\\"2015-06-22 21:36:08 PDT\\\": not compatible with any of standard forms (\\\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\\\", \\\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\\\", \\\"EEE, dd MMM yyyy HH:mm:ss zzz\\\", \\\"yyyy-MM-dd\\\")) at line:1, column:1049\"\r\n    }\r\n  ]\r\n}\r\n\r\nHope this helps in debugging this issue!"}}