{"id":856,"date":"2021-06-18T22:07:36","date_gmt":"2021-06-18T21:07:36","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=856"},"modified":"2021-06-18T22:38:44","modified_gmt":"2021-06-18T21:38:44","slug":"paypal-rest-api-create-products","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/php\/paypal-rest-api-create-products\/","title":{"rendered":"Paypal REST API create products"},"content":{"rendered":"<p><strong>Request URL<br \/>\n<\/strong>https:\/\/api-m.paypal.com\/v1\/catalogs\/products<\/p>\n<p><strong>Method:<\/strong> Post<\/p>\n<p><strong>Header<br \/>\n<\/strong><span style=\"color: #0000ff;\">Authorization:<\/span> Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\u00a0 <span style=\"color: #99cc00;\"><em>\/\/ xxxxxxxxxxxxxxxx\u00a0 is base64 encoded Client ID:Secret\u00a0 \/\/ base64_encode(client_id_string:client_secret_string) \u2013 note the colon in between<br \/>\n<\/em><span style=\"color: #0000ff;\">PayPal-Request-Id:<\/span><span style=\"color: #000000;\">TEST-REQ-ID-12345\u00a0<\/span><em><span style=\"color: #000000;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212;-\u00a0 This is optional. Passing this will make consequent requests work on same initial Request. Better to omit it.<\/span><\/em><\/span><\/p>\n<p><strong>Body<br \/>\n<\/strong><\/p>\n<pre class='wp-code-highlight prettyprint'>{\r\n  \"id\": \"YOUR OWN PRODUCT ID\",\r\n  \"name\": \"NAME\",\r\n  \"status\": \"ACTIVE\",\r\n  \"description\": \"DESCRIPTION GOES HERE\",\r\n  \"type\":\"DIGITAL\", <span style=\"color: #99cc00;\"><em>\/\/SUITABLE TYPE<\/em><\/span>\r\n  \"category\":\"SOFTWARE\",  <span style=\"color: #99cc00;\"><em>\/\/SUITABLE CATEGORY<\/em><\/span>\r\n  \"home_url\":\"YOUR WEBSITE PAGE - WHERE DETAILS OF PRODUCT IS THERE\"\r\n}\r\n<\/pre>\n<p><strong>Return<\/strong><br \/>\nThe call will return the same details on success<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Request URL https:\/\/api-m.paypal.com\/v1\/catalogs\/products Method: Post Header Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\u00a0 \/\/ xxxxxxxxxxxxxxxx\u00a0 is base64 encoded Client ID:Secret\u00a0 \/\/ base64_encode(client_id_string:client_secret_string) \u2013 note the colon in between PayPal-Request-Id:TEST-REQ-ID-12345\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212;-\u00a0 This is optional. Passing this will make consequent requests work on same initial Request. Better to omit it. Body { &#8220;id&#8221;: &#8220;YOUR OWN PRODUCT ID&#8221;, &#8220;name&#8221;: &#8220;NAME&#8221;, &#8220;status&#8221;: &#8220;ACTIVE&#8221;,&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/php\/paypal-rest-api-create-products\/\">Continue reading <span class=\"screen-reader-text\">Paypal REST API create products<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[317,318],"class_list":["post-856","post","type-post","status-publish","format-standard","hentry","category-php","tag-paypal","tag-paypal-rest-api","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=856"}],"version-history":[{"count":1,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/856\/revisions"}],"predecessor-version":[{"id":861,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/856\/revisions\/861"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}