{"id":3473,"date":"2021-03-09T22:43:53","date_gmt":"2021-03-09T22:43:53","guid":{"rendered":"https:\/\/documents.openpay.mx\/?p=3473"},"modified":"2021-03-10T19:39:00","modified_gmt":"2021-03-10T19:39:00","slug":"searches","status":"publish","type":"post","link":"https:\/\/documents-mx-dev.opdevhm.com\/en\/docs\/searches.html","title":{"rendered":"Searches"},"content":{"rendered":"
Openpay allow filter searches of payouts<\/a><\/strong>, charges<\/a><\/strong>, customers<\/a><\/strong>, transfers<\/a><\/strong>, cards<\/a><\/strong>, bank accounts<\/a><\/strong>, plans<\/a><\/strong>, suscriptions<\/a><\/strong>, fees<\/a><\/strong>, webhooks<\/a><\/strong> and stores<\/a><\/strong> by the API, in the manner shown in the links.<\/p> In addition to this there are two special searches that can be performed based on the identifiers generated by the merchant and associated with openpay platform, these are:<\/p> Both are described below.<\/p> Recall that this attribute was provided by the merchant when he created the charge in openpay, and is a unique value from that merchant. For this example we will look for a charge which is identified as my-oid-0001<\/strong><\/em>.<\/p> If the request is correct and find this charge, then a response with a object transaction<\/a> represented according to the language of the library used will be returned.<\/p> Response:<\/strong><\/p> \u00a0<\/p> \u00a0<\/p> Recall that this attribute was provided by the merchant when he created the customer in openpay, and is a unique value from that merchant. For this example we will look for a customer which is identified as myBestClient001<\/strong><\/em>.<\/p> If the request is correct and find this customer, then a response with a object customer<\/a> represented according to the language of the library used will be returned.<\/p> Response:<\/strong><\/p> \u00a0<\/p>order_id<\/strong><\/code><\/li>
external_id<\/strong><\/code><\/li><\/ul>
Search of charges by order_id<\/h2>
<?php<\/span>\n$openpay<\/span> =<\/span> Openpay<\/span>::<\/span>getInstance<\/span>(<\/span>'mzdtln0bmtms6o3kck8f'<\/span>,<\/span> \n 'sk_e568c42a6c384b7ab02cd47d2e407cab'<\/span>);<\/span>\n\n$findDataRequest<\/span> =<\/span> array<\/span><\/strong>(<\/span>\n 'order_id'<\/span> =><\/span> 'my-oid-0001'<\/span>\n);<\/span>\n\n$chargeList<\/span> =<\/span> $openpay<\/span>-><\/span>charges<\/span>-><\/span>getList<\/span>(<\/span>$findDataRequest<\/span>);<\/span>\n?><\/span><\/code><\/pre><\/figure><\/div>
[<\/span>\n {<\/span>\n \"id\"<\/span>:<\/span>\"tryqihxac3msedn4yxed\"<\/span>,<\/span>\n \"amount\"<\/span>:<\/span>100.00<\/span>,<\/span>\n \"authorization\"<\/span>:<\/span>\"801585\"<\/span>,<\/span>\n \"method\"<\/span>:<\/span>\"card\"<\/span>,<\/span>\n \"operation_type\"<\/span>:<\/span>\"in\"<\/span>,<\/span>\n \"transaction_type\"<\/span>:<\/span>\"charge\"<\/span>,<\/span>\n \"card\"<\/span>:{<\/span>\n \"type\"<\/span>:<\/span>\"debit\"<\/span>,<\/span>\n \"brand\"<\/span>:<\/span>\"visa\"<\/span>,<\/span>\n \"address\"<\/span>:<\/span>null<\/span><\/strong>,<\/span>\n \"card_number\"<\/span>:<\/span>\"411111XXXXXX1111\"<\/span>,<\/span>\n \"holder_name\"<\/span>:<\/span>\"Juan Perez Ramirez\"<\/span>,<\/span>\n \"expiration_year\"<\/span>:<\/span>\"20\"<\/span>,<\/span>\n \"expiration_month\"<\/span>:<\/span>\"12\"<\/span>,<\/span>\n \"allows_charges\"<\/span>:<\/span>true<\/span><\/strong>,<\/span>\n \"allows_payouts\"<\/span>:<\/span>true<\/span><\/strong>,<\/span>\n \"bank_name\"<\/span>:<\/span>\"Banamex\"<\/span>,<\/span>\n \"bank_code\"<\/span>:<\/span>\"002\"<\/span>\n },<\/span>\n \"status\"<\/span>:<\/span>\"completed\"<\/span>,<\/span>\n \"currency\"<\/span>:<\/span>\"MXN\"<\/span>,<\/span>\n \"creation_date\"<\/span>:<\/span>\"2014-05-26T14:00:17-05:00\"<\/span>,<\/span>\n \"operation_date\"<\/span>:<\/span>\"2014-05-26T14:00:17-05:00\"<\/span>,<\/span>\n \"description\"<\/span>:<\/span>\"Cargo inicial a mi cuenta\"<\/span>,<\/span>\n \"error_message\"<\/span>:<\/span>null<\/span><\/strong>,<\/span>\n \"order_id\"<\/span>:<\/span>my-oid<\/span>-0001<\/span>,<\/span>\n \"customer_id\"<\/span>:<\/span>\"ag4nktpdzebjiye1tlze\"<\/span>\n }<\/span>\n]<\/span><\/code><\/pre><\/figure>
Search of customer by external_id<\/h2>
<?php<\/span>\n$openpay<\/span> =<\/span> Openpay<\/span>::<\/span>getInstance<\/span>(<\/span>'mzdtln0bmtms6o3kck8f'<\/span>,<\/span> \n 'sk_e568c42a6c384b7ab02cd47d2e407cab'<\/span>);<\/span>\n\n$findDataRequest<\/span> =<\/span> array<\/span><\/strong>(<\/span>\n 'external_id'<\/span> =><\/span> 'myBestClient001'<\/span>\n);<\/span>\n\n$customerList<\/span> =<\/span> $openpay<\/span>-><\/span>customers<\/span>-><\/span>getList<\/span>(<\/span>$findDataRequest<\/span>);<\/span>\n?><\/span><\/code><\/pre><\/figure><\/div>
[<\/span>\n {<\/span>\n \"id\"<\/span>:<\/span>\"anbnldwgni1way3yp2dw\"<\/span>,<\/span>\n \"name\"<\/span>:<\/span>\"customer name\"<\/span>,<\/span>\n \"last_name\"<\/span>:<\/span>customer<\/span> last<\/span> name<\/span><\/span>