Created
March 14, 2018 18:11
-
-
Save joasgarcia/4604ca4dbf5cb1e9840a793b7e07d9d2 to your computer and use it in GitHub Desktop.
Criar cliente API ASAAS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$customerData = array( | |
"name" => "João da Silva", | |
"cpfCnpj" => "09434952967", | |
"postalCode" => "89223005", | |
"mobilePhone" => "47989134255", | |
"email" => "[email protected]" | |
); | |
$customerParamsJson = json_encode($customerData); | |
$curlRequest = curl_init("https://www.asaas.com/api/v3/customers"); | |
curl_setopt($curlRequest, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($curlRequest, CURLOPT_POSTFIELDS, $customerParamsJson); | |
curl_setopt($curlRequest, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curlRequest, CURLOPT_HTTPHEADER, array( | |
"Content-Type: application/json", | |
"access_token: <COLOQUE AQUI A SUA API KEY>" | |
)); | |
$responseData = curl_exec($curlRequest); | |
curl_close($curlRequest); | |
var_dump($responseData); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment