Can't set processed_at for transactions

Solved
Ben614
New Member
2 0 0

I'm using a private app with API version 2020-01. I want to set a processed_at value for a transaction. It does not seem to work as described in the docs:

 
const uri = `https://${apiKey}:${password}@${shopDomain}/admin/api/${API_VERSION}/orders/${orderId}/transactions.json`;

const trx: ITransaction = {
    kind: TransactionKinds.sale,
    source: TransactionSources.external,
    amount: 0.01,        
    gateway: 'test',
    processed_at: '2020-04-01T00:00:00-5:00'
};

let res = await rp({
    uri: uri,
    method: 'POST',
    json: true,
    body: { transaction: trx }  
});

 

The response comes back with processed_at equal to created_at instead of the value I set. Am I misunderstanding something?

 

Response:

{ transaction:
   { id: 2655548211255,
     order_id: 1976287264823,
     kind: 'sale',
     gateway: 'test',
     status: 'success',
     message: null,
     created_at: '2020-04-28T23:28:01-04:00',
     test: false,
     authorization: null,
     location_id: null,
     user_id: null,
     parent_id: null,
     processed_at: '2020-04-28T23:28:01-04:00',
     device_id: null,
     receipt: {},
     error_code: null,
     source_name: '3436931',
     amount: '0.01',
     currency: 'USD',
     admin_graphql_api_id: 'gid://shopify/OrderTransaction/2655548211255' } }
0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 135

This is an accepted solution.

Hi @Ben614 ,

 

Your app will need to be whitelisted by Shopify in order to import orders with the "processed_at" time set to a value earlier than the 'created_at' timeslot. However I do not believe we grant this whitelist to private apps for the time being.  

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Ben614
New Member
2 0 0

I see. Thanks for explaining.

0 Likes