lib/DealsService.php
public function create(array $deal, array $options = array())
  {
    $attributes = array_intersect_key($deal, array_flip(self::$keysToPersist));
    if (isset($attributes['custom_fields']) && empty($attributes['custom_fields'])) unset($attributes['custom_fields']);
    if (isset($attributes['value'])) $attributes["value"] = Coercion::toStringValue($attributes['value']);
    list($code, $createdDeal) = $this->httpClient->post("/deals", $attributes, $options);
    if (isset($options['raw']) && $options['raw']) {
      return $createdDeal;
    }
    $createdDeal = $this->coerceDealData($createdDeal);
    return $createdDeal;
  }
public function create(array $deal, array $options = array())
  {
    $attributes = array_intersect_key($deal, array_flip(self::$keysToPersist));
    if (isset($attributes['custom_fields']) && empty($attributes['custom_fields'])) unset($attributes['custom_fields']);
    if (isset($attributes['value'])) $attributes["value"] = Coercion::toStringValue($attributes['value']);
    list($code, $createdDeal) = $this->httpClient->post("/deals", $attributes, $options);
    if (isset($options['raw']) && $options['raw']) {
      return $createdDeal;
    }
    $createdDeal = $this->coerceDealData($createdDeal);
    return $createdDeal;
  }
public function create ( array $ deal , array $ options = array ( ) ) { $ attributes = array_intersect_key ( $ deal , array_flip ( self :: $ keysToPersist ) ) ; if ( isset ( $ attributes [ 'custom_fields' ] ) && empty ( $ attributes [ 'custom_fields' ] ) ) unset ( $ attributes [ 'custom_fields' ] ) ; if ( isset ( $ attributes [ 'value' ] ) ) $ attributes [ "value" ] = Coercion :: toStringValue ( $ attributes [ 'value' ] ) ; list ( $ code , $ createdDeal ) = $ this -> httpClient -> post ( "/deals" , $ attributes , $ options ) ; if ( isset ( $ options [ 'raw' ] ) && $ options [ 'raw' ] ) { return $ createdDeal ; } $ createdDeal = $ this -> coerceDealData ( $ createdDeal ) ; return $ createdDeal ; }
Create a deal

post '/deals'

Create a new deal

@param array $deal This array's attributes describe the object to be created.
@param array $options Additional request's options.

@return array The resulting object representing created resource.
Create a deal