Skip to content

Instantly share code, notes, and snippets.

@leomp12
Last active May 7, 2020 20:34
Show Gist options
  • Save leomp12/3ec7a835dedb5858da57a6ec9f5e81ad to your computer and use it in GitHub Desktop.
Save leomp12/3ec7a835dedb5858da57a6ec9f5e81ad to your computer and use it in GitHub Desktop.

Revisions

  1. leomp12 revised this gist May 7, 2020. 1 changed file with 44 additions and 5 deletions.
    49 changes: 44 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -24,10 +24,6 @@ POST /orders/:_id/payments_history.json
    Exemplo com informações adicionais no corpo do POST:

    ```
    POST /orders/:_id/payments_history.json
    ```

    ```json
    {
    "transaction_id": "fe1230000000000000000005",
    @@ -50,4 +46,47 @@ POST /orders/:_id/payments_history.json
    - `in_dispute`
    - `refunded`
    - `voided`
    - `unknown`
    - `unknown`

    ## Atualizando status de entrega

    Basta inserir uma entrada via POST no subresource `fulfillments`:

    ```
    POST /orders/:_id/fulfillments.json
    ```

    ```json
    {
    "date_time": "2020-05-07T20:12:47.924Z",
    "status": "shipped"
    }
    ```

    > No exemplo acima o status de entrega do pedido `:_id` será alterado para **enviado**.
    Exemplo com informações adicionais no corpo do POST:

    ```json
    {
    "shipping_line_id": "af1230000000000000000005",
    "date_time": "2020-05-07T20:12:47.924Z",
    "status": "delivered",
    "notification_code": "TN1234567",
    "flags": [
    "azul-cargo"
    ]
    }
    ```

    #### Possíveis status de fulfillment

    - `invoice_issued`
    - `in_production`
    - `in_separation`
    - `ready_for_shipping`
    - `shipped`
    - `delivered`
    - `returned_for_exchange`
    - `received_for_exchange`
    - `returned`
  2. leomp12 revised this gist May 7, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,8 @@ POST /orders/:_id/payments_history.json
    }
    ```

    Possíveis status:
    #### Possíveis status de transação

    - `pending`
    - `under_analysis`
    - `authorized`
  3. leomp12 renamed this gist May 7, 2020. 1 changed file with 0 additions and 0 deletions.
  4. leomp12 created this gist May 7, 2020.
    52 changes: 52 additions & 0 deletions E-Com Plus - Atualizar status de pedido via Store API
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    # E-Com Plus - Atualizar status de pedido via Store API

    [Referência da API](https://developers.e-com.plus/docs/api/#/store/orders)

    A forma recomendada de promover uma alteração de status de transações ou entrega (fulfillment) é
    inserindo registros com (pelo menos) o status atual e data/hora da última atualização.

    ## Atualizando status financeiro

    Basta inserir uma entrada via POST no subresource `payments_history`:

    ```
    POST /orders/:_id/payments_history.json
    ```

    ```json
    {
    "date_time": "2020-05-07T20:12:47.924Z",
    "status": "paid"
    }
    ```

    > No exemplo acima o status financeiro do pedido `:_id` será alterado para **pago**.

    Exemplo com informações adicionais no corpo do POST:

    ```
    POST /orders/:_id/payments_history.json
    ```

    ```json
    {
    "transaction_id": "fe1230000000000000000005",
    "date_time": "2020-05-07T20:12:47.924Z",
    "status": "paid",
    "notification_code": "WH1234567",
    "flags": [
    "pdv-1"
    ]
    }
    ```

    Possíveis status:
    - `pending`
    - `under_analysis`
    - `authorized`
    - `unauthorized`
    - `paid`
    - `in_dispute`
    - `refunded`
    - `voided`
    - `unknown`