Skip to content

getReturns param returnCreationStartDate gives Object of class DateTime could not be converted to string #28

Description

@Vickyvignesh-01

The getReturns() param returnCreationStartDate, returnCreationEndDate expects DateTime, if i give the datetime type like
2024-12-01T00:00:01Z (converted into Datetime type) it gives error as Object of class DateTime could not be converted to string below is the code
$returnCreationStartDateString = new \DateTime ('2024-12-10T00:00:01Z');
$returnCreationEndDateString = new \DateTime ('2024-12-10T23:00:01Z');

    $returnOrderId = null; 
    $customerOrderId = null; 
    $status = null; 
    $replacementInfo = null; 
    $returnType = null; 
    $returnCreationStartDate = $returnCreationStartDateString;
    $returnCreationEndDate = $returnCreationEndDateString;
    $returnLastModifiedStartDate = null; 
    $returnLastModifiedEndDate = null; 
    $limit = '200';

    $result = $returnsApi->getReturns($returnOrderId, $customerOrderId, $status, $replacementInfo, $returnType, $returnCreationStartDate, $returnCreationEndDate, $returnLastModifiedStartDate, $returnLastModifiedEndDate, $limit);
    
    how could i resolve this? @jlevers 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions